diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2020-12-08 16:36:29 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2020-12-08 17:30:02 +0900 |
commit | 473f9d2df0ddd7fdb5cc73fa3ad49b2f19f22b06 (patch) | |
tree | 6b39312502d32474da0157f5d55620fabd6454ea /lib/bundler/lazy_specification.rb | |
parent | 4aca77edde91f826aa243e268bf1ef5214530583 (diff) |
Merge prepare version of Bundler 2.2.0
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3864
Diffstat (limited to 'lib/bundler/lazy_specification.rb')
-rw-r--r-- | lib/bundler/lazy_specification.rb | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/bundler/lazy_specification.rb b/lib/bundler/lazy_specification.rb index 546b8d9b09..22bf0f3f6f 100644 --- a/lib/bundler/lazy_specification.rb +++ b/lib/bundler/lazy_specification.rb @@ -79,19 +79,17 @@ module Bundler @specification = if source.is_a?(Source::Gemspec) && source.gemspec.name == name source.gemspec.tap {|s| s.source = source } else - search_object = Bundler.feature_flag.specific_platform? || Bundler.settings[:force_ruby_platform] ? self : Dependency.new(name, version) + search_object = if source.is_a?(Source::Path) + Dependency.new(name, version) + else + self + end platform_object = Gem::Platform.new(platform) candidates = source.specs.search(search_object) same_platform_candidates = candidates.select do |spec| MatchPlatform.platforms_match?(spec.platform, platform_object) end search = same_platform_candidates.last || candidates.last - if search && Gem::Platform.new(search.platform) != platform_object && !search.runtime_dependencies.-(dependencies.reject {|d| d.type == :development }).empty? - Bundler.ui.warn "Unable to use the platform-specific (#{search.platform}) version of #{name} (#{version}) " \ - "because it has different dependencies from the #{platform} version. " \ - "To use the platform-specific version of the gem, run `bundle config set --local specific_platform true` and install again." - search = source.specs.search(self).last - end search.dependencies = dependencies if search && (search.is_a?(RemoteSpecification) || search.is_a?(EndpointSpecification)) search end |