From 6e1450e974803e4b7c61f91d03fb55d5de416232 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Sun, 15 Jun 2014 18:27:37 -0500 Subject: [PATCH] Handle illegal constant names when fetching remote formulae --- Library/Homebrew/formulary.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/formulary.rb b/Library/Homebrew/formulary.rb index 31a7fd51ec..da64a43e51 100644 --- a/Library/Homebrew/formulary.rb +++ b/Library/Homebrew/formulary.rb @@ -141,7 +141,13 @@ class Formulary # Downloads the formula's .rb file def fetch - unless Formulary.formula_class_defined? class_name + begin + have_klass = Formulary.formula_class_defined? class_name + rescue NameError + raise FormulaUnavailableError.new(name) + end + + unless have_klass HOMEBREW_CACHE_FORMULA.mkpath FileUtils.rm path.to_s, :force => true curl url, '-o', path.to_s