Permalink
Browse files

Change head_routes method name to get_routes_as_head

This method return from a set of routes all the ones that are GET routes
as HEAD routes
  • Loading branch information...
1 parent c802504 commit e4755e0ba27a4d6863656031e7c1ce26a7413ca6 @spastorino spastorino committed Jul 25, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/journey/router.rb
@@ -128,7 +128,7 @@ def find_routes env
routes = filter_routes(req.path_info).concat custom_routes.find_all { |r|
r.path.match(req.path_info)
}
- routes.concat head_routes(routes)
+ routes.concat get_routes_as_head(routes)
routes.sort_by!(&:precedence).select! { |r|
r.constraints.all? { |k,v| v === req.send(k) } &&
@@ -146,7 +146,7 @@ def find_routes env
}
end
- def head_routes(routes)
+ def get_routes_as_head(routes)
precedence = (routes.map(&:precedence).max || 0) + 1
routes = routes.select { |r|
r.verb === "GET" && !(r.verb === "HEAD")

0 comments on commit e4755e0

Please sign in to comment.