diff options
| author | Martin Afanasjew | 2016-07-08 01:14:34 +0200 |
|---|---|---|
| committer | GitHub | 2016-07-08 01:14:34 +0200 |
| commit | bf40dd64dff1fc86b0ecbde33dc9e3be3ef3fccb (patch) | |
| tree | f179c96a8cdc428671db3969904be3802cd9a650 /Library/Homebrew | |
| parent | 86b1df96b9a439c9a31556c0e9fd6c297e4f6646 (diff) | |
| download | brew-bf40dd64dff1fc86b0ecbde33dc9e3be3ef3fccb.tar.bz2 | |
tab: eliminate redundant 'Tab.create' arguments (#468)
The `build` and `source_modified_time` arguments are always coming from
the matching attributes of the `Formula` instance. Thus query `formula`
for them instead of passing them individually.
Diffstat (limited to 'Library/Homebrew')
| -rw-r--r-- | Library/Homebrew/build.rb | 3 | ||||
| -rw-r--r-- | Library/Homebrew/tab.rb | 5 |
2 files changed, 5 insertions, 3 deletions
diff --git a/Library/Homebrew/build.rb b/Library/Homebrew/build.rb index 1c9584719..8915e948c 100644 --- a/Library/Homebrew/build.rb +++ b/Library/Homebrew/build.rb @@ -131,7 +131,8 @@ class Build formula.install stdlibs = detect_stdlibs(ENV.compiler) - Tab.create(formula, ENV.compiler, stdlibs.first, formula.build, formula.source_modified_time).write + tab = Tab.create(formula, ENV.compiler, stdlibs.first) + tab.write # Find and link metafiles formula.prefix.install_metafiles formula.buildpath diff --git a/Library/Homebrew/tab.rb b/Library/Homebrew/tab.rb index a407496bb..58eee9478 100644 --- a/Library/Homebrew/tab.rb +++ b/Library/Homebrew/tab.rb @@ -15,7 +15,8 @@ class Tab < OpenStruct CACHE.clear end - def self.create(formula, compiler, stdlib, build, source_modified_time) + def self.create(formula, compiler, stdlib) + build = formula.build attributes = { "used_options" => build.used_options.as_flags, "unused_options" => build.unused_options.as_flags, @@ -23,7 +24,7 @@ class Tab < OpenStruct "built_as_bottle" => build.bottle?, "poured_from_bottle" => false, "time" => Time.now.to_i, - "source_modified_time" => source_modified_time.to_i, + "source_modified_time" => formula.source_modified_time.to_i, "HEAD" => HOMEBREW_REPOSITORY.git_head, "compiler" => compiler, "stdlib" => stdlib, |
