summaryrefslogtreecommitdiffstats
path: root/lib/evendoors
diff options
context:
space:
mode:
Diffstat (limited to 'lib/evendoors')
-rw-r--r--lib/evendoors/spot.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/evendoors/spot.rb b/lib/evendoors/spot.rb
index bf26761..72f5180 100644
--- a/lib/evendoors/spot.rb
+++ b/lib/evendoors/spot.rb
@@ -10,6 +10,7 @@ module EvenDoors
@name = n # unique in it's room
@parent = p # single direct parent
@viewer = nil # particle going through that position will be sent there readonly
+ raise EvenDoors::Exception.new "Spot name #{name} is not valid" if @name.include? EvenDoors::PATH_SEP
end
#
attr_reader :name
@@ -17,8 +18,7 @@ module EvenDoors
#
def path
return @path if @path
- p = ( @parent ? @parent.path+'/' : '') + name
- @path = p.sub(/^\/+/,'').sub(/\/+$/,'').gsub(/\/{2,}/,'/')
+ @path = ( @parent ? @parent.path+EvenDoors::PATH_SEP : '') + name
end
#
end