Skip to content
Snippets Groups Projects
Commit 633f29af authored by Jack Nagel's avatar Jack Nagel
Browse files

Remove duplicated logic from FromUrlLoader

parent 2bf1f937
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment