[DRE-commits] [ruby-aruba] 48/98: Prevent duplicate output

Hideki Yamane henrich at moszumanska.debian.org
Tue Mar 22 12:20:38 UTC 2016


This is an automated email from the git hooks/post-receive script.

henrich pushed a commit to branch debian/sid
in repository ruby-aruba.

commit 7b92c4e7de98d72344dd045d08860348f928c469
Author: Dennis Günnewig <dg1 at ratiodata.de>
Date:   Mon Jan 4 11:49:55 2016 +0100

    Prevent duplicate output
---
 lib/aruba/api/command.rb |  8 --------
 lib/aruba/command.rb     | 18 ++++++++++++------
 2 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/lib/aruba/api/command.rb b/lib/aruba/api/command.rb
index 9320b68..2db08e5 100644
--- a/lib/aruba/api/command.rb
+++ b/lib/aruba/api/command.rb
@@ -168,14 +168,6 @@ module Aruba
         working_directory = expand_path('.')
         event_bus         = aruba.event_bus
 
-        aruba.announcer.announce(:full_environment, environment)
-        aruba.announcer.announce(:timeout, 'exit', exit_timeout)
-        aruba.announcer.announce(:timeout, 'io wait', io_wait_timeout)
-        aruba.announcer.announce(:wait_time, 'startup wait time', startup_wait_time)
-
-        aruba.announcer.announce(:directory, working_directory)
-        aruba.announcer.announce(:command, cmd)
-
         cmd = Aruba.platform.detect_ruby(cmd)
 
         mode = if Aruba.process
diff --git a/lib/aruba/command.rb b/lib/aruba/command.rb
index 352722a..8fcf0e5 100644
--- a/lib/aruba/command.rb
+++ b/lib/aruba/command.rb
@@ -50,24 +50,30 @@ module Aruba
 
     # Stop command
     def stop(*)
-      __getobj__.stop
-      event_bus.notify Events::CommandStopped.new(self)
+      unless __getobj__.stopped?
+        __getobj__.stop
+        event_bus.notify Events::CommandStopped.new(self)
+      end
 
       self
     end
 
     # Terminate command
     def terminate(*)
-      __getobj__.terminate
-      event_bus.notify Events::CommandStopped.new(self)
+      unless __getobj__.stopped?
+        __getobj__.terminate
+        event_bus.notify Events::CommandStopped.new(self)
+      end
 
       self
     end
 
     # Start command
     def start
-      __getobj__.start
-      event_bus.notify Events::CommandStarted.new(self)
+      unless __getobj__.started?
+        __getobj__.start
+        event_bus.notify Events::CommandStarted.new(self)
+      end
 
       self
     end

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-aruba.git



More information about the Pkg-ruby-extras-commits mailing list