summaryrefslogtreecommitdiff
path: root/lib/bundler/spec_set.rb
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2022-12-22 08:20:23 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2022-12-24 16:57:07 +0900
commitf6620037ba1477d2c337d7b511f094d6d0fbb69c (patch)
tree4d8d38eaf97e6ca88162dd574e7871e1739f22ae /lib/bundler/spec_set.rb
parentd5635dfe36588b04d3dd6065ab4e422f51629b11 (diff)
Merge RubyGems-3.4.0 and Bundler-2.4.0
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/6987
Diffstat (limited to 'lib/bundler/spec_set.rb')
-rw-r--r--lib/bundler/spec_set.rb10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/bundler/spec_set.rb b/lib/bundler/spec_set.rb
index a3d9218593..7478bd9ca2 100644
--- a/lib/bundler/spec_set.rb
+++ b/lib/bundler/spec_set.rb
@@ -190,12 +190,10 @@ module Bundler
def specs_for_dependency(dep, platform)
specs_for_name = lookup[dep.name]
- if platform.nil?
- matching_specs = specs_for_name.map {|s| s.materialize_for_installation if Gem::Platform.match_spec?(s) }.compact
- GemHelpers.sort_best_platform_match(matching_specs, Bundler.local_platform)
- else
- GemHelpers.select_best_platform_match(specs_for_name, dep.force_ruby_platform ? Gem::Platform::RUBY : platform)
- end
+ target_platform = dep.force_ruby_platform ? Gem::Platform::RUBY : (platform || Bundler.local_platform)
+ matching_specs = GemHelpers.select_best_platform_match(specs_for_name, target_platform)
+ matching_specs.map!(&:materialize_for_installation).compact! if platform.nil?
+ matching_specs
end
def tsort_each_child(s)