summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-02-11 17:45:25 +0100
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2019-04-27 12:37:36 +0200
commitcd693cc4c0e8d95eac1f69db5b8709eb98f21071 (patch)
tree90f0605a35030fa313fe048cb3c5c3129082e8a3
parent29d856f40b6b5cdbac7ef060dd0a0137e35ba0ac (diff)
downloadbundler-cd693cc4c0e8d95eac1f69db5b8709eb98f21071.tar.gz
Remove case so it's easier to understand
-rw-r--r--lib/bundler/lockfile_parser.rb15
1 files changed, 6 insertions, 9 deletions
diff --git a/lib/bundler/lockfile_parser.rb b/lib/bundler/lockfile_parser.rb
index 50dc1381fe..8706b881c1 100644
--- a/lib/bundler/lockfile_parser.rb
+++ b/lib/bundler/lockfile_parser.rb
@@ -101,17 +101,14 @@ module Bundler
return unless bundler_version
prerelease_text = bundler_version.prerelease? ? " --pre" : ""
current_version = Gem::Version.create(Bundler::VERSION)
- case current_version.segments.first <=> bundler_version.segments.first
- when -1
+ if current_version.segments.first < bundler_version.segments.first
raise LockfileError, "You must use Bundler #{bundler_version.segments.first} or greater with this lockfile."
- 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 to " \
- "upgrade to the version that created the lockfile by running `gem install " \
- "bundler:#{bundler_version}#{prerelease_text}`.\n"
- end
end
+ return unless 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 to " \
+ "upgrade to the version that created the lockfile by running `gem install " \
+ "bundler:#{bundler_version}#{prerelease_text}`.\n"
end
private