From 6d883b33aef68c3ae9455a591c40a1ffb5836886 Mon Sep 17 00:00:00 2001 From: Daniel Niknam Date: Mon, 23 Aug 2021 23:01:17 +1000 Subject: [rubygems/rubygems] Remove `ruby/uri` requirement For the purpose of this class, we need to make sure the return object by `Gem::UriParser.parse_uri` method will have the following method: - user - user= - password - password= So we can remove the the `uri` dependency and just look for the methods to exist. https://github.com/rubygems/rubygems/commit/241e093597 --- lib/rubygems/printable_uri.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/rubygems/printable_uri.rb b/lib/rubygems/printable_uri.rb index 0837c42b50..ad88df0203 100644 --- a/lib/rubygems/printable_uri.rb +++ b/lib/rubygems/printable_uri.rb @@ -1,6 +1,5 @@ # frozen_string_literal: true -require 'uri' require_relative 'uri_parser' class Gem::PrintableUri @@ -22,7 +21,10 @@ class Gem::PrintableUri end def valid_uri? - @uri.is_a? URI::Generic + @uri.respond_to?(:user) && + @uri.respond_to?(:user=) && + @uri.respond_to?(:password) && + @uri.respond_to?(:password=) end def credential_redacted? -- cgit v1.2.3