Skip to content

Commit

Permalink
[rubygems/rubygems] Fix missing Gem::Uri.redact on some Ruby 3.1 ve…
Browse files Browse the repository at this point in the history
…rsions

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.

rubygems/rubygems@3b695e3be1
  • Loading branch information
deivid-rodriguez authored and matzbot committed Dec 17, 2024
1 parent 707c642 commit 0b2f034
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/bundler/rubygems_ext.rb
Original file line number Diff line number Diff line change
Expand Up @@ -455,4 +455,15 @@ def full_name

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

0 comments on commit 0b2f034

Please sign in to comment.