From 560aebc0f4638afdb7cb53d0b35d55b678bde0fe Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Sun, 8 Dec 2013 16:39:59 -0600 Subject: 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. --- Library/Homebrew/bottles.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Library') diff --git a/Library/Homebrew/bottles.rb b/Library/Homebrew/bottles.rb index 3838d4a50..2888a09c4 100644 --- a/Library/Homebrew/bottles.rb +++ b/Library/Homebrew/bottles.rb @@ -3,7 +3,8 @@ require 'os/mac' require 'extend/ARGV' 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 version = f.stable.version 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 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])}" end -- cgit v1.2.3