summaryrefslogtreecommitdiffstats
path: root/lib/evendoors/room.rb
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2012-05-09 13:36:08 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2012-05-09 13:36:08 +0200
commit865a67bf6b4313bda71f7689acc1ccae088c7c77 (patch)
tree8e672cde3d1271eef159f83c6c23741d780e9ab5 /lib/evendoors/room.rb
parent0b120c62d266cc776b183119ab9a5dc602eabc51 (diff)
downloadedoors-ruby-865a67bf6b4313bda71f7689acc1ccae088c7c77.zip
edoors-ruby-865a67bf6b4313bda71f7689acc1ccae088c7c77.tar.gz
debug -> debug_routing + debug_errors
Diffstat (limited to 'lib/evendoors/room.rb')
-rw-r--r--lib/evendoors/room.rb17
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/evendoors/room.rb b/lib/evendoors/room.rb
index 729e66c..71c8971 100644
--- a/lib/evendoors/room.rb
+++ b/lib/evendoors/room.rb
@@ -28,21 +28,22 @@ module EvenDoors
end
#
def start!
- puts " * start #{path}" if EvenDoors::Twirl.debug
+ puts " * start #{path}" if EvenDoors::Twirl.debug_routing
@spots.values.each do |spot| spot.start! if spot.respond_to? :start! end
end
#
def stop!
- puts " * stop #{path}" if EvenDoors::Twirl.debug
+ puts " * stop #{path}" if EvenDoors::Twirl.debug_routing
@spots.values.each do |spot| spot.stop! if spot.respond_to? :stop! end
end
#
def space
- ( @parent.nil? ? self : @parent.space )
+ return @space if @space
+ @space = ( @parent.nil? ? self : @parent.space )
end
#
def try_links p
- puts " -> try_links ..." if EvenDoors::Twirl.debug
+ puts " -> try_links ..." if EvenDoors::Twirl.debug_routing
links = @links[p.src.name]
return false if links.nil?
pending_link = nil
@@ -86,7 +87,7 @@ module EvenDoors
end
#
def send_p p
- puts " * send_p #{(p.next_dst.nil? ? 'no dst' : p.next_dst)} ..." if EvenDoors::Twirl.debug
+ puts " * send_p #{(p.next_dst.nil? ? 'no dst' : p.next_dst)} ..." if EvenDoors::Twirl.debug_routing
if p.src.nil?
# do not route orphan particles !!
p.error! EvenDoors::ERROR_ROUTE_NS, space
@@ -103,12 +104,12 @@ module EvenDoors
else
p.error! EvenDoors::ERROR_ROUTE_NDNL
end
- puts " -> #{p.dst.path}#{EvenDoors::ACT_SEP}#{p.action}" if EvenDoors::Twirl.debug
+ puts " -> #{p.dst.path}#{EvenDoors::ACT_SEP}#{p.action}" if EvenDoors::Twirl.debug_routing
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
+ puts " * send_sys_p #{(p.next_dst.nil? ? 'no dst' : p.next_dst)} ..." if EvenDoors::Twirl.debug_routing
if p.next_dst
p.split_dst!
if p.door
@@ -121,7 +122,7 @@ module EvenDoors
else
p.error! EvenDoors::ERROR_ROUTE_SND
end
- puts " -> #{p.dst.path}#{EvenDoors::ACT_SEP}#{p.action}" if EvenDoors::Twirl.debug
+ puts " -> #{p.dst.path}#{EvenDoors::ACT_SEP}#{p.action}" if EvenDoors::Twirl.debug_routing
EvenDoors::Twirl.send_sys_p p
end
#