Merge pull request #5482 from hsbt/rubygems-3-3-bundler-2-3

Merge RubyGems 3.3.x and Bundler 2.3.x
This commit is contained in:
Hiroshi SHIBATA 2022-02-02 16:57:34 +09:00 committed by GitHub
parent 69463805f0
commit 6794f8cf92
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
115 changed files with 1701 additions and 889 deletions

View file

@ -36,18 +36,18 @@ class Gem::StubSpecification < Gem::BasicSpecification
parts = data[PREFIX.length..-1].split(" ".freeze, 4)
@name = parts[0].freeze
@version = if Gem::Version.correct?(parts[1])
Gem::Version.new(parts[1])
else
Gem::Version.new(0)
end
Gem::Version.new(parts[1])
else
Gem::Version.new(0)
end
@platform = Gem::Platform.new parts[2]
@extensions = extensions
@full_name = if platform == Gem::Platform::RUBY
"#{name}-#{version}"
else
"#{name}-#{version}-#{platform}"
end
"#{name}-#{version}"
else
"#{name}-#{version}-#{platform}"
end
path_list = parts.last
@require_paths = REQUIRE_PATH_LIST[path_list] || path_list.split("\0".freeze).map! do |x|
@ -110,16 +110,16 @@ class Gem::StubSpecification < Gem::BasicSpecification
begin
saved_lineno = $.
Gem.open_with_flock loaded_from, OPEN_MODE do |file|
Gem.open_file loaded_from, OPEN_MODE do |file|
begin
file.readline # discard encoding line
stubline = file.readline.chomp
if stubline.start_with?(PREFIX)
extensions = if /\A#{PREFIX}/ =~ file.readline.chomp
$'.split "\0"
else
StubLine::NO_EXTENSIONS
end
$'.split "\0"
else
StubLine::NO_EXTENSIONS
end
@data = StubLine.new stubline, extensions
end
@ -185,14 +185,11 @@ class Gem::StubSpecification < Gem::BasicSpecification
def to_spec
@spec ||= if @data
loaded = Gem.loaded_specs[name]
loaded if loaded && loaded.version == version
end
loaded = Gem.loaded_specs[name]
loaded if loaded && loaded.version == version
end
@spec ||= Gem::Specification.load(loaded_from)
@spec.ignored = @ignored if @spec
@spec
end
##