Results for: "String#[]"

Performs a Net::HTTP request of type request_class on uri returning a Net::HTTP response object. request maintains a table of persistent connections to reduce connect overhead.

Creates server sockets based on the addresses option. If no addresses were given a server socket for all interfaces is created.

Returns the first source in the list.

Returns true if this source list includes other which may be a Gem::Source or a source URI.

Finds the path to the Ruby executable

No documentation available

Prints a formatted backtrace to the errors stream if backtraces are enabled.

No documentation available
No documentation available
No documentation available
No documentation available

See IO.unlink when path is a file.

See Dir.unlink when path is a directory.

Tests if the given command exists in file1, or optionally file2.

Example:

sh[?e, "foo"]
sh[:e, "foo"]
sh["e", "foo"]
sh[:exists?, "foo"]
sh["exists?", "foo"]

Executes the given command with the options parameter.

Example:

print sh.system("ls", "-l")
sh.system("ls", "-l") | sh.head > STDOUT

Executes a block as self

Example:

sh.transact { system("ls", "-l") | head > STDOUT }
No documentation available
No documentation available
No documentation available
No documentation available
No documentation available
No documentation available

Args

v

String

Description

Public setter for the host component v (with validation).

See also URI::Generic.check_host.

Usage

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.

No documentation available
Search took: 4ms  ·  Total Results: 3121