bottles: fix options hashes

Defaults can't be specified in the parameter list, as they will be
overwritten by whatever is passed in. Instead the defaults must be
merged with the argument in the method body.
This commit is contained in:
Jack Nagel 2013-12-08 16:39:59 -06:00
parent b30f409995
commit b45cadd19a

View File

@ -3,7 +3,8 @@ require 'os/mac'
require 'extend/ARGV' require 'extend/ARGV'
require 'bottle_version' require 'bottle_version'
def bottle_filename f, options={:tag=>bottle_tag} def bottle_filename f, options={}
options = { :tag => bottle_tag }.merge(options)
name = f.name.downcase name = f.name.downcase
version = f.stable.version version = f.stable.version
options[:revision] ||= f.bottle.revision.to_i if f.bottle options[:revision] ||= f.bottle.revision.to_i if f.bottle
@ -48,7 +49,8 @@ def bottle_file_outdated? f, file
bottle_ext && bottle_url_ext && bottle_ext != bottle_url_ext bottle_ext && bottle_url_ext && bottle_ext != bottle_url_ext
end end
def bottle_native_suffix options={:tag=>bottle_tag} def bottle_native_suffix options={}
options = { :tag => bottle_tag }.merge(options)
".#{options[:tag]}#{bottle_suffix(options[:revision])}" ".#{options[:tag]}#{bottle_suffix(options[:revision])}"
end end