summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrey Baker <greysteil@gmail.com>2018-10-09 10:00:31 +0100
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2019-04-12 10:44:52 +0200
commitbb0e13d6070a3082b7ef59cd8c7284f988335e91 (patch)
treee1438467671791b6dfa05e733be66f20691c3c8e
parentabc29c377f24554f7d3101cd5fd081cb1ec33a11 (diff)
downloadbundler-bb0e13d6070a3082b7ef59cd8c7284f988335e91.tar.gz
Print errors to stderr by default, and remove configuration option
-rw-r--r--lib/bundler/feature_flag.rb1
-rw-r--r--lib/bundler/settings.rb1
-rw-r--r--lib/bundler/ui/shell.rb6
-rw-r--r--man/bundle-config.ronn2
-rw-r--r--spec/bundler/cli_spec.rb4
-rw-r--r--spec/bundler/ui/shell_spec.rb24
-rw-r--r--spec/support/command_execution.rb6
-rw-r--r--spec/support/helpers.rb2
8 files changed, 11 insertions, 35 deletions
diff --git a/lib/bundler/feature_flag.rb b/lib/bundler/feature_flag.rb
index 982f0fa540..07106abad7 100644
--- a/lib/bundler/feature_flag.rb
+++ b/lib/bundler/feature_flag.rb
@@ -36,7 +36,6 @@ module Bundler
settings_flag(:default_install_uses_path) { bundler_3_mode? }
settings_flag(:deployment_means_frozen) { bundler_3_mode? }
settings_flag(:disable_multisource) { bundler_3_mode? }
- settings_flag(:error_on_stderr) { bundler_2_mode? }
settings_flag(:forget_cli_options) { bundler_3_mode? }
settings_flag(:global_path_appends_ruby_scope) { bundler_3_mode? }
settings_flag(:global_gem_cache) { bundler_3_mode? }
diff --git a/lib/bundler/settings.rb b/lib/bundler/settings.rb
index 5bc190865f..d21789dba1 100644
--- a/lib/bundler/settings.rb
+++ b/lib/bundler/settings.rb
@@ -28,7 +28,6 @@ module Bundler
disable_platform_warnings
disable_shared_gems
disable_version_check
- error_on_stderr
force_ruby_platform
forget_cli_options
frozen
diff --git a/lib/bundler/ui/shell.rb b/lib/bundler/ui/shell.rb
index 16e3d15713..7136fdfbf9 100644
--- a/lib/bundler/ui/shell.rb
+++ b/lib/bundler/ui/shell.rb
@@ -35,14 +35,12 @@ module Bundler
return if @warning_history.include? msg
@warning_history << msg
- return tell_err(msg, :yellow, newline) if Bundler.feature_flag.error_on_stderr?
- tell_me(msg, :yellow, newline)
+ tell_err(msg, :yellow, newline)
end
def error(msg, newline = nil)
return unless level("error")
- return tell_err(msg, :red, newline) if Bundler.feature_flag.error_on_stderr?
- tell_me(msg, :red, newline)
+ tell_err(msg, :red, newline)
end
def debug(msg, newline = nil)
diff --git a/man/bundle-config.ronn b/man/bundle-config.ronn
index 86c4e21819..9242a59f95 100644
--- a/man/bundle-config.ronn
+++ b/man/bundle-config.ronn
@@ -183,8 +183,6 @@ learn more about their operation in [bundle install(1)](bundle-install.1.html).
* `disable_version_check` (`BUNDLE_DISABLE_VERSION_CHECK`):
Stop Bundler from checking if a newer Bundler version is available on
rubygems.org.
-* `error_on_stderr` (`BUNDLE_ERROR_ON_STDERR`):
- Print Bundler errors to stderr.
* `force_ruby_platform` (`BUNDLE_FORCE_RUBY_PLATFORM`):
Ignore the current machine's platform and install only `ruby` platform gems.
As a result, gems with native extensions will be compiled from source.
diff --git a/spec/bundler/cli_spec.rb b/spec/bundler/cli_spec.rb
index 6a505358d1..649e304de2 100644
--- a/spec/bundler/cli_spec.rb
+++ b/spec/bundler/cli_spec.rb
@@ -125,7 +125,7 @@ RSpec.describe "bundle executable" do
let(:latest_version) { "222.0" }
it "prints the version warning" do
bundle "fail"
- expect(last_command.stdout).to start_with(<<-EOS.strip)
+ expect(last_command.stderr).to start_with(<<-EOS.strip)
The latest bundler is #{latest_version}, but you are currently running #{bundler_version}.
To install the latest version, run `gem install bundler`
EOS
@@ -150,7 +150,7 @@ To install the latest version, run `gem install bundler`
let(:latest_version) { "222.0.0.pre.4" }
it "prints the version warning" do
bundle "fail"
- expect(last_command.stdout).to start_with(<<-EOS.strip)
+ expect(last_command.stderr).to start_with(<<-EOS.strip)
The latest bundler is #{latest_version}, but you are currently running #{bundler_version}.
To install the latest version, run `gem install bundler --pre`
EOS
diff --git a/spec/bundler/ui/shell_spec.rb b/spec/bundler/ui/shell_spec.rb
index 23a7670dd1..632477096e 100644
--- a/spec/bundler/ui/shell_spec.rb
+++ b/spec/bundler/ui/shell_spec.rb
@@ -24,13 +24,6 @@ RSpec.describe Bundler::UI::Shell do
it "prints to stderr" do
expect { subject.warn("warning") }.to output("warning\n").to_stderr
end
-
- context "when stderr flag is enabled" do
- before { Bundler.settings.temporary(:error_on_stderr => true) }
- it "prints to stderr" do
- expect { subject.warn("warning!") }.to output("warning!\n").to_stderr
- end
- end
end
describe "#debug" do
@@ -46,19 +39,12 @@ RSpec.describe Bundler::UI::Shell do
expect { subject.error("error!!!") }.to output("error!!!\n").to_stderr
end
- context "when stderr flag is enabled" do
- before { Bundler.settings.temporary(:error_on_stderr => true) }
- it "prints to stderr" do
- expect { subject.error("error!!!") }.to output("error!!!\n").to_stderr
- end
-
- context "when stderr is closed" do
- it "doesn't report anything" do
- output = capture(:stderr, :closed => true) do
- subject.error("Something went wrong")
- end
- expect(output).to_not eq("Something went wrong\n")
+ context "when stderr is closed" do
+ it "doesn't report anything" do
+ output = capture(:stderr, :closed => true) do
+ subject.error("Something went wrong")
end
+ expect(output).to_not eq("Something went wrong\n")
end
end
end
diff --git a/spec/support/command_execution.rb b/spec/support/command_execution.rb
index 556285ac52..f3dd627ed2 100644
--- a/spec/support/command_execution.rb
+++ b/spec/support/command_execution.rb
@@ -28,11 +28,7 @@ module Spec
end
def bundler_err
- if Bundler::VERSION.start_with?("1.")
- stdout
- else
- stderr
- end
+ stderr
end
def to_s_verbose
diff --git a/spec/support/helpers.rb b/spec/support/helpers.rb
index 6470b57fb8..53459669e6 100644
--- a/spec/support/helpers.rb
+++ b/spec/support/helpers.rb
@@ -45,7 +45,7 @@ module Spec
end
def err
- Bundler.feature_flag.error_on_stderr? ? last_command.stderr : last_command.stdout
+ last_command.stderr
end
MAJOR_DEPRECATION = /^\[DEPRECATED\]\s*/.freeze