lib/hx/path.rb in hx-0.8.4 vs lib/hx/path.rb in hx-0.9.0
- old
+ new
@@ -23,12 +23,12 @@
module Hx
module Path
module Selector
- def accept?(path)
- raise NotImplementedError, "#{self.class}#accept? not implemented"
+ def accept_path?(path)
+ raise NotImplementedError, "#{self.class}#accept_path? not implemented"
end
def |(other)
Disjunction.new(self, other)
end
@@ -42,11 +42,11 @@
end
end
class All
include Selector
- def accept?(path) ; true ; end
+ def accept_path?(path) ; true ; end
end
ALL = All.new
class Pattern
@@ -60,11 +60,11 @@
else; Regexp.quote(token)
end
}}$")
end
- def accept?(path) ; !!(path =~ @regexp) ; end
+ def accept_path?(path) ; !!(path =~ @regexp) ; end
end
def self.parse_pattern(pattern_string)
tokens = []
pattern_string.scan(/(\*\*?|[^*]+)/) do |token,|
@@ -101,31 +101,31 @@
end
end
super(*selectors)
end
- def accept?(path)
- @selectors.all? { |s| s.accept? path }
+ def accept_path?(path)
+ @selectors.all? { |s| s.accept_path? path }
end
end
class Disjunction
include Connective
- def accept?(path)
- @selectors.any? { |s| s.accept? path }
+ def accept_path?(path)
+ @selectors.any? { |s| s.accept_path? path }
end
end
class Negation
include Selector
def initialize(selector)
@selector = selector
end
- def accept?(path)
- not @selector.accept?(path)
+ def accept_path?(path)
+ not @selector.accept_path?(path)
end
end
end
end