Module: ProcessExecuter
- Defined in:
- lib/process_executer.rb,
lib/process_executer/status.rb,
lib/process_executer/options.rb,
lib/process_executer/version.rb,
lib/process_executer/monitored_pipe.rb
Overview
Execute a command in a subprocess and optionally capture its output
Defined Under Namespace
Classes: MonitoredPipe, Options, Status
Constant Summary collapse
- VERSION =
The current Gem version
'1.2.0'
Class Method Summary collapse
-
.spawn(*command, **options_hash) ⇒ Process::Status
Execute the specified command as a subprocess and return the exit status.
Class Method Details
.spawn(*command, **options_hash) ⇒ Process::Status
Execute the specified command as a subprocess and return the exit status
This is a convenience method that calls Process.spawn and blocks until the command has terminated.
The command will be send the SIGKILL signal if it does not terminate within the specified timeout.
52 53 54 55 56 |
# File 'lib/process_executer.rb', line 52 def self.spawn(*command, **) = ProcessExecuter::Options.new(**) pid = Process.spawn(*command, **.) wait_for_process(pid, ) end |