From 8a2a3c900881c652389e2101725f37c1fcadd6a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Wed, 9 May 2012 11:57:04 +0200 Subject: Particle: manage spaces in destination string --- lib/evendoors/particle.rb | 6 +++--- 1 file 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? -- cgit v1.1-2-g2b99