module ProcessExecuter

def self.spawn(*command, **options_hash)

Returns:
  • (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

def self.wait_for_process(pid, options)

Other tags:
    Api: - private

Returns:
  • (Process::Status) - the status of the process

Parameters:
  • options (ProcessExecuter::Options) -- the options used
  • pid (Integer) -- the process id
def self.wait_for_process(pid, options)
ions.timeout) do
).last

, pid)
last