FormulaInstaller: make tab an attr, but never a parameter

This commit is contained in:
Jack Nagel 2013-01-23 00:26:27 -06:00
parent 55681ca201
commit 5822aa80cf
2 changed files with 7 additions and 5 deletions

View File

@ -60,7 +60,8 @@ module Homebrew extend self
tab = (f.opt_prefix.exist? ? Tab.for_keg(f.opt_prefix) : Tab.dummy_tab(f)) tab = (f.opt_prefix.exist? ? Tab.for_keg(f.opt_prefix) : Tab.dummy_tab(f))
outdated_keg = Keg.new(f.linked_keg.realpath) rescue nil outdated_keg = Keg.new(f.linked_keg.realpath) rescue nil
installer = FormulaInstaller.new(f, tab) installer = FormulaInstaller.new(f)
installer.tab = tab
installer.show_header = false installer.show_header = false
installer.install_bottle = (install_bottle?(f) and tab.used_options.empty?) installer.install_bottle = (install_bottle?(f) and tab.used_options.empty?)

View File

@ -7,15 +7,14 @@ require 'caveats'
class FormulaInstaller class FormulaInstaller
attr :f attr :f
attr :tab attr :tab, true
attr :show_summary_heading, true attr :show_summary_heading, true
attr :ignore_deps, true attr :ignore_deps, true
attr :install_bottle, true attr :install_bottle, true
attr :show_header, true attr :show_header, true
def initialize ff, tab=nil def initialize ff
@f = ff @f = ff
@tab = tab
@show_header = false @show_header = false
@ignore_deps = ARGV.ignore_deps? || ARGV.interactive? @ignore_deps = ARGV.ignore_deps? || ARGV.interactive?
@install_bottle = install_bottle? ff @install_bottle = install_bottle? ff
@ -170,9 +169,11 @@ class FormulaInstaller
def install_dependency dep def install_dependency dep
dep_tab = Tab.for_formula(dep) dep_tab = Tab.for_formula(dep)
dep = dep.to_formula dep = dep.to_formula
outdated_keg = Keg.new(dep.linked_keg.realpath) rescue nil outdated_keg = Keg.new(dep.linked_keg.realpath) rescue nil
fi = FormulaInstaller.new(dep, dep_tab) fi = FormulaInstaller.new(dep)
fi.tab = dep_tab
fi.ignore_deps = true fi.ignore_deps = true
fi.show_header = false fi.show_header = false
oh1 "Installing #{f} dependency: #{Tty.green}#{dep}#{Tty.reset}" oh1 "Installing #{f} dependency: #{Tty.green}#{dep}#{Tty.reset}"