From 51c0beacc5e38ff8129c028615ea05cfe275fbce Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 24 Dec 2014 23:10:59 +0000 Subject: restart "source ed" after env changes 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 -- cgit v1.2.3-24-ge0c7