diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2012-05-09 11:57:04 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2012-05-09 11:57:04 +0200 |
commit | 8a2a3c900881c652389e2101725f37c1fcadd6a0 (patch) | |
tree | 8f1010835dc87e82e720de3271a07dc37c4e8b66 | |
parent | b1dac01c130cc104a7054b8f16b463dea5f93d03 (diff) | |
download | edoors-ruby-8a2a3c900881c652389e2101725f37c1fcadd6a0.zip edoors-ruby-8a2a3c900881c652389e2101725f37c1fcadd6a0.tar.gz |
Particle: manage spaces in destination string
-rw-r--r-- | lib/evendoors/particle.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/evendoors/particle.rb b/lib/evendoors/particle.rb index ee4a8a8..063862e 100644 --- a/lib/evendoors/particle.rb +++ b/lib/evendoors/particle.rb @@ -45,7 +45,7 @@ module EvenDoors # def add_dsts paths paths.split(EvenDoors::LINK_SEP).each do |path| - @dsts << path.sub(/^\/+/,'').sub(/\/+$/,'').gsub(/\/{2,}/,'/') + @dsts << path.sub(/^\/+/,'').sub(/\/+$/,'').gsub(/\/{2,}/,'/').gsub(/\s+/,'') end end # @@ -53,13 +53,13 @@ module EvenDoors @dst = @room = @door = @action = nil clear_dsts! return if ( (a.nil? or a.empty?) and d.empty? ) - @dsts << ( d.empty? ? '' : d.sub(/^\/+/,'').sub(/\/+$/,'').gsub(/\/{2,}/,'/') )+EvenDoors::ACT_SEP+a.to_str + add_dsts d+EvenDoors::ACT_SEP+a end # def split_dst! @dst = @room = @door = @action = nil n = next_dst - return if n.nil? or n.empty? + return if n.nil? or n.empty? or n==EvenDoors::ACT_SEP p, @action = n.split EvenDoors::ACT_SEP i = p.rindex EvenDoors::PATH_SEP if i.nil? |