lib/ryodo/rule_set.rb in ryodo-0.0.3 vs lib/ryodo/rule_set.rb in ryodo-0.1.0
- old
+ new
@@ -7,11 +7,10 @@
@tree = {}
build!
end
def build!
-
Ryodo::SuffixList.list.each do |line|
line.each.with_index do |node_name, idx|
stopOK = node_name == line.last
@@ -31,15 +30,13 @@
end
end
end
-
end
def select_rule(rule_path)
-
path = rule_path.dup
if current = path.pop
if path.empty?
@@ -49,11 +46,10 @@
rule = select_rule(path)
rule.children[current] if rule
end
end
-
end
def match(path)
suffix, domain, match = [], [], nil
@@ -68,10 +64,9 @@
# only if match has no children with domain and domain is present
if match && !match.children.keys.include?(domain[0]) && domain[0]
[ suffix, [domain.shift], domain ]
end
-
end
end
end
\ No newline at end of file