Use Resource#downloader for BottleLoader.
This commit is contained in:
parent
3d27b2aa8d
commit
9ffc7dd465
@ -105,7 +105,7 @@ module Formulary
|
||||
formula_name = File.basename(bottle_name)[/(.+)-/, 1]
|
||||
resource = Resource.new(formula_name) { url bottle_name }
|
||||
resource.specs[:bottle] = true
|
||||
downloader = CurlDownloadStrategy.new(resource.download_name, resource.version, resource)
|
||||
downloader = resource.downloader
|
||||
cached = downloader.cached_location.exist?
|
||||
downloader.fetch
|
||||
ohai "Pouring the cached bottle" if cached
|
||||
|
||||
@ -64,7 +64,9 @@ class Resource
|
||||
end
|
||||
|
||||
def download_name
|
||||
name.nil? ? owner.name : "#{owner.name}--#{escaped_name}"
|
||||
return owner.name if name.nil?
|
||||
return escaped_name if owner.nil?
|
||||
"#{owner.name}--#{escaped_name}"
|
||||
end
|
||||
|
||||
def cached_download
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user