Construct an installer object for the gem file located at path
Factory method to create a Gem::Requirement
object. Input may be a Version, a String
, or nil. Intended to simplify client code.
If the input is “weird”, the default version requirement is returned.
Concatenates the new
requirements onto this requirement.
Factory method to create a Version
object. Input may be a Version
or a String
. Intended to simplify client code.
ver1 = Version.create('1.3.17') # -> (Version object) ver2 = Version.create(ver1) # -> (ver1) ver3 = Version.create(nil) # -> nil
Yields each source URI
in the list.
Checks that the specification contains all required fields, and does a very basic sanity check.
Raises InvalidSpecificationException if the spec does not pass the checks.
Normalize the URI
by adding “http://” if it is missing.
v
Public setter for the scheme component v
(with validation).
See also URI::Generic.check_scheme
.
require 'uri' uri = URI.parse("http://my.example.com") uri.scheme = "https" uri.to_s #=> "https://my.example.com"
v
Public setter for the path component v
(with validation).
See also URI::Generic.check_path
.
require 'uri' uri = URI.parse("http://my.example.com/pub/files") uri.path = "/faq/" uri.to_s #=> "http://my.example.com/faq/"
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
Returns true if URI
does not have a scheme (e.g. http:// or https://) specified.
Returns normalized URI
.
require 'uri' URI("HTTP://my.EXAMPLE.com").normalize #=> #<URI::HTTP http://my.example.com/>
Normalization here means:
scheme and host are converted to lowercase,
an empty path component is set to “/”.
Destructive version of normalize
.
Returns attributes.
Setter for attributes val
.
Iterates over the request headers
Sets the response’s status to the status
code
Iterates over each header in the response
Will this response body be returned using chunked transfer-encoding?
Enables chunked transfer encoding.