Skip to content

Commit 0b2f034

Browse files
deivid-rodriguezmatzbot
authored andcommitted
[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. ruby/rubygems@3b695e3be1
1 parent 707c642 commit 0b2f034

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

lib/bundler/rubygems_ext.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,4 +455,15 @@ def full_name
455455

456456
Package::TarReader::Entry.prepend(FixFullNameEncoding)
457457
end
458+
459+
require "rubygems/uri"
460+
461+
# Can be removed once RubyGems 3.3.15 support is dropped
462+
unless Gem::Uri.respond_to?(:redact)
463+
class Uri
464+
def self.redact(uri)
465+
new(uri).redacted
466+
end
467+
end
468+
end
458469
end

0 commit comments

Comments
 (0)