Method: ProcessExecuter::Result#success?

Defined in:
lib/process_executer/result.rb

#success?true?

Overrides the default success? method to return nil if the process timed out

This is because when a timeout occurs, Windows will still return true.

Examples:

result = ProcessExecuter.spawn('sleep 10', timeout_after: 0.01)
result.success? # => nil

Returns:

  • (true, nil)


96
97
98
99
100
# File 'lib/process_executer/result.rb', line 96

def success?
  return nil if timed_out? # rubocop:disable Style/ReturnNilInPredicateMethodDefinition

  super
end