Initialize a remote fetcher using the source URI
and possible proxy information.
proxy
[String]: explicit specification of proxy; overrides any environment
variable setting
nil: respect environment variables (HTTP_PROXY, HTTP_PROXY_USER,
HTTP_PROXY_PASS)
:no_proxy
: ignore environment variables and _don’t_ use a proxy
headers
: A set of additional HTTP headers to be sent to the server when
fetching the gem.
Creates a RequestSet
for a list of Gem::Dependency
objects, deps
. You can then resolve
and install
the resolved list of dependencies.
nokogiri = Gem::Dependency.new 'nokogiri', '~> 1.6' pg = Gem::Dependency.new 'pg', '~> 0.14' set = Gem::RequestSet.new nokogiri, pg
Constructs a requirement from requirements
. Requirements can be Strings, Gem::Versions, or Arrays of those. nil
and duplicate requirements are ignored. An empty set of requirements
is the same as ">= 0"
.
Constructs a Version
from the version
string. A version string is a series of digits or ASCII letters separated by dots.
Create Resolver
object which will resolve the tree starting with needed
Dependency objects.
set
is an object that provides where to look for specifications to satisfy the Dependencies. This defaults to IndexSet
, which will query rubygems.org.
Creates a new Source
which will use the index located at uri
.
Creates a new SourceList
Creates a new SpecFetcher
. Ordinarily you want to use the default fetcher from Gem::SpecFetcher::fetcher
which uses the Gem.sources
.
If you need to retrieve specifications from a different source
, you can send it as an argument.
Specification
constructor. Assigns the default values to the attributes and yields itself for further initialization. Optionally takes name
and version
.
Constructs an uninstaller that will uninstall gem
Creates a new URI
formatter for uri
.
Creates a new StreamUI
wrapping in_stream
for user input, out_stream
for standard output, err_stream
for error output. If usetty
is true then special operations (like asking for passwords) will use the TTY commands to disable character echo.
The Console UI has no arguments as it defaults to reading input from stdin, output to stdout and warnings or errors to stderr.
The SilentUI
has no arguments as it does not use any stream.
scheme
Protocol scheme, i.e. ‘http’,‘ftp’,‘mailto’ and so on.
userinfo
User name and password, i.e. ‘sdmitry:bla’.
host
Server host name.
port
Server port.
registry
Registry of naming authorities.
path
Path on server.
opaque
Opaque part.
query
Query data.
fragment
Part of the URI
after ‘#’ character.
parser
Parser
for internal use [URI::DEFAULT_PARSER by default].
arg_check
Check arguments [false by default].
Creates a new URI::Generic
instance from “generic” components without check.
Creates a new URI::LDAP
object from generic URI
components as per RFC 2396. No LDAP-specific syntax checking is performed.
Arguments are scheme
, userinfo
, host
, port
, registry
, path
, opaque
, query
, and fragment
, in that order.
Example:
uri = URI::LDAP.new("ldap", nil, "ldap.example.com", nil, nil, "/dc=example;dc=com", nil, "query", nil)
See also URI::Generic.new
.
Creates a new URI::MailTo
object from generic URL components with no syntax checking.
This method is usually called from URI::parse
, which checks the validity of each component.
URI::Parser.new([opts])
The constructor accepts a hash as options for parser. Keys of options are pattern names of URI
components and values of options are pattern strings. The constructor generates set of regexps for parsing URIs.
You can use the following keys:
* :ESCAPED (URI::PATTERN::ESCAPED in default) * :UNRESERVED (URI::PATTERN::UNRESERVED in default) * :DOMLABEL (URI::PATTERN::DOMLABEL in default) * :TOPLABEL (URI::PATTERN::TOPLABEL in default) * :HOSTNAME (URI::PATTERN::HOSTNAME in default)
p = URI::Parser.new(:ESCAPED => "(?:%[a-fA-F0-9]{2}|%u[a-fA-F0-9]{4})") u = p.parse("http://example.jp/%uABCD") #=> #<URI::HTTP http://example.jp/%uABCD> URI.parse(u.to_s) #=> raises URI::InvalidURIError s = "http://example.com/ABCD" u1 = p.parse(s) #=> #<URI::HTTP http://example.com/ABCD> u2 = URI.parse(s) #=> #<URI::HTTP http://example.com/ABCD> u1 == u2 #=> true u1.eql?(u2) #=> false
Creates a new YAML::Store
object, which will store data in file_name
. If the file does not already exist, it will be created.
YAML::Store
objects are always reentrant. But if thread_safe is set to true, then it will become thread-safe at the cost of a minor performance hit.
Options passed in through yaml_opts
will be used when converting the store to YAML
via Hash#to_yaml()
.