lib/url_regexp/path.rb in url_regexp-0.1.2 vs lib/url_regexp/path.rb in url_regexp-0.1.3
- old
+ new
@@ -4,14 +4,15 @@
module UrlRegexp
class Path < Node
attr_reader :label, :paths
attr_accessor :path_end
- def initialize(label = nil, parent = nil)
+ def initialize(label = nil, parent = nil, options = {})
@label = label
@parent = parent
- @paths = PathSet.new
+ @options = options
+ @paths = PathSet.new(nil, @options)
@path_end = false
end
def ==(other)
self.class == other.class &&
@@ -26,19 +27,19 @@
[@label, @paths, @path_end].hash
end
def append(path)
if path == ''
- @paths.append(Path.new('', self))
+ @paths.append(Path.new('', self, @options))
elsif @parent.nil?
_, label, rest = path.split('/', 3)
else
label, rest = path.split('/', 2)
end
if label
p = @paths.find { |pp| pp.label == label }
if p.nil?
- p = Path.new(label, self)
+ p = Path.new(label, self, @options)
@paths.append(p)
end
if rest.nil?
p.path_end = true
else