End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Gem::Uri#parse!
parse!(uri)
lib/rubygems/uri.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.0.5/lib/rubygems/uri.rb, line 56
def parse!(uri)
require "uri"
raise URI::InvalidURIError unless uri
# Always escape URI's to deal with potential spaces and such
# It should also be considered that source_uri may already be
# a valid URI with escaped characters. e.g. "{DESede}" is encoded
# as "%7BDESede%7D". If this is escaped again the percentage
# symbols will be escaped.
begin
URI.parse(uri)
rescue URI::InvalidURIError
URI.parse(URI::DEFAULT_PARSER.escape(uri))
end
end
Parses the uri, raising if it’s invalid
See also
#parse
#password?
#oauth_basic?
#redact_credentials_from
also in
4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.1