aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/tab.rb
diff options
context:
space:
mode:
authorAdam Vandenberg2013-06-26 10:37:09 -0700
committerAdam Vandenberg2013-06-26 19:58:08 -0700
commit81cc136f343eb01648c54eab8734152593f7a2a1 (patch)
treefaba3df6a5c0af5440b182b4ce2e3055ad76157a /Library/Homebrew/tab.rb
parent03c3ea547a0934718e8c07cb223aa11eebbe8707 (diff)
downloadhomebrew-81cc136f343eb01648c54eab8734152593f7a2a1.tar.bz2
Be explicit about passing formulae names or instances to Tab
Diffstat (limited to 'Library/Homebrew/tab.rb')
-rw-r--r--Library/Homebrew/tab.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/Library/Homebrew/tab.rb b/Library/Homebrew/tab.rb
index 29655b221..a55df156d 100644
--- a/Library/Homebrew/tab.rb
+++ b/Library/Homebrew/tab.rb
@@ -42,8 +42,11 @@ class Tab < OpenStruct
end
end
+ def self.for_name name
+ for_formula(Formula.factory(name))
+ end
+
def self.for_formula f
- f = Formula.factory(f)
path = [f.opt_prefix, f.linked_keg].map{ |pn| pn.join(FILENAME) }.find{ |pn| pn.exist? }
# Legacy kegs may lack a receipt. If it doesn't exist, fake one
if path.nil? then self.dummy_tab(f) else self.from_file(path) end