summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Niknam <mhmd.niknam@gmail.com>2021-08-23 23:01:17 +1000
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2021-08-31 19:06:14 +0900
commit6d883b33aef68c3ae9455a591c40a1ffb5836886 (patch)
tree8f64da2fde5f554def7bdfdd375800f6324b4811 /lib
parent589377fbdce9d281041535e3bf63f008689bb776 (diff)
[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
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4789
Diffstat (limited to 'lib')
-rw-r--r--lib/rubygems/printable_uri.rb6
1 files changed, 4 insertions, 2 deletions
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?