Skip to content

Commit

Permalink
Last fix?
Browse files Browse the repository at this point in the history
  • Loading branch information
deivid-rodriguez committed Sep 8, 2020
1 parent 783042b commit 6ab88b2
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions bundler/lib/bundler/settings.rb
Expand Up @@ -97,6 +97,11 @@ def [](name)
converted_value(value, name)
end

def value_for(name, config)
key = key_for(name)
converted_value(config[key], name)
end

def set_command_option(key, value)
if Bundler.feature_flag.forget_cli_options?
temporary(key => value)
Expand Down Expand Up @@ -206,13 +211,12 @@ def pretty_values_for(exposed_key)
# for legacy reasons, in Bundler 2, we do not respect :disable_shared_gems
def path
configs.each do |level, config|
path_key = key_for("path")
path_system_key = key_for("path.system")
disable_shared_gems_key = key_for("disable_shared_gems")
path = config[path_key]
system_path = config[path_system_key].nil? ? (config[disable_shared_gems_key].nil? ? config[disable_shared_gems_key] : !config[disable_shared_gems_key]) : config[path_system_key]
next if path.nil? && system_path.nil?
return Path.new(converted_value(path, "path"), converted_value(system_path, "system.path")) unless !path.nil? && !system_path.nil?
path = value_for("path", config)
path_system = value_for("path.system", config)
disabled_shared_gems = value_for("disable_shared_gems", config)
next if path.nil? && path_system.nil? && disabled_shared_gems.nil?
system_path = (path_system == true) || (disabled_shared_gems == false)
return Path.new(path, system_path) unless path && system_path
path = pretty_values_for(:path)
path.unshift(nil, "path:") unless path.empty?
system_path = pretty_values_for("path.system")
Expand Down

0 comments on commit 6ab88b2

Please sign in to comment.