[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:
Samuel Giddins 2025-04-14 16:39:52 +09:00 committed by Hiroshi SHIBATA
parent d565d809af
commit c9ba3d0bac
No known key found for this signature in database
GPG Key ID: F9CF13417264FAC2
5 changed files with 6 additions and 68 deletions

View File

@ -29,10 +29,10 @@ Gem::Specification.new do |s|
"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
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) }

View File

@ -446,7 +446,7 @@ module Bundler
end
def required_ruby_version
"3.1.0"
"3.2.0"
end
def rubocop_version
@ -456,12 +456,5 @@ module Bundler
def standard_version
"1.3"
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

View File

@ -13,15 +13,6 @@ require "rubygems" unless defined?(Gem)
# `Gem::Source` from the redefined `Gem::Specification#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
# Can be removed once RubyGems 3.5.11 support is dropped
unless Gem.respond_to?(:freebsd_platform?)
@ -92,21 +83,10 @@ module Gem
# version
(
(@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
)
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
@ -144,9 +124,6 @@ module Gem
# Can be removed once RubyGems 3.5.14 support is dropped
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
# Can be removed once RubyGems 3.5.15 support is dropped
correct_array_attributes = @@default_value.select {|_k,v| v.is_a?(Array) }.keys
@ -272,27 +249,6 @@ module Gem
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
def dependencies_to_gemfile(dependencies, group = nil)
@ -471,15 +427,4 @@ module Gem
Package::TarReader::Entry.prepend(FixFullNameEncoding)
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

View File

@ -8,6 +8,6 @@ Gem::Specification.new do |s|
s.version = "1.0.0"
s.loaded_from = __FILE__
s.extensions = "ext/foo"
s.required_ruby_version = ">= 3.1.0"
s.required_ruby_version = ">= 3.2.0"
end
# rubocop:enable Style/FrozenStringLiteralComment

View File

@ -1,6 +1,6 @@
# 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"