Permalink
Browse files

Merge remote-tracking branch 'rails/1-0-stable' into 1-0-stable

  • Loading branch information...
2 parents a5b1bdc + 390f056 commit 56c413fce495c764f031be60bf1d603a64676ec5 @lifo committed Sep 6, 2012
Showing with 5 additions and 9 deletions.
  1. +5 −7 lib/journey/formatter.rb
  2. +0 −2 test/test_router.rb
View
@@ -110,16 +110,14 @@ def verify_required_parts! route, parts
end
def build_cache
- kash = {}
+ root = { :___routes => [] }
routes.each_with_index do |route, i|
- money = kash
- route.required_defaults.each do |tuple|
- hash = (money[tuple] ||= {})
- money = hash
+ leaf = route.required_defaults.inject(root) do |h, tuple|
+ h[tuple] ||= {}
end
- (money[:___routes] ||= []) << [i, route]
+ (leaf[:___routes] ||= []) << [i, route]
end
- kash
+ root
end
def cache
View
@@ -34,7 +34,6 @@ def ip; env['REMOTE_ADDR']; end
end
def test_dashes
- klass = FakeRequestFeeler.new nil
router = Router.new(routes, {})
exp = Router::Strexp.new '/foo-bar-baz', {}, ['/.?']
@@ -51,7 +50,6 @@ def test_dashes
end
def test_unicode
- klass = FakeRequestFeeler.new nil
router = Router.new(routes, {})
#match the escaped version of /ほげ

0 comments on commit 56c413f

Please sign in to comment.