[rubygems/rubygems] Restore using old way of passing Ruby version to resolver

We used `Bundler::RubyVersion.system.gem_version` for a long time, but I
changed this to `Gem.ruby_version` at
https://github.com/rubygems/rubygems/commit/94f96439438e. It's unclear why I did that
though since I believe it was unrelated to the fix in there.

Bootboot patches `Bundler::RubyVersion` to customize how Bundler works
with Ruby versions, and that change broke that.

Since it's unclear to me how to achieve what Bootboot is doing with the
current code, and there was no strong reason for the change, let's
restore it for now.

https://github.com/rubygems/rubygems/commit/8ec36c6017
This commit is contained in:
David Rodríguez 2023-10-16 10:36:37 +02:00 committed by Hiroshi SHIBATA
parent 6dcd4e90d8
commit e7d845b1d0
No known key found for this signature in database
GPG Key ID: F9CF13417264FAC2
2 changed files with 2 additions and 2 deletions

View File

@ -885,7 +885,7 @@ module Bundler
def metadata_dependencies
@metadata_dependencies ||= [
Dependency.new("Ruby\0", Gem.ruby_version),
Dependency.new("Ruby\0", Bundler::RubyVersion.system.gem_version),
Dependency.new("RubyGems\0", Gem::VERSION),
]
end

View File

@ -5,7 +5,7 @@ module Bundler
class Metadata < Source
def specs
@specs ||= Index.build do |idx|
idx << Gem::Specification.new("Ruby\0", Gem.ruby_version)
idx << Gem::Specification.new("Ruby\0", Bundler::RubyVersion.system.gem_version)
idx << Gem::Specification.new("RubyGems\0", Gem::VERSION) do |s|
s.required_rubygems_version = Gem::Requirement.default
end