summaryrefslogtreecommitdiff
path: root/lib/bundler
diff options
context:
space:
mode:
authorMichael Siegfried <michaeldsiegfried@gmail.com>2022-11-16 16:19:43 -0800
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2022-12-20 13:15:02 +0900
commit1ee31f9d9dc8da4b0eb8ca39b79a6b270c6c2f2d (patch)
treee43e06b0f87b03a7966f287fba4d2d367b57d385 /lib/bundler
parente58d18bf23a4dff7f17c76e6a3c762896cc2d807 (diff)
[rubygems/rubygems] Clarify segment equality check
https://github.com/rubygems/rubygems/commit/6624474c5a
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/6966
Diffstat (limited to 'lib/bundler')
-rw-r--r--lib/bundler/gem_version_promoter.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/bundler/gem_version_promoter.rb b/lib/bundler/gem_version_promoter.rb
index 061764cbf4..f73f79e84d 100644
--- a/lib/bundler/gem_version_promoter.rb
+++ b/lib/bundler/gem_version_promoter.rb
@@ -74,12 +74,11 @@ module Bundler
specs.select do |spec|
gsv = spec.version
- lsv = locked_version
must_match = minor? ? [0] : [0, 1]
- matches = must_match.map {|idx| gsv.segments[idx] == lsv.segments[idx] }
- matches.uniq == [true] ? (gsv >= lsv) : false
+ all_match = must_match.all? {|idx| gsv.segments[idx] == locked_version.segments[idx] }
+ all_match && gsv >= locked_version
end
end