aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/bottles.rb
diff options
context:
space:
mode:
authorJack Nagel2014-07-18 15:14:42 -0500
committerJack Nagel2014-07-18 15:14:57 -0500
commita87d2108ea6e8b4261ca3411ff3b30b0a6714eeb (patch)
tree18bb7cea1667ae8d8b03a897d4367ff09ce370c4 /Library/Homebrew/bottles.rb
parent7d28a6c54bc361154a0d4b7be8e88baef5301c14 (diff)
downloadbrew-a87d2108ea6e8b4261ca3411ff3b30b0a6714eeb.tar.bz2
Move bottle filename construction to a class
Diffstat (limited to 'Library/Homebrew/bottles.rb')
-rw-r--r--Library/Homebrew/bottles.rb13
1 files changed, 3 insertions, 10 deletions
diff --git a/Library/Homebrew/bottles.rb b/Library/Homebrew/bottles.rb
index 0f5d36963..a85917717 100644
--- a/Library/Homebrew/bottles.rb
+++ b/Library/Homebrew/bottles.rb
@@ -3,14 +3,6 @@ require 'os/mac'
require 'extend/ARGV'
require 'bottle_version'
-def bottle_filename options={}
- name = options.fetch(:name)
- version = options.fetch(:version)
- tag = options.fetch(:tag)
- revision = options.fetch(:revision)
- "#{name}-#{version}.#{tag}#{bottle_suffix(revision)}"
-end
-
def built_as_bottle? f
return false unless f.installed?
tab = Tab.for_keg(f.installed_prefix)
@@ -36,8 +28,9 @@ def bottle_native_regex
/(\.#{bottle_tag}\.bottle\.(\d+\.)?tar\.gz)$/o
end
-def bottle_url(root_url, filename_options)
- "#{root_url}/#{bottle_filename(filename_options)}"
+def bottle_url(root_url, *filename_args)
+ filename = Bottle::Filename.new(*filename_args)
+ "#{root_url}/#{filename}"
end
def bottle_tag