class ProcessExecuter::Result
@api public
* ‘timed_out?`: true if the process timed out
* `stderr`: the captured stderr output
* `stdout`: the captured stdout output
* `elapsed_time`: the secs the command ran
* `options`: the options that were used to spawn the process
* `command`: the command that was used to spawn the process
A decorator for Process::Status that adds the following attributes:
def initialize(status, command:, options:, timed_out:, elapsed_time:)
- Api: - public
Parameters:
-
elapsed_time(Numeric) -- the secs the command ran -
timed_out(Boolean) -- true if the process timed out -
options(ProcessExecuter::Options) -- the options that were used to spawn the process -
command(Array) -- the command that was used to spawn the process -
status(Process::Status) -- the status to delegate to
def initialize(status, command:, options:, timed_out:, elapsed_time:) super(status) @command = command @options = options @timed_out = timed_out @elapsed_time = elapsed_time end
def stderr
-
(String, nil)-
def stderr pipe = options.stderr_redirection_value return nil unless pipe.is_a?(ProcessExecuter::MonitoredPipe) pipe.destination.string end
def stdout
-
(String, nil)-
def stdout pipe = options.stdout_redirection_value return nil unless pipe.is_a?(ProcessExecuter::MonitoredPipe) pipe.destination.string end
def success?
-
(true, nil)-
def success? return nil if timed_out? # rubocop:disable Style/ReturnNilInPredicateMethodDefinition super end
def timed_out?
-
(Boolean)-
def timed_out? @timed_out end
def to_s
-
(String)-
def to_s "#{super}#{timed_out? ? " timed out after #{options.timeout_after}s" : ''}" end