summaryrefslogtreecommitdiff
path: root/lib/bundler
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-11-18 12:48:10 +0100
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2019-11-18 13:01:12 +0100
commit320ac535f15169d19e1d393095eed586d6b1f8b5 (patch)
tree8586f54f208af2adc8bcc2eeb572f16e290fd2c2 /lib/bundler
parentf6045fcf93cd3076cdd3d5e15622927c87df2db5 (diff)
downloadbundler-320ac535f15169d19e1d393095eed586d6b1f8b5.tar.gz
Fix shelling out to rubygems being silent
Diffstat (limited to 'lib/bundler')
-rw-r--r--lib/bundler/cli/exec.rb15
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/bundler/cli/exec.rb b/lib/bundler/cli/exec.rb
index 0a1edbdbbd..2bace6e77d 100644
--- a/lib/bundler/cli/exec.rb
+++ b/lib/bundler/cli/exec.rb
@@ -25,12 +25,12 @@ module Bundler
SharedHelpers.set_bundle_environment
if bin_path = Bundler.which(cmd)
if !Bundler.settings[:disable_exec_load] && ruby_shebang?(bin_path)
- return kernel_load(bin_path, *args)
+ return with_verbose_rubygems { kernel_load(bin_path, *args) }
end
- kernel_exec(bin_path, *args)
+ with_verbose_rubygems { kernel_exec(bin_path, *args) }
else
# exec using the given command
- kernel_exec(cmd, *args)
+ with_verbose_rubygems { kernel_exec(cmd, *args) }
end
end
@@ -89,5 +89,14 @@ module Bundler
first_line = File.open(file, "rb") {|f| f.read(possibilities.map(&:size).max) }
possibilities.any? {|shebang| first_line.start_with?(shebang) }
end
+
+ def with_verbose_rubygems
+ old_ui = Gem::DefaultUserInteraction.ui
+ Gem::DefaultUserInteraction.ui = nil
+
+ yield
+ ensure
+ Gem::DefaultUserInteraction.ui = old_ui
+ end
end
end