diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2012-05-09 08:50:50 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2012-05-09 08:50:50 +0200 |
commit | 76d484f567b30cef2a4ddea10348ac535adbd784 (patch) | |
tree | 97627f562e3ebf4e02c475d8f94d092c22736ff0 /lib | |
parent | 84fc5e33d1b81c3addb63b5f6f930a89f3cbcf4e (diff) | |
download | edoors-ruby-76d484f567b30cef2a4ddea10348ac535adbd784.zip edoors-ruby-76d484f567b30cef2a4ddea10348ac535adbd784.tar.gz |
Room: cleanup debug, factorise calls to Twirl.send_, add space as dst on ERROR_ROUTE_NDNS
Diffstat (limited to 'lib')
-rw-r--r-- | lib/evendoors/room.rb | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/lib/evendoors/room.rb b/lib/evendoors/room.rb index 33a872e..fdee3e7 100644 --- a/lib/evendoors/room.rb +++ b/lib/evendoors/room.rb @@ -42,7 +42,7 @@ module EvenDoors end # def try_links p - puts " * try_links ..." if EvenDoors::Twirl.debug + puts " -> try_links ..." if EvenDoors::Twirl.debug links = @links[p.src.name] return false if links.nil? pending_link = nil @@ -91,24 +91,22 @@ module EvenDoors end # def send_p p + puts " * send_p #{(p.next_dst.nil? ? 'no dst' : p.next_dst)} ..." if EvenDoors::Twirl.debug if p.next_dst - puts " * send #{p.next_dst.to_str} ..." if EvenDoors::Twirl.debug p.split_dst! route_p p - puts " -> #{p.dst.path}#{EvenDoors::ACT_SEP}#{p.action}" if EvenDoors::Twirl.debug - EvenDoors::Twirl.send_p p elsif p.src.nil? - p.error! EvenDoors::ERROR_ROUTE_NDNS + p.error! EvenDoors::ERROR_ROUTE_NDNS, space elsif not try_links p p.error! EvenDoors::ERROR_ROUTE_NDNL - puts " -> #{p.dst.path}#{EvenDoors::ACT_SEP}#{p.action}" if EvenDoors::Twirl.debug - EvenDoors::Twirl.send_p p end + puts " -> #{p.dst.path}#{EvenDoors::ACT_SEP}#{p.action}" if EvenDoors::Twirl.debug + EvenDoors::Twirl.send_p p end # def send_sys_p p + puts " * send_sys_p #{(p.next_dst.nil? ? 'no dst' : p.next_dst)} ..." if EvenDoors::Twirl.debug if p.next_dst - puts " * send_sys #{p.next_dst.to_str} ..." if EvenDoors::Twirl.debug p.split_dst! if p.door.empty? if p.action.nil? @@ -119,13 +117,11 @@ module EvenDoors else route_p p end - puts " -> #{p.dst.path}#{EvenDoors::ACT_SEP}#{p.action}" if EvenDoors::Twirl.debug - EvenDoors::Twirl.send_sys_p p else p.error! EvenDoors::ERROR_ROUTE_SND - puts " -> #{p.dst.path}#{EvenDoors::ACT_SEP}#{p.action}" if EvenDoors::Twirl.debug - EvenDoors::Twirl.send_sys_p p end + puts " -> #{p.dst.path}#{EvenDoors::ACT_SEP}#{p.action}" if EvenDoors::Twirl.debug + EvenDoors::Twirl.send_sys_p p end # def process_sys_p p |