aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2014-12-29 14:53:22 -0500
committerJack Nagel2014-12-29 14:59:18 -0500
commit633f29af5d3c96efb79c513375a8914ee0a0c163 (patch)
tree911bfaa50753cc83c2991937b184a5173a6d63a8 /Library
parent2bf1f93721fbcd96c6f4799838eaf13596dda513 (diff)
downloadbrew-633f29af5d3c96efb79c513375a8914ee0a0c163.tar.bz2
Remove duplicated logic from FromUrlLoader
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/formulary.rb21
1 files changed, 4 insertions, 17 deletions
diff --git a/Library/Homebrew/formulary.rb b/Library/Homebrew/formulary.rb
index 3ee853704..65a790639 100644
--- a/Library/Homebrew/formulary.rb
+++ b/Library/Homebrew/formulary.rb
@@ -143,23 +143,10 @@ class Formulary
super formula, HOMEBREW_CACHE_FORMULA/File.basename(uri.path)
end
- # Downloads the formula's .rb file
- def fetch
- 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
- end
- end
-
- def get_formula(spec)
- fetch
+ def load_file
+ HOMEBREW_CACHE_FORMULA.mkpath
+ FileUtils.rm_f(path)
+ curl url, "-o", path
super
end
end