aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/formulary.rb
diff options
context:
space:
mode:
authorAdam Vandenberg2013-06-30 10:26:12 -0700
committerAdam Vandenberg2013-06-30 10:26:12 -0700
commit6b28c750f10174c3c358047b335770cef0f67b46 (patch)
tree1ca6690e65aba1baca76fdc87cc0b0a56970a25e /Library/Homebrew/formulary.rb
parent49bb053bade8fbe832c777f6ba98af19c21f2c22 (diff)
downloadhomebrew-6b28c750f10174c3c358047b335770cef0f67b46.tar.bz2
Catch another name error
Closes #20920.
Diffstat (limited to 'Library/Homebrew/formulary.rb')
-rw-r--r--Library/Homebrew/formulary.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/Library/Homebrew/formulary.rb b/Library/Homebrew/formulary.rb
index ef59460de..fb633d661 100644
--- a/Library/Homebrew/formulary.rb
+++ b/Library/Homebrew/formulary.rb
@@ -28,7 +28,13 @@ class Formulary
# Return the Class for this formula, `require`-ing it if
# it has not been parsed before.
def klass
- unless Formulary.formula_class_defined? name
+ begin
+ have_klass = Formulary.formula_class_defined? name
+ rescue NameError
+ raise FormulaUnavailableError.new(name)
+ end
+
+ unless have_klass
puts "#{$0}: loading #{path}" if ARGV.debug?
begin
require path.to_s
@@ -40,6 +46,7 @@ class Formulary
raise FormulaUnavailableError.new(name)
end
end
+
klass = Formulary.get_formula_class(name)
if (klass == Formula) || !klass.ancestors.include?(Formula)
raise FormulaUnavailableError.new(name)