The Uri
handles rubygems source URIs.
Methods
- M
- N
- P
- R
- T
Attributes
[R] | parsed_uri | Add a protected reader for the cloned instance to access the original object’s parsed uri |
Class Public methods
new(source_uri) Link
parse(uri) Link
Parses uri, returning the original uri if it’s invalid
parse!(uri) Link
Parses uri, raising if it’s invalid
# File ruby/lib/rubygems/uri.rb, line 18 def self.parse!(uri) require_relative "vendor/uri/lib/uri" raise Gem::URI::InvalidURIError unless uri return uri unless uri.is_a?(String) # 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 Gem::URI.parse(uri) rescue Gem::URI::InvalidURIError Gem::URI.parse(Gem::URI::DEFAULT_PARSER.escape(uri)) end end
redact(uri) Link
Parses and redacts uri