Installs the gem dep_or_name
and all its dependencies. Returns an Array of installed gem specifications.
If the :prerelease
option is set and there is a prerelease for dep_or_name
the prerelease version will be installed.
Unless explicitly specified as a prerelease dependency, prerelease gems that dep_or_name
depend on will not be installed.
If c-1.a depends on b-1 and a-1.a and there is a gem b-1.a available then c-1.a, b-1 and a-1.a will be installed. b-1.a will need to be installed separately.
Zlib::GzipWriter
wrapper that gzips filename
on disk.
Installs the gem and returns a loaded Gem::Specification
for the installed gem.
The gem will be installed with the following structure:
@gem_home/ cache/<gem-version>.gem #=> a cached copy of the installed gem gems/<gem-version>/... #=> extracted files specifications/<gem-version>.gemspec #=> the Gem::Specification
Verifies that this gem:
Contains a valid gem specification
Contains a contents archive
The contents archive is not corrupt
After verification the gem specification from the gem is available from spec
Noop this out so there are no anchors
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.
Installs gems for this RequestSet
using the Gem::Installer
options
.
If a block
is given an activation request
and installer
are yielded. The installer
will be nil
if a gem matching the request was already installed.
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 a Gem::StubSpecification
for every installed gem
Recursively walk dependencies of this spec, executing the block
for each hop.
Performs the uninstall of the gem. This removes the spec, the Gem directory, and the cached .gem file.
Prints a formatted backtrace to the errors stream if backtraces are enabled.
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 }
Sets userinfo, argument is string like ‘name:pass’
returns the userinfo, either as ‘user’ or ‘user:password’
v
String
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" # => "foo.com" uri #=> #<URI::HTTP:0x000000008e89e8 URL:http://foo.com>
extract the host part of the URI
and unwrap brackets for IPv6 addresses.
This method is same as URI::Generic#host
except brackets for IPv6 (and future IP) addresses are removed.
u = URI(“http://[::1]/bar”) p u.hostname #=> “::1” p u.host #=> “[::1]”