From 3a6ffdac6dc2f52f2352a976fa25266f8edfcbd3 Mon Sep 17 00:00:00 2001 From: Adam Vandenberg Date: Mon, 24 Feb 2014 20:25:16 -0800 Subject: add Formula[] Closes #26930 --- Library/Homebrew/formula.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'Library') diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index e67337226..141f12636 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -359,7 +359,7 @@ class Formula def self.each names.each do |name| begin - yield Formula.factory(name) + yield Formulary.factory(name) rescue StandardError => e # Don't let one broken formula break commands. But do complain. onoe "Failed to import: #{name}" @@ -377,7 +377,7 @@ class Formula HOMEBREW_CELLAR.subdirs.map do |rack| begin - factory(rack.basename.to_s) + Formulary.factory(rack.basename.to_s) rescue FormulaUnavailableError end end.compact @@ -424,6 +424,11 @@ class Formula return name end + def self.[](name) + Formulary.factory(name) + end + + # deprecated def self.factory name Formulary.factory name end -- cgit v1.2.3