aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2012-08-21 15:51:59 -0500
committerJack Nagel2012-08-21 15:55:20 -0500
commit5e0cbdab9bfe0db2d5f8e3c68a8d848f1742b27c (patch)
tree45c90cf2ebf9bf1f7ed94811b0ced728bee19e72 /Library
parent98b6f2451062e0e4c61ad39c962157b21852e4ee (diff)
downloadbrew-5e0cbdab9bfe0db2d5f8e3c68a8d848f1742b27c.tar.bz2
factory: rescue NameError
Due to the new const_defined? checks, passing certain names (such as those that start with a digit) that are illegal constant names will raise NameError. Catch this and error out gracefully, as we would have previously. Fixes Homebrew/homebrew#14342. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/formula.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index f2638bc02..96ea65ba0 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -403,7 +403,7 @@ class Formula
return klass.new(name) if install_type == :from_name
return klass.new(name, target_file)
- rescue LoadError
+ rescue LoadError, NameError
raise FormulaUnavailableError.new(name)
end