summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2024-12-17 16:28:08 +0100
committergit <svn-admin@ruby-lang.org>2024-12-17 17:28:18 +0000
commit0b2f034208a1131900257a7923a71bf4e3b56a3e (patch)
tree7f77f8f847d1b9cd6f39daca53676e4d24ce6b08
parent707c6420b1ea599c223a17781185c0b6fb0f3518 (diff)
[rubygems/rubygems] Fix missing `Gem::Uri.redact` on some Ruby 3.1 versions
Our CI did not catch this because it was testing with Ruby 3.1 patch levels that include a RubyGems version that already has `Gem::Uri.redact`. We should make sure the system-rubygems workflow always tests against the oldest supportted Ruby/RubyGems combination. https://github.com/rubygems/rubygems/commit/3b695e3be1
-rw-r--r--lib/bundler/rubygems_ext.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/bundler/rubygems_ext.rb b/lib/bundler/rubygems_ext.rb
index 6697653485..bc7f65c7f7 100644
--- a/lib/bundler/rubygems_ext.rb
+++ b/lib/bundler/rubygems_ext.rb
@@ -455,4 +455,15 @@ 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