summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBundlerbot <bot@bundler.io>2019-02-24 19:15:16 +0000
committerBundlerbot <bot@bundler.io>2019-02-24 19:15:16 +0000
commitad9fee2cbd1d0edf029cf91824b38481fad06790 (patch)
tree7a5458fa47e542221e2025ff955897ea6f56443b
parentabed6e81f4ab13421672bafa580b9c22194c29cb (diff)
parent0c71faa0effe4d58c73e166b5fd0d632ba67b480 (diff)
downloadbundler-ad9fee2cbd1d0edf029cf91824b38481fad06790.tar.gz
Merge #6971
6971: Fix warning message about bundler version r=colby-swandale a=deivid-rodriguez Fixes #6909. ### What was the end-user problem that led to this PR? The problem was that we're recommending a command to make a warning go away that doesn't really make the warning go away. ### What was your diagnosis of the problem? My diagnosis was that the current recommendation installs the latest bundler, which might not be the same as the version the lock file was created with. If it's not the same, the warning will not go away. ### What is your fix for the problem, implemented in this PR? My fix is to recommend installing exactly the version the lockfile was created with. ### Why did you choose this fix out of the possible options? I chose this fix because it's really simple and it should work. Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
-rw-r--r--lib/bundler/lockfile_parser.rb6
-rw-r--r--spec/lock/lockfile_bundler_1_spec.rb4
-rw-r--r--spec/lock/lockfile_spec.rb4
3 files changed, 9 insertions, 5 deletions
diff --git a/lib/bundler/lockfile_parser.rb b/lib/bundler/lockfile_parser.rb
index a7d4dc56b7..cd42919da2 100644
--- a/lib/bundler/lockfile_parser.rb
+++ b/lib/bundler/lockfile_parser.rb
@@ -107,9 +107,9 @@ module Bundler
when 0
if current_version < bundler_version
Bundler.ui.warn "Warning: the running version of Bundler (#{current_version}) is older " \
- "than the version that created the lockfile (#{bundler_version}). We suggest you " \
- "upgrade to the latest version of Bundler by running `gem " \
- "install bundler#{prerelease_text}`.\n"
+ "than the version that created the lockfile (#{bundler_version}). We suggest you to " \
+ "upgrade to the version that created the lockfile by running `gem install " \
+ "bundler:#{bundler_version}#{prerelease_text}`.\n"
end
end
end
diff --git a/spec/lock/lockfile_bundler_1_spec.rb b/spec/lock/lockfile_bundler_1_spec.rb
index 36cdb6d557..d44b076cb7 100644
--- a/spec/lock/lockfile_bundler_1_spec.rb
+++ b/spec/lock/lockfile_bundler_1_spec.rb
@@ -180,7 +180,9 @@ RSpec.describe "the lockfile format", :bundler => "< 2" do
end
warning_message = "the running version of Bundler (9999999.0.0) is older " \
- "than the version that created the lockfile (9999999.1.0)"
+ "than the version that created the lockfile (9999999.1.0). " \
+ "We suggest you to upgrade to the version that created the " \
+ "lockfile by running `gem install bundler:9999999.1.0`."
expect(last_command.stderr.scan(warning_message).size).to eq(1)
lockfile_should_be <<-G
diff --git a/spec/lock/lockfile_spec.rb b/spec/lock/lockfile_spec.rb
index 28ea54dc45..0809258859 100644
--- a/spec/lock/lockfile_spec.rb
+++ b/spec/lock/lockfile_spec.rb
@@ -180,7 +180,9 @@ RSpec.describe "the lockfile format", :bundler => "2" do
end
warning_message = "the running version of Bundler (9999999.0.0) is older " \
- "than the version that created the lockfile (9999999.1.0)"
+ "than the version that created the lockfile (9999999.1.0). " \
+ "We suggest you to upgrade to the version that created the " \
+ "lockfile by running `gem install bundler:9999999.1.0`."
expect(last_command.bundler_err).to include warning_message
lockfile_should_be <<-G