Permalink
Browse files

Merge pull request #100 from taylor/master

added terminate to api
  • Loading branch information...
mattwynne committed Dec 24, 2011
2 parents 990092b + a196a31 commit f8b1238a5058b8d8a88ed5cad819348e2726c632
Showing with 18 additions and 0 deletions.
  1. +10 −0 lib/aruba/api.rb
  2. +8 −0 lib/aruba/process.rb
View
@@ -239,6 +239,13 @@ def stop_processes!
end
end
+ def terminate_processes!
+ processes.each do |_, process|
+ terminate_process(process)
+ stop_process(process)
+ end
+ end
+
def register_process(name, process)
processes << [name, process]
end
@@ -382,5 +389,8 @@ def stop_process(process)
announce_or_puts(process.stderr(@aruba_keep_ansi)) if @announce_stderr
end
+ def terminate_process(process)
+ process.terminate(@aruba_keep_ansi)
+ end
end
end
View
@@ -56,6 +56,14 @@ def stop(keep_ansi)
end
end
+ def terminate(keep_ansi)
+ if @process
+ stdout(keep_ansi) && stderr(keep_ansi) # flush output
+ @process.stop
+ stdout(keep_ansi) && stderr(keep_ansi) # flush output
+ end
+ end
+
private
def wait_for_io(&block)

0 comments on commit f8b1238

Please sign in to comment.