Sha256: 4e35227fc2feb6e7bef23378bb41c1eaebc8cf6551ea871ba37a3288d477f4c6
Contents?: true
Size: 731 Bytes
Versions: 10
Compression:
Stored size: 731 Bytes
Contents
require "childprocess" module Acouchi class ProcessLauncher DEFAULT_START_OPTIONS = {:inherit_io => true} def initialize(*arguments) @arguments = arguments @process = ChildProcess.build(*@arguments) self end def with_inherited_io @process.io.inherit! self end def start @process.start self end def wait @process.wait self end def start_in_background @process.start self end def start_and_crash_if_process_fails start.wait if @process.crashed? raise "A process exited with a non-zero exit code.\nThe command executed was \"#{@arguments.join(" ")}\"" end self end end end
Version data entries
10 entries across 10 versions & 1 rubygems