From b45cadd19a7acc17de456289951bd3f7301c5325 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Sun, 8 Dec 2013 16:39:59 -0600 Subject: [PATCH] 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(-) diff --git a/Library/Homebrew/bottles.rb b/Library/Homebrew/bottles.rb index 3838d4a503..2888a09c49 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