diff --git a/bundler/lib/bundler/settings.rb b/bundler/lib/bundler/settings.rb index f5999481a8f7..92b4a6a4e377 100644 --- a/bundler/lib/bundler/settings.rb +++ b/bundler/lib/bundler/settings.rb @@ -102,10 +102,12 @@ def initialize(root = nil) def [](name) key = key_for(name) - values = configs.values - values.map! {|config| config[key] } - values.compact! - value = values.first + value = nil + configs.each do |_, config| + value = config[key] + next if value.nil? + break + end converted_value(value, name) end @@ -316,7 +318,7 @@ def key_for(key) private def configs - { + @configs ||= { :temporary => @temporary, :local => @local_config, :env => @env_config,