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:
parent
589377fbdc
commit
6d883b33ae
Notes:
git
2021-08-31 19:06:56 +09:00
1 changed files with 4 additions and 2 deletions
|
@ -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?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue