[rubygems/rubygems] Bump required_ruby_version to 3.2
Ruby 3.1 was EOL March 2025 Signed-off-by: Samuel Giddins <segiddins@segiddins.me> https://github.com/rubygems/rubygems/commit/29c21b1e78
This commit is contained in:
parent
d565d809af
commit
c9ba3d0bac
@ -29,10 +29,10 @@ Gem::Specification.new do |s|
|
|||||||
"source_code_uri" => "https://github.com/rubygems/rubygems/tree/master/bundler",
|
"source_code_uri" => "https://github.com/rubygems/rubygems/tree/master/bundler",
|
||||||
}
|
}
|
||||||
|
|
||||||
s.required_ruby_version = ">= 3.1.0"
|
s.required_ruby_version = ">= 3.2.0"
|
||||||
|
|
||||||
# It should match the RubyGems version shipped with `required_ruby_version` above
|
# It should match the RubyGems version shipped with `required_ruby_version` above
|
||||||
s.required_rubygems_version = ">= 3.3.3"
|
s.required_rubygems_version = ">= 3.4.1"
|
||||||
|
|
||||||
s.files = Dir.glob("lib/bundler{.rb,/**/*}", File::FNM_DOTMATCH).reject {|f| File.directory?(f) }
|
s.files = Dir.glob("lib/bundler{.rb,/**/*}", File::FNM_DOTMATCH).reject {|f| File.directory?(f) }
|
||||||
|
|
||||||
|
@ -446,7 +446,7 @@ module Bundler
|
|||||||
end
|
end
|
||||||
|
|
||||||
def required_ruby_version
|
def required_ruby_version
|
||||||
"3.1.0"
|
"3.2.0"
|
||||||
end
|
end
|
||||||
|
|
||||||
def rubocop_version
|
def rubocop_version
|
||||||
@ -456,12 +456,5 @@ module Bundler
|
|||||||
def standard_version
|
def standard_version
|
||||||
"1.3"
|
"1.3"
|
||||||
end
|
end
|
||||||
|
|
||||||
def validate_rust_builder_rubygems_version
|
|
||||||
if Gem::Version.new(rust_builder_required_rubygems_version) > Gem.rubygems_version
|
|
||||||
Bundler.ui.error "Your RubyGems version (#{Gem.rubygems_version}) is too old to build Rust extension. Please update your RubyGems using `gem update --system` or any other way and try again."
|
|
||||||
exit 1
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -13,15 +13,6 @@ require "rubygems" unless defined?(Gem)
|
|||||||
# `Gem::Source` from the redefined `Gem::Specification#source`.
|
# `Gem::Source` from the redefined `Gem::Specification#source`.
|
||||||
require "rubygems/source"
|
require "rubygems/source"
|
||||||
|
|
||||||
# Cherry-pick fixes to `Gem.ruby_version` to be useful for modern Bundler
|
|
||||||
# versions and ignore patchlevels
|
|
||||||
# (https://github.com/rubygems/rubygems/pull/5472,
|
|
||||||
# https://github.com/rubygems/rubygems/pull/5486). May be removed once RubyGems
|
|
||||||
# 3.3.12 support is dropped.
|
|
||||||
unless Gem.ruby_version.to_s == RUBY_VERSION || RUBY_PATCHLEVEL == -1
|
|
||||||
Gem.instance_variable_set(:@ruby_version, Gem::Version.new(RUBY_VERSION))
|
|
||||||
end
|
|
||||||
|
|
||||||
module Gem
|
module Gem
|
||||||
# Can be removed once RubyGems 3.5.11 support is dropped
|
# Can be removed once RubyGems 3.5.11 support is dropped
|
||||||
unless Gem.respond_to?(:freebsd_platform?)
|
unless Gem.respond_to?(:freebsd_platform?)
|
||||||
@ -92,21 +83,10 @@ module Gem
|
|||||||
# version
|
# version
|
||||||
(
|
(
|
||||||
(@os != "linux" && (@version.nil? || other.version.nil?)) ||
|
(@os != "linux" && (@version.nil? || other.version.nil?)) ||
|
||||||
(@os == "linux" && (normalized_linux_version_ext == other.normalized_linux_version_ext || ["musl#{@version}", "musleabi#{@version}", "musleabihf#{@version}"].include?(other.version))) ||
|
(@os == "linux" && (normalized_linux_version == other.normalized_linux_version || ["musl#{@version}", "musleabi#{@version}", "musleabihf#{@version}"].include?(other.version))) ||
|
||||||
@version == other.version
|
@version == other.version
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
# This is a copy of RubyGems 3.3.23 or higher `normalized_linux_method`.
|
|
||||||
# Once only 3.3.23 is supported, we can use the method in RubyGems.
|
|
||||||
def normalized_linux_version_ext
|
|
||||||
return nil unless @version
|
|
||||||
|
|
||||||
without_gnu_nor_abi_modifiers = @version.sub(/\Agnu/, "").sub(/eabi(hf)?\Z/, "")
|
|
||||||
return nil if without_gnu_nor_abi_modifiers.empty?
|
|
||||||
|
|
||||||
without_gnu_nor_abi_modifiers
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -144,9 +124,6 @@ module Gem
|
|||||||
# Can be removed once RubyGems 3.5.14 support is dropped
|
# Can be removed once RubyGems 3.5.14 support is dropped
|
||||||
VALIDATES_FOR_RESOLUTION = Specification.new.respond_to?(:validate_for_resolution).freeze
|
VALIDATES_FOR_RESOLUTION = Specification.new.respond_to?(:validate_for_resolution).freeze
|
||||||
|
|
||||||
# Can be removed once RubyGems 3.3.15 support is dropped
|
|
||||||
FLATTENS_REQUIRED_PATHS = Specification.new.respond_to?(:flatten_require_paths).freeze
|
|
||||||
|
|
||||||
class Specification
|
class Specification
|
||||||
# Can be removed once RubyGems 3.5.15 support is dropped
|
# Can be removed once RubyGems 3.5.15 support is dropped
|
||||||
correct_array_attributes = @@default_value.select {|_k,v| v.is_a?(Array) }.keys
|
correct_array_attributes = @@default_value.select {|_k,v| v.is_a?(Array) }.keys
|
||||||
@ -272,27 +249,6 @@ module Gem
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
unless FLATTENS_REQUIRED_PATHS
|
|
||||||
def flatten_require_paths
|
|
||||||
return unless raw_require_paths.first.is_a?(Array)
|
|
||||||
|
|
||||||
warn "#{name} #{version} includes a gemspec with `require_paths` set to an array of arrays. Newer versions of this gem might've already fixed this"
|
|
||||||
raw_require_paths.flatten!
|
|
||||||
end
|
|
||||||
|
|
||||||
class << self
|
|
||||||
module RequirePathFlattener
|
|
||||||
def from_yaml(input)
|
|
||||||
spec = super(input)
|
|
||||||
spec.flatten_require_paths
|
|
||||||
spec
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
prepend RequirePathFlattener
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def dependencies_to_gemfile(dependencies, group = nil)
|
def dependencies_to_gemfile(dependencies, group = nil)
|
||||||
@ -471,15 +427,4 @@ module Gem
|
|||||||
|
|
||||||
Package::TarReader::Entry.prepend(FixFullNameEncoding)
|
Package::TarReader::Entry.prepend(FixFullNameEncoding)
|
||||||
end
|
end
|
||||||
|
|
||||||
require "rubygems/uri"
|
|
||||||
|
|
||||||
# Can be removed once RubyGems 3.3.15 support is dropped
|
|
||||||
unless Gem::Uri.respond_to?(:redact)
|
|
||||||
class Uri
|
|
||||||
def self.redact(uri)
|
|
||||||
new(uri).redacted
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
@ -8,6 +8,6 @@ Gem::Specification.new do |s|
|
|||||||
s.version = "1.0.0"
|
s.version = "1.0.0"
|
||||||
s.loaded_from = __FILE__
|
s.loaded_from = __FILE__
|
||||||
s.extensions = "ext/foo"
|
s.extensions = "ext/foo"
|
||||||
s.required_ruby_version = ">= 3.1.0"
|
s.required_ruby_version = ">= 3.2.0"
|
||||||
end
|
end
|
||||||
# rubocop:enable Style/FrozenStringLiteralComment
|
# rubocop:enable Style/FrozenStringLiteralComment
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
abort "RubyGems only supports Ruby 3.1 or higher" if RUBY_VERSION < "3.1.0"
|
abort "RubyGems only supports Ruby 3.2 or higher" if RUBY_VERSION < "3.2.0"
|
||||||
|
|
||||||
require_relative "path"
|
require_relative "path"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user