dtas-all
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] restart "source ed" after env changes


From: Eric Wong
Subject: [PATCH] restart "source ed" after env changes
Date: Wed, 24 Dec 2014 23:41:38 +0000

Merely converting the `before' source information to a hash is not
enough, as the `env' sub-hash is mosified in-place and shared with
the `after' hash.  So use `inspect' to serialize and snapshot the
env and rely on a string comparison.
---
 lib/dtas/player/client_handler.rb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/dtas/player/client_handler.rb 
b/lib/dtas/player/client_handler.rb
index c9ae2e4..37357f7 100644
--- a/lib/dtas/player/client_handler.rb
+++ b/lib/dtas/player/client_handler.rb
@@ -474,7 +474,7 @@ module DTAS::Player::ClientHandler # :nodoc:
     when "cat"
       io.emit(src.to_source_cat.to_yaml)
     when "ed"
-      before = src.to_state_hash
+      before = src.to_state_hash.inspect
       sd = src.source_defaults
       msg.each do |kv|
         k, v = kv.split(/=/, 2)
@@ -492,7 +492,7 @@ module DTAS::Player::ClientHandler # :nodoc:
           source_map_reload
         end
       end
-      after = src.to_state_hash
+      after = src.to_state_hash.inspect
       __current_requeue if before != after && @current.class == src.class
       io.emit("OK")
     else
-- 
EW



reply via email to

[Prev in Thread] Current Thread [Next in Thread]