Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #100 from taylor/master

added terminate to api
  • Loading branch information...
commit f8b1238a5058b8d8a88ed5cad819348e2726c632 2 parents 990092b + a196a31
@mattwynne mattwynne authored
Showing with 18 additions and 0 deletions.
  1. +10 −0 lib/aruba/api.rb
  2. +8 −0 lib/aruba/process.rb
View
10 lib/aruba/api.rb
@@ -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
8 lib/aruba/process.rb
@@ -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)
Please sign in to comment.
Something went wrong with that request. Please try again.