1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
Commit graph

23 commits

Author SHA1 Message Date
Aaron Patterson
02f3081332 there is no formatter on the router object, so rm 2014-05-23 10:59:44 -07:00
Aaron Patterson
0f5e3a9f6b decouple the router object from the request class 2014-05-23 10:57:25 -07:00
Aaron Patterson
6fd8346400 pass the correct custom request to the recognize method 2014-05-23 10:57:25 -07:00
Aaron Patterson
6ed5b01f97 switch to the serve method so we can remove the request class (eventually) 2014-05-23 10:57:25 -07:00
Aaron Patterson
aaceca625d extract request allocation from the main app serving routine 2014-05-23 10:57:25 -07:00
Aaron Patterson
ca02296706 use the accessors on the request object rather than touching env 2014-05-23 10:17:57 -07:00
Aaron Patterson
559d89c5b3 find_routes only use the request, so stop passing env 2014-05-23 10:16:03 -07:00
Aaron Patterson
890e0a97fb remove NullRequest and just always pass a request class 2014-05-23 10:09:24 -07:00
Aaron Patterson
a6e94547e8 use the request object since we have it
stop hardcoding hash keys and use the accessors provided on the request
object.
2014-05-23 09:56:33 -07:00
Aaron Patterson
9ca4839a1a stop using PARAMETERS_KEY, and use the accessor on the request object
this decouples our code from the env hash a bit.
2014-05-22 15:57:24 -07:00
Aaron Patterson
1b76c7e9f6 pass the instantiated request to the find_routes method 2014-05-22 15:46:38 -07:00
Aaron Patterson
b754d9b56d drop hash allocations during match 2014-05-21 16:33:06 -07:00
Aaron Patterson
6bd9ade062 fewer object allocations and method calls during route match 2014-05-21 16:21:33 -07:00
Aaron Patterson
dd1f23df7b middle variable is never used, so rm 2014-05-21 16:12:49 -07:00
Aaron Patterson
ee453a1ea1 do not create memo objects since we'll just throw them away 2014-04-01 15:55:48 -07:00
Piotr Sarnacki
2e0f9ed76e Revert "Don't remove trailing slash from PATH_INFO for mounted apps"
The revert is needed because of a regression described in #13369, routes
with trailing slash are no longer recognized properly.

This reverts commit 50311f1391.
2014-01-16 10:13:51 +01:00
Piotr Sarnacki
50311f1391 Don't remove trailing slash from PATH_INFO for mounted apps
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)
2013-06-21 08:56:19 +02:00
buddhamagnet
b3d7c41a99 make [] method in router more readable 2013-04-15 20:10:18 +01:00
Andrew White
90d2802b71 Add support for other types of routing constraints
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.
2013-01-15 17:21:33 +00:00
Francesco Rodriguez
eb493f5ac8 update AD::Journey to follow Rails coding conventions 2012-12-20 15:42:39 -05:00
Francesco Rodriguez
a36ae63d07 :nodoc: Journey because is not part of the public API [ci skip] 2012-12-19 19:24:25 -05:00
Andrew White
dc0542f809 Remove obsolete Hash extension needed for Ruby 1.8.x support
[ci skip]
2012-12-19 22:28:43 +00:00
Andrew White
56fee39c39 Integrate Journey into Action Dispatch
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.
2012-12-19 22:13:08 +00:00