diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2012-05-09 11:46:50 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2012-05-09 11:46:50 +0200 |
commit | ae1c6bd6b6b3f58576006602090acf2c1f37843e (patch) | |
tree | ce650bfc141a7d3064bcfb4fa52505c2a6411262 /lib/evendoors/particle.rb | |
parent | bc08d80e50cfcd4805f529901c370856950fc5e5 (diff) | |
download | edoors-ruby-ae1c6bd6b6b3f58576006602090acf2c1f37843e.zip edoors-ruby-ae1c6bd6b6b3f58576006602090acf2c1f37843e.tar.gz |
Particle: #set_dst! add no destination if no action and destination
Diffstat (limited to 'lib/evendoors/particle.rb')
-rw-r--r-- | lib/evendoors/particle.rb | 5 |
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! |