summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-02-14 14:32:02 +0100
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2019-02-21 16:32:22 +0100
commit149f1ce04bde47d72a62569143be0484cf4bdbba (patch)
tree502f2082b22a4f1abf219e0b3f2414d9d84c9efe
parent2610e6c7fc68a7f7ae48f99fea4c082838944665 (diff)
downloadbundler-149f1ce04bde47d72a62569143be0484cf4bdbba.tar.gz
Reword deprecation messages
Including the version is confusing, in my opinion, because it's unclear whether it refers to the future version of removal, or to the current running version.
-rw-r--r--lib/bundler/shared_helpers.rb4
-rw-r--r--spec/commands/show_spec.rb8
-rw-r--r--spec/install/redownload_spec.rb12
-rw-r--r--spec/runtime/with_unbundled_env_spec.rb8
-rw-r--r--spec/support/matchers.rb2
-rw-r--r--spec/update/redownload_spec.rb12
6 files changed, 23 insertions, 23 deletions
diff --git a/lib/bundler/shared_helpers.rb b/lib/bundler/shared_helpers.rb
index 02b3801c44..e28f9e6f39 100644
--- a/lib/bundler/shared_helpers.rb
+++ b/lib/bundler/shared_helpers.rb
@@ -144,13 +144,13 @@ module Bundler
bundler_major_version = Bundler.bundler_major_version
if bundler_major_version > major_version
require "bundler/errors"
- raise DeprecatedError, "[REMOVED FROM #{major_version.succ}.0] #{message}"
+ raise DeprecatedError, "[REMOVED] #{message}"
end
return unless bundler_major_version >= major_version || prints_major_deprecations?
@major_deprecation_ui ||= Bundler::UI::Shell.new("no-color" => true)
ui = Bundler.ui.is_a?(@major_deprecation_ui.class) ? Bundler.ui : @major_deprecation_ui
- ui.warn("[DEPRECATED FOR #{major_version}.0] #{message}")
+ ui.warn("[DEPRECATED] #{message}")
end
def print_major_deprecations!
diff --git a/spec/commands/show_spec.rb b/spec/commands/show_spec.rb
index 08b106d0a0..6692fb0cfb 100644
--- a/spec/commands/show_spec.rb
+++ b/spec/commands/show_spec.rb
@@ -32,7 +32,7 @@ RSpec.describe "bundle show" do
it "prints deprecation", :bundler => "2" do
bundle "show rails"
- expect(err).to eq("[DEPRECATED FOR 2.0] use `bundle info rails` instead of `bundle show rails`")
+ expect(err).to eq("[DEPRECATED] use `bundle info rails` instead of `bundle show rails`")
end
it "prints path if gem exists in bundle (with --paths option)" do
@@ -42,7 +42,7 @@ RSpec.describe "bundle show" do
it "prints deprecation when called with a gem and the --paths option", :bundler => "2" do
bundle "show rails --paths"
- expect(err).to eq("[DEPRECATED FOR 2.0] use `bundle info rails --path` instead of `bundle show rails --paths`")
+ expect(err).to eq("[DEPRECATED] use `bundle info rails --path` instead of `bundle show rails --paths`")
end
it "warns if path no longer exists on disk" do
@@ -61,7 +61,7 @@ RSpec.describe "bundle show" do
it "prints deprecation when called with bundler", :bundler => "2" do
bundle "show bundler"
- expect(err).to eq("[DEPRECATED FOR 2.0] use `bundle info bundler` instead of `bundle show bundler`")
+ expect(err).to eq("[DEPRECATED] use `bundle info bundler` instead of `bundle show bundler`")
end
it "complains if gem not in bundle" do
bundle "show missing"
@@ -82,7 +82,7 @@ RSpec.describe "bundle show" do
it "prints a deprecation when called with the --paths option", :bundler => 2 do
bundle "show --paths"
- expect(err).to eq("[DEPRECATED FOR 2.0] use `bundle list` instead of `bundle show --paths`")
+ expect(err).to eq("[DEPRECATED] use `bundle list` instead of `bundle show --paths`")
end
it "prints summary of gems" do
diff --git a/spec/install/redownload_spec.rb b/spec/install/redownload_spec.rb
index 141a2e80d5..de726c4562 100644
--- a/spec/install/redownload_spec.rb
+++ b/spec/install/redownload_spec.rb
@@ -63,22 +63,22 @@ RSpec.describe "bundle install" do
it "shows a deprecation when single flag passed", :bundler => 2 do
bundle! "install --force"
- expect(err).to include "[DEPRECATED FOR 2.0] The `--force` option has been renamed to `--redownload`"
+ expect(err).to include "[DEPRECATED] The `--force` option has been renamed to `--redownload`"
end
it "shows a deprecation when multiple flags passed", :bundler => 2 do
bundle! "install --no-color --force"
- expect(err).to include "[DEPRECATED FOR 2.0] The `--force` option has been renamed to `--redownload`"
+ expect(err).to include "[DEPRECATED] The `--force` option has been renamed to `--redownload`"
end
it "does not show a deprecation when single flag passed", :bundler => "< 2" do
bundle! "install --force"
- expect(out).not_to include "[DEPRECATED FOR 2.0] The `--force` option has been renamed to `--redownload`"
+ expect(out).not_to include "[DEPRECATED] The `--force` option has been renamed to `--redownload`"
end
it "does not show a deprecation when multiple flags passed", :bundler => "< 2" do
bundle! "install --no-color --force"
- expect(out).not_to include "[DEPRECATED FOR 2.0] The `--force` option has been renamed to `--redownload`"
+ expect(out).not_to include "[DEPRECATED] The `--force` option has been renamed to `--redownload`"
end
end
@@ -89,12 +89,12 @@ RSpec.describe "bundle install" do
it "does not show a deprecation when single flag passed" do
bundle! "install --redownload"
- expect(err).not_to include "[DEPRECATED FOR 2.0] The `--force` option has been renamed to `--redownload`"
+ expect(err).not_to include "[DEPRECATED] The `--force` option has been renamed to `--redownload`"
end
it "does not show a deprecation when single multiple flags passed" do
bundle! "install --no-color --redownload"
- expect(err).not_to include "[DEPRECATED FOR 2.0] The `--force` option has been renamed to `--redownload`"
+ expect(err).not_to include "[DEPRECATED] The `--force` option has been renamed to `--redownload`"
end
end
end
diff --git a/spec/runtime/with_unbundled_env_spec.rb b/spec/runtime/with_unbundled_env_spec.rb
index 6de23494f3..605bed8254 100644
--- a/spec/runtime/with_unbundled_env_spec.rb
+++ b/spec/runtime/with_unbundled_env_spec.rb
@@ -107,7 +107,7 @@ RSpec.describe "Bundler.with_env helpers" do
code = "Bundler.clean_env"
bundle_exec_ruby! code.dump
expect(err).to include(
- "[DEPRECATED FOR 2.0] `Bundler.clean_env` has been deprecated in favor of `Bundler.unbundled_env`. " \
+ "[DEPRECATED] `Bundler.clean_env` has been deprecated in favor of `Bundler.unbundled_env`. " \
"If you instead want the environment before bundler was originally loaded, use `Bundler.original_env`"
)
end
@@ -116,7 +116,7 @@ RSpec.describe "Bundler.with_env helpers" do
code = "Bundler.clean_env"
bundle_exec_ruby! code.dump
expect(out).not_to include(
- "[DEPRECATED FOR 2.0] `Bundler.clean_env` has been deprecated in favor of `Bundler.unbundled_env`. " \
+ "[DEPRECATED] `Bundler.clean_env` has been deprecated in favor of `Bundler.unbundled_env`. " \
"If you instead want the environment before bundler was originally loaded, use `Bundler.original_env`"
)
end
@@ -157,7 +157,7 @@ RSpec.describe "Bundler.with_env helpers" do
code = "Bundler.with_clean_env {}"
bundle_exec_ruby! code.dump
expect(err).to include(
- "[DEPRECATED FOR 2.0] `Bundler.with_clean_env` has been deprecated in favor of `Bundler.with_unbundled_env`. " \
+ "[DEPRECATED] `Bundler.with_clean_env` has been deprecated in favor of `Bundler.with_unbundled_env`. " \
"If you instead want the environment before bundler was originally loaded, use `Bundler.with_original_env`"
)
end
@@ -166,7 +166,7 @@ RSpec.describe "Bundler.with_env helpers" do
code = "Bundler.with_clean_env {}"
bundle_exec_ruby! code.dump
expect(out).not_to include(
- "[DEPRECATED FOR 2.0] `Bundler.with_clean_env` has been deprecated in favor of `Bundler.with_unbundled_env`. " \
+ "[DEPRECATED] `Bundler.with_clean_env` has been deprecated in favor of `Bundler.with_unbundled_env`. " \
"If you instead want the environment before bundler was originally loaded, use `Bundler.with_original_env`"
)
end
diff --git a/spec/support/matchers.rb b/spec/support/matchers.rb
index 18ccf38fb1..c39f2881a6 100644
--- a/spec/support/matchers.rb
+++ b/spec/support/matchers.rb
@@ -60,7 +60,7 @@ module Spec
end
end
- MAJOR_DEPRECATION = /^\[DEPRECATED FOR 2\.0\]\s*/
+ MAJOR_DEPRECATION = /^\[DEPRECATED\]\s*/
RSpec::Matchers.define :eq_err do |expected|
diffable
diff --git a/spec/update/redownload_spec.rb b/spec/update/redownload_spec.rb
index 2c0ed3ad38..b70c009248 100644
--- a/spec/update/redownload_spec.rb
+++ b/spec/update/redownload_spec.rb
@@ -11,34 +11,34 @@ RSpec.describe "bundle update" do
describe "with --force" do
it "shows a deprecation when single flag passed", :bundler => 2 do
bundle! "update rack --force"
- expect(err).to include "[DEPRECATED FOR 2.0] The `--force` option has been renamed to `--redownload`"
+ expect(err).to include "[DEPRECATED] The `--force` option has been renamed to `--redownload`"
end
it "shows a deprecation when multiple flags passed", :bundler => 2 do
bundle! "update rack --no-color --force"
- expect(err).to include "[DEPRECATED FOR 2.0] The `--force` option has been renamed to `--redownload`"
+ expect(err).to include "[DEPRECATED] The `--force` option has been renamed to `--redownload`"
end
it "does not show a deprecation when single flag passed", :bundler => "< 2" do
bundle! "update rack --force"
- expect(out).not_to include "[DEPRECATED FOR 2.0] The `--force` option has been renamed to `--redownload`"
+ expect(out).not_to include "[DEPRECATED] The `--force` option has been renamed to `--redownload`"
end
it "does not show a deprecation when multiple flags passed", :bundler => "< 2" do
bundle! "update rack --no-color --force"
- expect(out).not_to include "[DEPRECATED FOR 2.0] The `--force` option has been renamed to `--redownload`"
+ expect(out).not_to include "[DEPRECATED] The `--force` option has been renamed to `--redownload`"
end
end
describe "with --redownload" do
it "does not show a deprecation when single flag passed" do
bundle! "update rack --redownload"
- expect(err).not_to include "[DEPRECATED FOR 2.0] The `--force` option has been renamed to `--redownload`"
+ expect(err).not_to include "[DEPRECATED] The `--force` option has been renamed to `--redownload`"
end
it "does not show a deprecation when single multiple flags passed" do
bundle! "update rack --no-color --redownload"
- expect(err).not_to include "[DEPRECATED FOR 2.0] The `--force` option has been renamed to `--redownload`"
+ expect(err).not_to include "[DEPRECATED] The `--force` option has been renamed to `--redownload`"
end
end
end