summaryrefslogtreecommitdiff
path: root/lib/bundler/source
diff options
context:
space:
mode:
authorThe Bundler Bot <bot@bundler.io>2017-07-05 02:43:55 +0000
committerThe Bundler Bot <bot@bundler.io>2017-07-05 02:43:55 +0000
commit955c131ceb3c6238babea4a65e9e35c534dd7ebf (patch)
tree17a699a004bb4073070356e62692bbd34727abd3 /lib/bundler/source
parent6aa1f3b891a137f6eb97e139077f0da9604ea679 (diff)
parent762227012e61e45af9241019732cf8036305171d (diff)
downloadbundler-955c131ceb3c6238babea4a65e9e35c534dd7ebf.tar.gz
Auto merge of #5790 - bundler:seg-suppress-using-messages, r=indirect
[2.0] Suppress `Using …` messages during installation when a version has not changed ### What was the end-user problem that led to this PR? The problem was that `bundle install` output can get very verbose, even when Bundler is not doing anything. See https://github.com/bundler/bundler-features/issues/33. ### Was was your diagnosis of the problem? My diagnosis was that bundler was printing a bunch of `Using name (version)` messages, even when we were already using that gem at the same version. ### What is your fix for the problem, implemented in this PR? My fix is to introduce a feature flag (enabled by default on 2.0), that will only print those extra `Using` messages when `--verbose` is passed, and will continue to print them when there was an old version we can tell users about. Note that we still print a message when installing a gem for the first time. ### Why did you choose this fix out of the possible options? I chose this fix because it was essentially what had been done in https://github.com/bundler/bundler/pull/3872, and allows for easy feature-flagging.
Diffstat (limited to 'lib/bundler/source')
-rw-r--r--lib/bundler/source/git.rb2
-rw-r--r--lib/bundler/source/metadata.rb2
-rw-r--r--lib/bundler/source/path.rb2
-rw-r--r--lib/bundler/source/rubygems.rb2
4 files changed, 4 insertions, 4 deletions
diff --git a/lib/bundler/source/git.rb b/lib/bundler/source/git.rb
index c331af967e..d1e32946eb 100644
--- a/lib/bundler/source/git.rb
+++ b/lib/bundler/source/git.rb
@@ -169,7 +169,7 @@ module Bundler
def install(spec, options = {})
force = options[:force]
- Bundler.ui.info "Using #{version_message(spec)} from #{self}"
+ print_using_message "Using #{version_message(spec)} from #{self}"
if requires_checkout? && !@copied && !force
Bundler.ui.debug " * Checking out revision: #{ref}"
diff --git a/lib/bundler/source/metadata.rb b/lib/bundler/source/metadata.rb
index f6d2f0729d..1d62a1f76a 100644
--- a/lib/bundler/source/metadata.rb
+++ b/lib/bundler/source/metadata.rb
@@ -36,7 +36,7 @@ module Bundler
end
def install(spec, _opts = {})
- Bundler.ui.info "Using #{version_message(spec)}"
+ print_using_message "Using #{version_message(spec)}"
nil
end
diff --git a/lib/bundler/source/path.rb b/lib/bundler/source/path.rb
index 99808d2ef2..84a98420a9 100644
--- a/lib/bundler/source/path.rb
+++ b/lib/bundler/source/path.rb
@@ -76,7 +76,7 @@ module Bundler
end
def install(spec, options = {})
- Bundler.ui.info "Using #{version_message(spec)} from #{self}"
+ print_using_message "Using #{version_message(spec)} from #{self}"
generate_bin(spec, :disable_extensions => true)
nil # no post-install message
end
diff --git a/lib/bundler/source/rubygems.rb b/lib/bundler/source/rubygems.rb
index 70f7819f3a..e76a00361a 100644
--- a/lib/bundler/source/rubygems.rb
+++ b/lib/bundler/source/rubygems.rb
@@ -106,7 +106,7 @@ module Bundler
end
if installed?(spec) && !force
- Bundler.ui.info "Using #{version_message(spec)}"
+ print_using_message "Using #{version_message(spec)}"
return nil # no post-install message
end