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
commit1cd31496775ab8cf1051e22367c8ab6184bb3b97 (patch)
tree3c1815357a4f56950da0f7e28d3aa71d1a599880 /Library/Homebrew/tab.rb
parent5627ed21ce39271f503d45e7ff0cace837ba4b63 (diff)
downloadbrew-1cd31496775ab8cf1051e22367c8ab6184bb3b97.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