module ProcessExecuter
def self.spawn(*command, **options_hash)
-
(Process::Status)
- the exit status of the proceess
Parameters:
-
options_hash
(Hash
) -- the options to use when exectuting the command -
command
(Array
) -- the command to execute
Other tags:
- See: ProcessExecuter::Options#initialize - See ProcessExecuter::Options#initialize
See: https://ruby-doc.org/core-3.1.2/Kernel.html#method-i-spawn - Kernel.spawn
Other tags:
- Example: capturing stdout to a string -
Example: with a timeout -
def self.spawn(*command, **options_hash) options = ProcessExecuter::Options.new(**options_hash) pid = Process.spawn(*command, **options.spawn_options) wait_for_process(pid, options) end