Prints a formatted backtrace to the errors stream if backtraces are enabled.
Sets userinfo, argument is string like ‘name:pass’.
Returns the userinfo, either as ‘user’ or ‘user:password’.
v
Public setter for the host component v
(with validation).
See also URI::Generic.check_host
.
require 'uri' uri = URI.parse("http://my.example.com") uri.host = "foo.com" uri.to_s #=> "http://foo.com"
Extract the host part of the URI
and unwrap brackets for IPv6 addresses.
This method is the same as URI::Generic#host
except brackets for IPv6 (and future IP) addresses are removed.
uri = URI("http://[::1]/bar") uri.hostname #=> "::1" uri.host #=> "[::1]"
Sets the host part of the URI
as the argument with brackets for IPv6 addresses.
This method is the same as URI::Generic#host=
except the argument can be a bare IPv6 address.
uri = URI("http://foo/bar") uri.hostname = "::1" uri.to_s #=> "http://[::1]/bar"
If the argument seems to be an IPv6 address, it is wrapped with brackets.
str
String
to search
schemes
Patterns to apply to str
Attempts to parse and merge a set of URIs. If no block
given, then returns the result, else it calls block
for each element in result.
See also URI::Parser.make_regexp
.
str
String
to search
schemes
Patterns to apply to str
Attempts to parse and merge a set of URIs. If no block
given, then returns the result, else it calls block
for each element in result.
See also URI::Parser.make_regexp
.
Stores value
in database with key
as the index. value
is converted to YAML
before being stored.
Returns value
Returns true
if this process is stopped, and if the corresponding wait call had the Process::WUNTRACED flag set, false
otherwise.
Returns the number of the signal that caused the process to stop, or nil
if the process is not stopped.
Returns the least significant eight bits of the return code of the process if it has exited; nil
otherwise:
`exit 99` $?.exitstatus # => 99
Wakes up all threads waiting for this lock.
Returns URL-escaped string following RFC 3986.
Returns URL-unescaped string following RFC 3986.
URL-encode a string following RFC 3986 Space characters (+“ ”+) are encoded with (+“%20”+)
url_encoded_string = CGI.escapeURIComponent("'Stop!' said Fred") # => "%27Stop%21%27%20said%20Fred"
URL-decode a string following RFC 3986 with encoding(optional).
string = CGI.unescapeURIComponent("%27Stop%21%27+said%20Fred") # => "'Stop!'+said Fred"
If none is given, returns the resulting hash value of the digest, keeping the digest’s state.
If a string is given, returns the hash value for the given string, resetting the digest to the initial state before and after the process.
Returns the resulting hash value and resets the digest to the initial state.
If none is given, returns the resulting hash value of the digest in a hex-encoded form, keeping the digest’s state.
If a string is given, returns the hash value for the given string in a hex-encoded form, resetting the digest to the initial state before and after the process.
Returns the resulting hash value in a hex-encoded form and resets the digest to the initial state.
If none is given, returns the resulting hash value of the digest in a base64 encoded form, keeping the digest’s state.
If a string
is given, returns the hash value for the given string
in a base64 encoded form, resetting the digest to the initial state before and after the process.
In either case, the return value is properly padded with ‘=’ and contains no line feeds.