diff options
| author | Adam Vandenberg | 2013-06-30 10:26:12 -0700 |
|---|---|---|
| committer | Adam Vandenberg | 2013-06-30 10:26:12 -0700 |
| commit | b40615d66ac8572c6735f3bb9d6cd3e781edf740 (patch) | |
| tree | 9cc59ba7912ab16948601e5de9c69a59f8e06c50 /Library | |
| parent | 5b75c73df6ff868136831084b5e016f125e8a981 (diff) | |
| download | brew-b40615d66ac8572c6735f3bb9d6cd3e781edf740.tar.bz2 | |
Catch another name error
Closes Homebrew/homebrew#20920.
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/formulary.rb | 9 |
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) |
