Method: Subprocess.call

Defined in:
lib/subprocess.rb

.call(cmd, opts = {}) {|process| ... } ⇒ ::Process::Status

Note:

If you call this function with ‘:stdout => PIPE` or `:stderr => PIPE`, this function will block indefinitely as soon as the OS’s pipe buffer fills up, as neither file descriptor will be read from. To avoid this, use Subprocess::Process#communicate from a passed block.

Call and wait for the return of a given process.

Parameters:

Yields:

Yield Parameters:

Returns:

  • (::Process::Status)

    The exit status of the process

See Also:



46
47
48
# File 'lib/subprocess.rb', line 46

def self.call(cmd, opts={}, &blk)
  Process.new(cmd, opts, &blk).wait
end