Method: ProcessExecuter::Result#stderr

Defined in:
lib/process_executer/result.rb

#stderrString?

Return the captured stderr output

This output is only returned if the :err option value is a ProcessExecuter::MonitoredPipe.

Examples:

# Note that `ProcessExecuter.run` will wrap the given err: object in a
# ProcessExecuter::MonitoredPipe
result = ProcessExecuter.run('echo ERROR 1>&2', err: StringIO.new)
resuilt.stderr #=> "ERROR\n"

Returns:

  • (String, nil)


143
144
145
146
147
148
# File 'lib/process_executer/result.rb', line 143

def stderr
  pipe = options.stderr_redirection_value
  return nil unless pipe.is_a?(ProcessExecuter::MonitoredPipe)

  pipe.destination.string
end