Cached RemoteFetcher
instance.
Moves the gem spec
from source_uri
to the cache dir unless it is already there. If the source_uri is local the gem cache dir copy is always replaced.
Declare that a gem of name name
with reqs
requirements is needed.
A requirement is a prerelease if any of the versions inside of it are prereleases
A string representation of this Version
.
A version is considered a prerelease if it contains a letter.
Downloads spec
and writes it to dir
. See also Gem::RemoteFetcher#download
.
Default fetcher instance. Use this instead of ::new
to reduce object allocation.
Display an informational alert. Will ask question
if it is not nil.
Returns the parser to be used.
Unless a URI::Parser
is defined, DEFAULT_PARSER is used.
Sets userinfo, argument is string like ‘name:pass’.
v
Public setter for the user
component (with validation).
See also URI::Generic.check_user
.
require 'uri' uri = URI.parse("http://john:S3nsit1ve@my.example.com") uri.user = "sam" uri.to_s #=> "http://sam:V3ry_S3nsit1ve@my.example.com"
Returns the userinfo, either as ‘user’ or ‘user:password’.
Returns the user component.
v
Public setter for the query component v
.
require 'uri' uri = URI.parse("http://my.example.com/?id=25") uri.query = "id=1" uri.to_s #=> "http://my.example.com/?id=1"
Returns true if URI
is hierarchical.
URI
has components listed in order of decreasing significance from left to right, see RFC3986 tools.ietf.org/html/rfc3986 1.2.3.
require 'uri' uri = URI.parse("http://my.example.com/") uri.hierarchical? #=> true uri = URI.parse("mailto:joe@example.com") uri.hierarchical? #=> false
Attempts to parse other URI
oth
, returns [parsed_oth, self].
require 'uri' uri = URI.parse("http://my.example.com") uri.coerce("http://foo.com") #=> [#<URI::HTTP http://foo.com>, #<URI::HTTP http://my.example.com>]
Returns filter.
Setter for filter val
.