Returns the tangent of z
, where z
is given in radians
CMath.tan(1 + 1i) #=> (0.27175258531951174+1.0839233273386943i)
Returns the hyperbolic tangent of z
, where z
is given in radians
CMath.tanh(1 + 1i) #=> (1.0839233273386943+0.27175258531951174i)
Returns the tangent of z
, where z
is given in radians
CMath.tan(1 + 1i) #=> (0.27175258531951174+1.0839233273386943i)
Returns the hyperbolic tangent of z
, where z
is given in radians
CMath.tanh(1 + 1i) #=> (1.0839233273386943+0.27175258531951174i)
Options: mode preserve noop verbose
If src
is not same as dest
, copies it and changes the permission mode to mode
. If dest
is a directory, destination is dest
/src
. This method removes destination before copy.
FileUtils.install 'ruby', '/usr/local/bin/ruby', :mode => 0755, :verbose => true FileUtils.install 'lib.rb', '/usr/local/lib/ruby/site_ruby', :verbose => true
Options: mode preserve noop verbose
If src
is not same as dest
, copies it and changes the permission mode to mode
. If dest
is a directory, destination is dest
/src
. This method removes destination before copy.
FileUtils.install 'ruby', '/usr/local/bin/ruby', :mode => 0755, :verbose => true FileUtils.install 'lib.rb', '/usr/local/lib/ruby/site_ruby', :verbose => true
Computes the tangent of x
(expressed in radians).
Domain: (-INFINITY, INFINITY)
Codomain: (-INFINITY, INFINITY)
Math.tan(0) #=> 0.0
Computes the hyperbolic tangent of x
(expressed in radians).
Domain: (-INFINITY, INFINITY)
Codomain: (-1, 1)
Math.tanh(0) #=> 0.0
The standard configuration object for gems.
Use the given configuration object (which implements the ConfigFile
protocol) as the standard configuration object.
A Zlib::Deflate.deflate
wrapper
Retrieve the PathSupport
object that RubyGems uses to lookup files.
Initialize the filesystem paths to use from env
. env
is a hash-like object (typically ENV
) that is queried for ‘GEM_HOME’, ‘GEM_PATH’, and ‘GEM_SPEC_CACHE’
A Zlib::Inflate#inflate
wrapper
Top level install helper method. Allows you to install gems interactively:
% irb >> Gem.install "minitest" Fetching: minitest-3.0.1.gem (100%) => [#<Gem::Specification:0x1013b4528 @name="minitest", ...>]
Set
array of platforms this RubyGems supports (primarily for testing).
Array of platforms this RubyGems supports.
Waits for all children, returning an array of pid/status pairs (where status is a Process::Status
object).
fork { sleep 0.2; exit 2 } #=> 27432 fork { sleep 0.1; exit 1 } #=> 27433 fork { exit 0 } #=> 27434 p Process.waitall
produces:
[[30982, #<Process::Status: pid 30982 exit 0>], [30979, #<Process::Status: pid 30979 exit 1>], [30976, #<Process::Status: pid 30976 exit 2>]]
Some operating systems retain the status of terminated child processes until the parent collects that status (normally using some variant of wait()
). If the parent never collects this status, the child stays around as a zombie process. Process::detach
prevents this by setting up a separate Ruby thread whose sole job is to reap the status of the process pid when it terminates. Use detach
only when you do not intend to explicitly wait for the child to terminate.
The waiting thread returns the exit status of the detached process when it terminates, so you can use Thread#join
to know the result. If specified pid is not a valid child process ID, the thread returns nil
immediately.
The waiting thread has pid
method which returns the pid.
In this first example, we don’t reap the first child process, so it appears as a zombie in the process status display.
p1 = fork { sleep 0.1 } p2 = fork { sleep 0.2 } Process.waitpid(p2) sleep 2 system("ps -ho pid,state -p #{p1}")
produces:
27389 Z
In the next example, Process::detach
is used to reap the child automatically.
p1 = fork { sleep 0.1 } p2 = fork { sleep 0.2 } Process.detach(p1) Process.waitpid(p2) sleep 2 system("ps -ho pid,state -p #{p1}")
(produces no output)
Detach the process from controlling terminal and run in the background as system daemon. Unless the argument nochdir is true (i.e. non false), it changes the current working directory to the root (“/”). Unless the argument noclose is true, daemon() will redirect standard input, standard output and standard error to /dev/null. Return zero on success, or raise one of Errno::*.