lib/usher/node.rb in joshbuddy-usher-0.4.7 vs lib/usher/node.rb in joshbuddy-usher-0.4.8
- old
+ new
@@ -1,7 +1,5 @@
-$:.unshift File.dirname(__FILE__)
-
require 'fuzzy_hash'
class Usher
class Node
@@ -49,10 +47,10 @@
def add(route)
route.paths.each do |path|
parts = path.parts.dup
request_methods.each do |type|
- parts.push(Route::RequestMethod.new(type, route.conditions[type])) if route.conditions.key?(type)
+ parts.push(Route::RequestMethod.new(type, route.conditions[type])) if route.conditions && route.conditions.key?(type)
end
current_node = self
until parts.size.zero?
key = parts.shift