aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/journey/router.rb
Commit message (Collapse)AuthorAgeFilesLines
* Pass symbol as an argument instead of a blockErik Michaels-Ober2014-11-291-2/+2
|
* Avoid duplicating routes for HEAD requests.Guo Xiang Tan2014-08-211-17/+23
| | | | | | | | Follow up to rails#15321 Instead of duplicating the routes, we will first match the HEAD request to HEAD routes. If no match is found, we will then map the HEAD request to GET routes.
* Replace x.sort_by!.select! with x.select!.sort_by!Viktar Basharymau2014-06-201-1/+2
| | | | | | | | | The latter has the same speed as the former in the worst case and faster in general, because it is always better to sort less items. Unfortunately, `routes.select!{...}.sort_by!{...}` is not possible here because `select!` returns `nil`, so select! and sort! must be done in two steps.
* Fix request's path_info when a rack app mounted at '/'.Larry Lv2014-06-141-0/+1
| | | | Fixes issue #15511.
* Merge branch 'constraints'Aaron Patterson2014-05-271-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * constraints: rm reset_parameters because we automatically do it from 9ca4839a move path_parameter encoding check to the request object dispatcher doesn't need `call` anymore call `serve` with the request on dispatchers constraints class does not need the request class anymore give all endpoints a superclass skip the build business if the stack is empty stop hardcoding path_parameters and get it from the request we do not need to cache rack_app a redirect is not a dispatcher by definition, so eliminate test push is_a check up to where the Constraints object is allocated pass the request object to the application pass a request to `matches?` so we can avoid creating excess requests nothing is passed to `rack_app` anymore, so rm the params one fewer is_a check Constraints#app should never return another Constraints object, so switch to if statement eliminate dispatcher is_a checks push is_a?(Dispatcher) check in to one place Always construct route objects with Constraint objects Conflicts: actionpack/lib/action_controller/metal.rb
| * pass the request object to the applicationAaron Patterson2014-05-251-1/+1
| |
* | Merge pull request #15321 from ↵Santiago Pastorino2014-05-271-1/+4
|\ \ | | | | | | | | | | | | tgxworld/only_find_routes_as_heads_for_head_request Call get_routes_as_head only on HEAD requests.
| * | Call get_routes_as_head only on HEAD requests.Guo Xiang Tan2014-05-251-1/+4
| |/
* / Remove unnecessary flatten! method call.Guo Xiang Tan2014-05-251-3/+1
|/
* there is no formatter on the router object, so rmAaron Patterson2014-05-231-1/+0
|
* decouple the router object from the request classAaron Patterson2014-05-231-5/+3
|
* pass the correct custom request to the recognize methodAaron Patterson2014-05-231-3/+1
|
* switch to the `serve` method so we can remove the request class (eventually)Aaron Patterson2014-05-231-6/+0
|
* extract request allocation from the main app serving routineAaron Patterson2014-05-231-2/+4
|
* use the accessors on the request object rather than touching envAaron Patterson2014-05-231-2/+2
|
* find_routes only use the request, so stop passing envAaron Patterson2014-05-231-3/+3
|
* remove NullRequest and just always pass a request classAaron Patterson2014-05-231-26/+1
|
* use the request object since we have itAaron Patterson2014-05-231-8/+9
| | | | | stop hardcoding hash keys and use the accessors provided on the request object.
* stop using PARAMETERS_KEY, and use the accessor on the request objectAaron Patterson2014-05-221-6/+6
| | | | this decouples our code from the env hash a bit.
* pass the instantiated request to the find_routes methodAaron Patterson2014-05-221-5/+7
|
* drop hash allocations during matchAaron Patterson2014-05-211-2/+2
|
* fewer object allocations and method calls during route matchAaron Patterson2014-05-211-5/+5
|
* middle variable is never used, so rmAaron Patterson2014-05-211-1/+1
|
* do not create memo objects since we'll just throw them awayAaron Patterson2014-04-011-2/+1
|
* Revert "Don't remove trailing slash from PATH_INFO for mounted apps"Piotr Sarnacki2014-01-161-7/+1
| | | | | | | The revert is needed because of a regression described in #13369, routes with trailing slash are no longer recognized properly. This reverts commit 50311f1391ddd8e0349d74eb57f04b7e0045a27d.
* Don't remove trailing slash from PATH_INFO for mounted appsPiotr Sarnacki2013-06-211-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | Previously when app was mounted as following: class Foo def call(env) [200, {}, [env['PATH_INFO']]] end end RackMountRailsBug::Application.routes.draw do mount RackTest.new => "/foo" end trailing slash was removed from PATH_INFO. For example requesting GET /foo/bar/ on routes defined above would result in a response containing "/foo/bar" instead of "/foo/bar/". This commit fixes the issue. (closes #3215)
* make [] method in router more readablebuddhamagnet2013-04-151-1/+3
|
* Add support for other types of routing constraintsAndrew White2013-01-151-5/+1
| | | | | | | | | | | | | | This now allows the use of arrays like this: get '/foo/:action', to: 'foo', constraints: { subdomain: %w[www admin] } or constraints where the request method returns an Fixnum like this: get '/foo', to: 'foo#index', constraints: { port: 8080 } Note that this only applies to constraints on the request - path constraints still need to be specified as Regexps as the various constraints are compiled into a single Regexp.
* update AD::Journey to follow Rails coding conventionsFrancesco Rodriguez2012-12-201-58/+58
|
* :nodoc: Journey because is not part of the public API [ci skip]Francesco Rodriguez2012-12-191-3/+4
|
* Remove obsolete Hash extension needed for Ruby 1.8.x supportAndrew White2012-12-191-1/+0
| | | | [ci skip]
* Integrate Journey into Action DispatchAndrew White2012-12-191-0/+168
Move the Journey code underneath the ActionDispatch namespace so that we don't pollute the global namespace with names that may be used for models. Fixes rails/journey#49.