Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Commit

Permalink
Extract a couple of local variables
Browse files Browse the repository at this point in the history
  • Loading branch information
deivid-rodriguez committed Feb 27, 2019
1 parent 8786bbb commit 8c0d37a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/bundler/lockfile_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,10 @@ def warn_for_outdated_bundler_version
return unless bundler_version
prerelease_text = bundler_version.prerelease? ? " --pre" : ""
current_version = Gem::Version.create(Bundler::VERSION)
if current_version.segments.first < bundler_version.segments.first
raise LockfileError, "You must use Bundler #{bundler_version.segments.first} or greater with this lockfile."
current_major_version = current_version.segments.first
major_bundler_version = bundler_version.segments.first
if current_major_version < major_bundler_version
raise LockfileError, "You must use Bundler #{major_bundler_version} or greater with this lockfile."
end
return unless current_version < bundler_version
Bundler.ui.warn "Warning: the running version of Bundler (#{current_version}) is older " \
Expand Down

0 comments on commit 8c0d37a

Please sign in to comment.