Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

middle variable is never used, so rm

  • Loading branch information...
commit dd1f23df7b59a6d0c4cba9c22292032414a7adfe 1 parent c5d64b2
@tenderlove tenderlove authored
View
2  actionpack/lib/action_dispatch/journey/router.rb
@@ -90,7 +90,7 @@ def recognize(req)
req.env['PATH_INFO'] = match.post_match.sub(/^([^\/])/, '/\1')
end
- yield(route, nil, parameters)
+ yield(route, parameters)
end
end
View
2  actionpack/lib/action_dispatch/routing/route_set.rb
@@ -699,7 +699,7 @@ def recognize_path(path, environment = {})
end
req = @request_class.new(env)
- @router.recognize(req) do |route, _matches, params|
+ @router.recognize(req) do |route, params|
params.merge!(extras)
params.each do |key, value|
if value.is_a?(String)
View
28 actionpack/test/journey/router_test.rb
@@ -48,7 +48,7 @@ def test_dashes
env = rails_env 'PATH_INFO' => '/foo-bar-baz'
called = false
- router.recognize(env) do |r, _, params|
+ router.recognize(env) do |r, params|
called = true
end
assert called
@@ -65,7 +65,7 @@ def test_unicode
env = rails_env 'PATH_INFO' => '/%E3%81%BB%E3%81%92'
called = false
- router.recognize(env) do |r, _, params|
+ router.recognize(env) do |r, params|
called = true
end
assert called
@@ -83,7 +83,7 @@ def test_request_class_and_requirements_success
routes.add_route nil, path, requirements, {:id => nil}, {}
env = rails_env 'PATH_INFO' => '/foo/10'
- router.recognize(env) do |r, _, params|
+ router.recognize(env) do |r, params|
assert_equal({:id => '10'}, params)
end
@@ -103,7 +103,7 @@ def test_request_class_and_requirements_fail
router.routes.add_route nil, path, requirements, {:id => nil}, {}
env = rails_env 'PATH_INFO' => '/foo/10'
- router.recognize(env) do |r, _, params|
+ router.recognize(env) do |r, params|
flunk 'route should not be found'
end
@@ -128,7 +128,7 @@ def test_request_class_overrides_path_info
env = rails_env 'PATH_INFO' => '/foo', 'custom.path_info' => '/bar'
recognized = false
- router.recognize(env) do |r, _, params|
+ router.recognize(env) do |r, params|
recognized = true
end
@@ -144,7 +144,7 @@ def test_regexp_first_precedence
env = rails_env 'PATH_INFO' => '/whois/example.com'
list = []
- @router.recognize(env) do |r, _, params|
+ @router.recognize(env) do |r, params|
list << r
end
assert_equal 2, list.length
@@ -230,12 +230,12 @@ def test_defaults_merge_correctly
@router.routes.add_route nil, path, {}, {:id => nil}, {}
env = rails_env 'PATH_INFO' => '/foo/10'
- @router.recognize(env) do |r, _, params|
+ @router.recognize(env) do |r, params|
assert_equal({:id => '10'}, params)
end
env = rails_env 'PATH_INFO' => '/foo'
- @router.recognize(env) do |r, _, params|
+ @router.recognize(env) do |r, params|
assert_equal({:id => nil}, params)
end
end
@@ -431,7 +431,7 @@ def test_generate_with_name
env = rails_env 'PATH_INFO' => request_path
called = false
- @router.recognize(env) do |r, _, params|
+ @router.recognize(env) do |r, params|
assert_equal route, r
assert_equal(expected, params)
called = true
@@ -453,7 +453,7 @@ def test_generate_with_name
env = rails_env 'PATH_INFO' => request_path
called = false
- @router.recognize(env) do |r, _, params|
+ @router.recognize(env) do |r, params|
assert_equal route, r
assert_equal(expected, params)
called = true
@@ -481,7 +481,7 @@ def test_namespaced_controller
:id => '10'
}
- @router.recognize(env) do |r, _, params|
+ @router.recognize(env) do |r, params|
assert_equal route, r
assert_equal(expected, params)
called = true
@@ -497,7 +497,7 @@ def test_recognize_literal
env = rails_env 'PATH_INFO' => '/books/list.rss'
expected = { :controller => 'books', :action => 'list', :format => 'rss' }
called = false
- @router.recognize(env) do |r, _, params|
+ @router.recognize(env) do |r, params|
assert_equal route, r
assert_equal(expected, params)
called = true
@@ -518,7 +518,7 @@ def test_recognize_head_request_as_get_route
"REQUEST_METHOD" => "HEAD"
called = false
- @router.recognize(env) do |r, _, params|
+ @router.recognize(env) do |r, params|
called = true
end
@@ -542,7 +542,7 @@ def test_recognize_cares_about_verbs
"REQUEST_METHOD" => "POST"
called = false
- @router.recognize(env) do |r, _, params|
+ @router.recognize(env) do |r, params|
assert_equal post, r
called = true
end
Please sign in to comment.
Something went wrong with that request. Please try again.