aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/software_spec.rb
diff options
context:
space:
mode:
authorJack Nagel2014-07-18 15:14:42 -0500
committerJack Nagel2014-07-18 15:15:11 -0500
commit4a95f48e41cfde4007113d486c90367c1351d4a5 (patch)
treefb89ddf9117a57a672a832c768c9f64e75e4cb78 /Library/Homebrew/software_spec.rb
parent03fdaecee7632722e93edef2322b9d9ce629de86 (diff)
downloadhomebrew-4a95f48e41cfde4007113d486c90367c1351d4a5.tar.bz2
Move bottle URL construction to the bottle object
Diffstat (limited to 'Library/Homebrew/software_spec.rb')
-rw-r--r--Library/Homebrew/software_spec.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/Library/Homebrew/software_spec.rb b/Library/Homebrew/software_spec.rb
index dca84da21..5382103d4 100644
--- a/Library/Homebrew/software_spec.rb
+++ b/Library/Homebrew/software_spec.rb
@@ -143,7 +143,8 @@ class Bottle
checksum, tag = spec.checksum_for(bottle_tag)
- @resource.url = bottle_url(spec.root_url, formula.name, formula.pkg_version, tag, spec.revision)
+ filename = Filename.new(formula.name, formula.pkg_version, tag, spec.revision)
+ @resource.url = build_url(spec.root_url, filename)
@resource.download_strategy = CurlBottleDownloadStrategy
@resource.version = formula.pkg_version
@resource.checksum = checksum
@@ -155,6 +156,12 @@ class Bottle
def compatible_cellar?
cellar == :any || cellar == HOMEBREW_CELLAR.to_s
end
+
+ private
+
+ def build_url(root_url, filename)
+ "#{root_url}/#{filename}"
+ end
end
class BottleSpecification