From bdc3363d0f045b1a6d81b72c3cd9b10d5759f71e Mon Sep 17 00:00:00 2001 From: Samuel Giddins Date: Tue, 1 Oct 2024 18:20:19 -0700 Subject: [PATCH] [rubygems/rubygems] Update required_ruby_version to 3.1 3.0 has been EOL since march, drop support for it before the 3.4 release is cut Signed-off-by: Samuel Giddins https://github.com/rubygems/rubygems/commit/fc1f03b06a --- lib/bundler/bundler.gemspec | 4 ++-- lib/bundler/cli/gem.rb | 2 +- lib/bundler/definition.rb | 6 +----- lib/bundler/fetcher/compact_index.rb | 2 +- lib/rubygems/core_ext/kernel_warn.rb | 8 ++------ 5 files changed, 7 insertions(+), 15 deletions(-) diff --git a/lib/bundler/bundler.gemspec b/lib/bundler/bundler.gemspec index 2d6269fae1..88411f295d 100644 --- a/lib/bundler/bundler.gemspec +++ b/lib/bundler/bundler.gemspec @@ -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.0.0" + s.required_ruby_version = ">= 3.1.0" # It should match the RubyGems version shipped with `required_ruby_version` above - s.required_rubygems_version = ">= 3.2.3" + s.required_rubygems_version = ">= 3.3.3" s.files = Dir.glob("lib/bundler{.rb,/**/*}", File::FNM_DOTMATCH).reject {|f| File.directory?(f) } diff --git a/lib/bundler/cli/gem.rb b/lib/bundler/cli/gem.rb index fb0a184e5d..22bcf0e47a 100644 --- a/lib/bundler/cli/gem.rb +++ b/lib/bundler/cli/gem.rb @@ -446,7 +446,7 @@ module Bundler end def required_ruby_version - "3.0.0" + "3.1.0" end def rubocop_version diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb index e7e6c49e6c..36ca1ee9ad 100644 --- a/lib/bundler/definition.rb +++ b/lib/bundler/definition.rb @@ -266,11 +266,7 @@ module Bundler groups.map!(&:to_sym) deps = current_dependencies # always returns a new array deps.select! do |d| - if RUBY_VERSION >= "3.1" - d.groups.intersect?(groups) - else - !(d.groups & groups).empty? - end + d.groups.intersect?(groups) end deps end diff --git a/lib/bundler/fetcher/compact_index.rb b/lib/bundler/fetcher/compact_index.rb index 6e5656d26a..6c82d57011 100644 --- a/lib/bundler/fetcher/compact_index.rb +++ b/lib/bundler/fetcher/compact_index.rb @@ -10,7 +10,7 @@ module Bundler method = instance_method(method_name) undef_method(method_name) define_method(method_name) do |*args, &blk| - method.bind(self).call(*args, &blk) + method.bind_call(self, *args, &blk) rescue NetworkDownError, CompactIndexClient::Updater::MismatchedChecksumError => e raise HTTPError, e.message rescue AuthenticationRequiredError, BadAuthenticationError diff --git a/lib/rubygems/core_ext/kernel_warn.rb b/lib/rubygems/core_ext/kernel_warn.rb index 9dc9f2218c..f806b77fab 100644 --- a/lib/rubygems/core_ext/kernel_warn.rb +++ b/lib/rubygems/core_ext/kernel_warn.rb @@ -13,11 +13,7 @@ module Kernel module_function define_method(:warn) {|*messages, **kw| unless uplevel = kw[:uplevel] - if Gem.java_platform? && RUBY_VERSION < "3.1" - return original_warn.bind(self).call(*messages) - else - return original_warn.bind(self).call(*messages, **kw) - end + return original_warn.bind_call(self, *messages, **kw) end # Ensure `uplevel` fits a `long` @@ -44,6 +40,6 @@ module Kernel kw[:uplevel] = start end - original_warn.bind(self).call(*messages, **kw) + original_warn.bind_call(self, *messages, **kw) } end