1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[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.

241e093597
This commit is contained in:
Daniel Niknam 2021-08-23 23:01:17 +10:00 committed by Hiroshi SHIBATA
parent 589377fbdc
commit 6d883b33ae
Notes: git 2021-08-31 19:06:56 +09:00

View file

@ -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?