From ae1c6bd6b6b3f58576006602090acf2c1f37843e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= <jeremy@asynk.ch>
Date: Wed, 9 May 2012 11:46:50 +0200
Subject: Particle: #set_dst! add no destination if no action and destination

---
 lib/evendoors/particle.rb | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/evendoors/particle.rb b/lib/evendoors/particle.rb
index bb93729..c81b16a 100644
--- a/lib/evendoors/particle.rb
+++ b/lib/evendoors/particle.rb
@@ -49,10 +49,11 @@ module EvenDoors
             end
         end
         #
-        def set_dst! a, d=nil
+        def set_dst! a, d=''
             @dst = @room = @door = @action = nil
             clear_dsts!
-            @dsts << ( d ? d.sub(/^\/+/,'').sub(/\/+$/,'').gsub(/\/{2,}/,'/') : '' )+EvenDoors::ACT_SEP+a.to_str
+            return if ( (a.nil? or a.empty?) and d.empty? )
+            @dsts << ( d.empty? ? '' : d.sub(/^\/+/,'').sub(/\/+$/,'').gsub(/\/{2,}/,'/') )+EvenDoors::ACT_SEP+a.to_str
         end
         #
         def split_dst!
-- 
cgit v1.1-2-g2b99