1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Merge RubyGems 3.2.3 and Bundler 2.2.3

This commit is contained in:
Hiroshi SHIBATA 2020-12-23 08:45:19 +09:00
parent 733ed1e184
commit 339227363c
Notes: git 2020-12-23 10:18:06 +09:00
38 changed files with 671 additions and 296 deletions

View file

@ -4,7 +4,7 @@ require_relative "match_platform"
module Bundler
class LazySpecification
Identifier = Struct.new(:name, :version, :source, :platform, :dependencies)
Identifier = Struct.new(:name, :version, :platform)
class Identifier
include Comparable
def <=>(other)
@ -108,7 +108,7 @@ module Bundler
end
def identifier
@__identifier ||= Identifier.new(name, version, source, platform, dependencies)
@__identifier ||= Identifier.new(name, version, platform)
end
def git_version
@ -131,17 +131,16 @@ module Bundler
end
#
# Bundler 2.2.0 was the first version that records the full resolution
# including platform specific gems in the lockfile, which means that if a
# gem with RUBY platform is recorded, the RUBY platform version of the gem
# should be installed. Previously bundler would record only generic versions
# in the lockfile and then install the most specific platform variant if
# available.
# For backwards compatibility with existing lockfiles, if the most specific
# locked platform is RUBY, we keep the previous behaviour of resolving the
# best platform variant at materiliazation time. For previous bundler
# versions (before 2.2.0) this was always the case (except when the lockfile
# only included non-ruby platforms), but we're also keeping this behaviour
# on newer bundlers unless users generate the lockfile from scratch or
# explicitly add a more specific platform.
#
def ruby_platform_materializes_to_ruby_platform?
locked_bundler_version = Bundler.locked_bundler_version
locked_bundler_version.nil? || Gem::Version.new(locked_bundler_version) >= Gem::Version.new("2.2.0")
!Bundler.most_specific_locked_platform?(Gem::Platform::RUBY)
end
end
end