diff options
author | Colby Swandale <colby@taplaboratories.com> | 2017-04-06 08:49:45 +1000 |
---|---|---|
committer | Colby Swandale <colby@taplaboratories.com> | 2017-04-06 08:49:45 +1000 |
commit | 3a76965b54e6ffc7d8325241ec75204dcf5732b0 (patch) | |
tree | 3fb52d61b67a973660b607ac5849b58f2e093b02 | |
parent | b167787a5bb56fba9b9410b175ea3a6d8f51756c (diff) | |
download | bundler-3a76965b54e6ffc7d8325241ec75204dcf5732b0.tar.gz |
print only highest priority value per config
-rw-r--r-- | lib/bundler/cli/config.rb | 4 | ||||
-rw-r--r-- | lib/bundler/settings.rb | 9 | ||||
-rw-r--r-- | spec/commands/config_spec.rb | 11 |
3 files changed, 7 insertions, 17 deletions
diff --git a/lib/bundler/cli/config.rb b/lib/bundler/cli/config.rb index 60183727ce..70eeac4015 100644 --- a/lib/bundler/cli/config.rb +++ b/lib/bundler/cli/config.rb @@ -49,8 +49,8 @@ module Bundler if @options[:parseable] thor.with_padding do Bundler.settings.all.each do |setting| - config = Bundler.settings.minimal_values_for(setting) - Bundler.ui.info "#{setting}: #{config}" + val = Bundler.settings[setting] + Bundler.ui.info "#{setting}=#{val}" end end else diff --git a/lib/bundler/settings.rb b/lib/bundler/settings.rb index c4edbee80d..7339f721ad 100644 --- a/lib/bundler/settings.rb +++ b/lib/bundler/settings.rb @@ -155,15 +155,6 @@ module Bundler locations end - def minimal_values_for(exposed_key) - key = key_for(exposed_key) - line = String.new - - line << "local=#{@local_config[key]}" - line << " global=#{@global_config[key]}" - line << " env=#{ENV[key]}" - end - def pretty_values_for(exposed_key) key = key_for(exposed_key) diff --git a/spec/commands/config_spec.rb b/spec/commands/config_spec.rb index 0ecf25d49e..4ce323c3a9 100644 --- a/spec/commands/config_spec.rb +++ b/spec/commands/config_spec.rb @@ -23,22 +23,21 @@ RSpec.describe ".bundle/config" do context "given --parseable flag" do it "prints a minimal report of local and user configuration" do bundle "config --parseable" - expect(out).to include("foo: local= global=bar env=") + expect(out).to include("foo=bar") end context "with global config" do it "prints config assigned to local scope" do - bundle "config --local foo2 bar" + bundle "config --local foo bar2" bundle "config --parseable" - expect(out).to include("foo2: local=bar global= env=") + expect(out).to include("foo=bar2") end end context "with env overwrite" do it "prints config with env" do - bundle "config foo bar" - bundle "config --parseable", :env => { "BUNDLE_FOO" => "bar2" } - expect(out).to include("foo: local= global=bar env=bar2") + bundle "config --parseable", :env => { "BUNDLE_FOO" => "bar3" } + expect(out).to include("foo=bar3") end end end |