summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2012-05-09 11:46:50 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2012-05-09 11:46:50 +0200
commitae1c6bd6b6b3f58576006602090acf2c1f37843e (patch)
treece650bfc141a7d3064bcfb4fa52505c2a6411262
parentbc08d80e50cfcd4805f529901c370856950fc5e5 (diff)
downloadedoors-ruby-ae1c6bd6b6b3f58576006602090acf2c1f37843e.zip
edoors-ruby-ae1c6bd6b6b3f58576006602090acf2c1f37843e.tar.gz
Particle: #set_dst! add no destination if no action and destination
-rw-r--r--lib/evendoors/particle.rb5
1 files 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!