diff options
| author | Josh Hagins | 2016-10-10 12:02:12 -0400 | 
|---|---|---|
| committer | Josh Hagins | 2016-10-24 16:21:08 -0400 | 
| commit | 9c519bbdbc1723c9f35e4fbc8ba594ac8d81d258 (patch) | |
| tree | 4278fefe623f173ea73ec28c4d106eb3ff3a11bc /Library/Homebrew/tab.rb | |
| parent | 5b64fa6fb179bee5e45e16bb4f860579d76d4210 (diff) | |
| download | brew-9c519bbdbc1723c9f35e4fbc8ba594ac8d81d258.tar.bz2 | |
keg_relocate: refactor relocate_text_files
Replace relocate_text_files with three methods that clarify intent:
replace_locations_with_placeholders, replace_placeholders_with_locations
and replace_text_in_files, the first two calling the third.
Diffstat (limited to 'Library/Homebrew/tab.rb')
| -rw-r--r-- | Library/Homebrew/tab.rb | 5 | 
1 files changed, 1 insertions, 4 deletions
diff --git a/Library/Homebrew/tab.rb b/Library/Homebrew/tab.rb index 3ce6eadc5..1cabacefd 100644 --- a/Library/Homebrew/tab.rb +++ b/Library/Homebrew/tab.rb @@ -25,7 +25,6 @@ class Tab < OpenStruct        "tabfile" => formula.prefix.join(FILENAME),        "built_as_bottle" => build.bottle?,        "poured_from_bottle" => false, -      "changed_files" => [],        "time" => Time.now.to_i,        "source_modified_time" => formula.source_modified_time.to_i,        "HEAD" => HOMEBREW_REPOSITORY.git_head, @@ -62,7 +61,6 @@ class Tab < OpenStruct      attributes = Utils::JSON.load(content)      attributes["tabfile"] = path      attributes["source_modified_time"] ||= 0 -    attributes["changed_files"] ||= []      attributes["source"] ||= {}      tapped_from = attributes["tapped_from"] @@ -173,7 +171,6 @@ class Tab < OpenStruct        "unused_options" => [],        "built_as_bottle" => false,        "poured_from_bottle" => false, -      "changed_files" => [],        "time" => nil,        "source_modified_time" => 0,        "HEAD" => nil, @@ -306,7 +303,7 @@ class Tab < OpenStruct        "unused_options" => unused_options.as_flags,        "built_as_bottle" => built_as_bottle,        "poured_from_bottle" => poured_from_bottle, -      "changed_files" => changed_files.map(&:to_s), +      "changed_files" => changed_files && changed_files.map(&:to_s),        "time" => time,        "source_modified_time" => source_modified_time.to_i,        "HEAD" => self.HEAD,  | 
