diff options
author | Hiroshi SHIBATA <[email protected]> | 2021-07-13 20:58:08 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <[email protected]> | 2021-07-14 10:48:07 +0900 |
commit | 896bbb9fadd10e1ad06ff3fd7d0608acda01ac06 (patch) | |
tree | c6f97aa1b1ed5192dfdd9b84317b742020ec3cb0 /lib/bundler/spec_set.rb | |
parent | 29f6f79e7396018962eb25c5f5e409f5fe28a73b (diff) |
Merge RubyGems/Bundler master from 8459ebd6ad65ce3397233416dc64083ae7572bb9
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/4648
Diffstat (limited to 'lib/bundler/spec_set.rb')
-rw-r--r-- | lib/bundler/spec_set.rb | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/bundler/spec_set.rb b/lib/bundler/spec_set.rb index af16984454..1a8906c47e 100644 --- a/lib/bundler/spec_set.rb +++ b/lib/bundler/spec_set.rb @@ -11,15 +11,14 @@ module Bundler @specs = specs end - def for(dependencies, skip = [], check = false, match_current_platform = false, raise_on_missing = true) + def for(dependencies, check = false, match_current_platform = false, raise_on_missing = true) handled = [] deps = dependencies.dup specs = [] - skip += ["bundler"] loop do break unless dep = deps.shift - next if handled.include?(dep) || skip.include?(dep.name) + next if handled.any?{|d| d.name == dep.name && (match_current_platform || d.__platform == dep.__platform) } || dep.name == "bundler" handled << dep @@ -73,7 +72,7 @@ module Bundler end def materialize(deps, missing_specs = nil) - materialized = self.for(deps, [], false, true, !missing_specs) + materialized = self.for(deps, false, true, !missing_specs) materialized.group_by(&:source).each do |source, specs| next unless specs.any?{|s| s.is_a?(LazySpecification) } @@ -195,7 +194,7 @@ module Bundler def spec_for_dependency(dep, match_current_platform) specs_for_platforms = lookup[dep.name] if match_current_platform - GemHelpers.select_best_platform_match(specs_for_platforms, Bundler.local_platform) + GemHelpers.select_best_platform_match(specs_for_platforms.select{|s| Gem::Platform.match_spec?(s) }, Bundler.local_platform) else GemHelpers.select_best_platform_match(specs_for_platforms, dep.__platform) end |