diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2022-09-05 09:15:30 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2022-09-05 14:37:12 +0900 |
commit | 3eca1e438db6fabaa7cd5e5a7120da147ac0ec26 (patch) | |
tree | 597be042af7d0052616ba41bb9d0b8d8ceedd094 /lib/bundler/gem_version_promoter.rb | |
parent | 3767c6a90d8970f9b39e9ed116a7b9bbac3f9f26 (diff) |
Merge https://github.com/rubygems/rubygems/commit/16c3535413afebcdbab7582c6017c27b5da8a8dc
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/6326
Diffstat (limited to 'lib/bundler/gem_version_promoter.rb')
-rw-r--r-- | lib/bundler/gem_version_promoter.rb | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/lib/bundler/gem_version_promoter.rb b/lib/bundler/gem_version_promoter.rb index ddf7446dd2..1ae41e2928 100644 --- a/lib/bundler/gem_version_promoter.rb +++ b/lib/bundler/gem_version_promoter.rb @@ -55,19 +55,17 @@ module Bundler @level = v end - # Given a Dependency and an Array of SpecGroups of available versions for a - # gem, this method will return the Array of SpecGroups sorted (and possibly + # Given a Dependency and an Array of Specifications of available versions for a + # gem, this method will return the Array of Specifications sorted (and possibly # truncated if strict is true) in an order to give preference to the current # level (:major, :minor or :patch) when resolution is deciding what versions # best resolve all dependencies in the bundle. # @param dep [Dependency] The Dependency of the gem. - # @param spec_groups [SpecGroup] An array of SpecGroups for the same gem + # @param spec_groups [Specification] An array of Specifications for the same gem # named in the @dep param. - # @return [SpecGroup] A new instance of the SpecGroup Array sorted and + # @return [Specification] A new instance of the Specification Array sorted and # possibly filtered. def sort_versions(dep, spec_groups) - before_result = "before sort_versions: #{debug_format_result(dep, spec_groups).inspect}" if DEBUG - @sort_versions[dep] ||= begin gem_name = dep.name @@ -79,11 +77,6 @@ module Bundler filter_dep_specs(spec_groups, locked_spec) else sort_dep_specs(spec_groups, locked_spec) - end.tap do |specs| - if DEBUG - puts before_result - puts " after sort_versions: #{debug_format_result(dep, specs).inspect}" - end end end end @@ -183,12 +176,5 @@ module Bundler move, keep = result.partition {|s| s.version.to_s == version.to_s } keep.concat(move) end - - def debug_format_result(dep, spec_groups) - a = [dep.to_s, - spec_groups.map {|sg| [sg.version, sg.dependencies_for_activated_platforms.map {|dp| [dp.name, dp.requirement.to_s] }] }] - last_map = a.last.map {|sg_data| [sg_data.first.version, sg_data.last.map {|aa| aa.join(" ") }] } - [a.first, last_map, level, strict ? :strict : :not_strict] - end end end |