summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-02-10 20:31:25 +0100
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2019-02-14 00:45:08 +0100
commitccb5eae03bb29f167dd165c7ad14b3254fc53912 (patch)
tree07bb1f15b4283335d68ef3f0a0a88eaef95d99a2
parenta802a5142a2638d71ff78a8510216942ea3b67a9 (diff)
downloadbundler-ccb5eae03bb29f167dd165c7ad14b3254fc53912.tar.gz
Print to correct stream when setup on a tty
-rw-r--r--lib/bundler/setup.rb7
-rw-r--r--spec/other/platform_spec.rb4
2 files changed, 6 insertions, 5 deletions
diff --git a/lib/bundler/setup.rb b/lib/bundler/setup.rb
index ac6a5bf861..52a5b8889a 100644
--- a/lib/bundler/setup.rb
+++ b/lib/bundler/setup.rb
@@ -6,13 +6,14 @@ if Bundler::SharedHelpers.in_bundle?
require "bundler"
if STDOUT.tty? || ENV["BUNDLER_FORCE_TTY"]
+ Bundler.ui = Bundler::UI::Shell.new
begin
Bundler.setup
rescue Bundler::BundlerError => e
- puts "\e[31m#{e.message}\e[0m"
- puts e.backtrace.join("\n") if ENV["DEBUG"]
+ Bundler.ui.warn "\e[31m#{e.message}\e[0m"
+ Bundler.ui.warn e.backtrace.join("\n") if ENV["DEBUG"]
if e.is_a?(Bundler::GemNotFound)
- puts "\e[33mRun `bundle install` to install missing gems.\e[0m"
+ Bundler.ui.warn "\e[33mRun `bundle install` to install missing gems.\e[0m"
end
exit e.status_code
end
diff --git a/spec/other/platform_spec.rb b/spec/other/platform_spec.rb
index ca74945563..1e571cd7e2 100644
--- a/spec/other/platform_spec.rb
+++ b/spec/other/platform_spec.rb
@@ -863,7 +863,7 @@ G
G
bundle "exec rackup"
- expect(out).to eq("0.9.1")
+ expect(out).to include("0.9.1")
end
it "activates the correct gem when ruby version matches any engine" do
@@ -876,7 +876,7 @@ G
G
bundle "exec rackup"
- expect(out).to eq("0.9.1")
+ expect(out).to include("0.9.1")
end
end