Method: Subprocess.check_call
- Defined in:
- lib/subprocess.rb
.check_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.
Like call, except raise a NonZeroExit if the process did not terminate successfully.
83 84 85 86 87 |
# File 'lib/subprocess.rb', line 83 def self.check_call(cmd, opts={}, &blk) status = Process.new(cmd, opts, &blk).wait raise NonZeroExit.new(cmd, status) unless status.success? status end |