ARGV is Everything passed to the executable, does not include executable name
All other intputs are dependency injection for testing
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()
.
Creates a new Mutex