lib/acouchi/process_launcher.rb in acouchi-0.0.2 vs lib/acouchi/process_launcher.rb in acouchi-0.0.3
- old
+ new
@@ -5,17 +5,33 @@
@process = ChildProcess.build(*@arguments)
@process.io.inherit!
end
def start
+ write_out_arguments
@process.start
@process.wait
end
+ def start_in_background
+ write_out_arguments
+ @process.start
+ end
+
+ def stop
+ @process.stop
+ end
+
def start_and_crash_if_process_fails
start
+
if @process.crashed?
raise "A process exited with a non-zero exit code.\nThe command executed was \"#{@arguments.join(" ")}\""
end
end
+
+ private
+ def write_out_arguments
+ p @arguments
+ end
end
end