aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/routing/route_set.rb
Commit message (Collapse)AuthorAgeFilesLines
...
* oops! :bomb:Aaron Patterson2014-07-291-1/+1
| | | | use helpers.include? so we don't get any false positives
* ask the named routes collection if the route is definedAaron Patterson2014-07-291-0/+4
| | | | | we should not be accessing internals to figure out if a method is defined.
* helpers should be a Set so it doesn't grow unboundedAaron Patterson2014-07-291-4/+12
| | | | | since helpers is a set, we can be confident about when to remove methods from the module.
* pass the module to define_named_route_methodsAaron Patterson2014-07-291-7/+7
| | | | after this, we can disconnect @module from the instance
* only ask for the routes module onceAaron Patterson2014-07-291-2/+4
| | | | we can cache the module on the stack, then reuse it
* eval_block should be privateAaron Patterson2014-07-291-0/+1
|
* remove the mounted? methodAaron Patterson2014-07-281-5/+1
| | | | | we know the routes should not be "optimized" when mounting an application
* pass the route name to define_url_helperAaron Patterson2014-07-171-21/+21
| | | | | this allows us to avoid 2 hash allocations per named helper definition, also we can avoid a `merge` and `delete`.
* use a strategy object for generating urls in named helpersAaron Patterson2014-07-171-13/+24
| | | | | | since we know that the route should be a path or fully qualified, we can pass a strategy object that handles generation. This allows us to eliminate an "if only_path" branch when generating urls.
* we do not need to dup the options hash, it is private and a new object each callAaron Patterson2014-07-161-2/+2
|
* extract inner options before delegating to the helperAaron Patterson2014-07-161-7/+13
| | | | | If we extract the options from the user facing method call ASAP, then we can simplify internal logic.
* RouteSet should be in charge of constructing the dispatherAaron Patterson2014-07-151-0/+4
| | | | Now we can override how requests are dispatched in the routeset object
* Remove unused param 'separators' from RouteSet#build_pathMindaugas MozĊĞras2014-06-151-2/+2
|
* pass the parsed path from mapper to the StrexpAaron Patterson2014-05-291-3/+6
|
* add an alternate constructor to Strexp that takes a stringAaron Patterson2014-05-291-1/+1
|
* PARAMETERS_KEY is only used in the request, so move the constant thereAaron Patterson2014-05-271-2/+0
|
* move path_parameter encoding check to the request objectAaron Patterson2014-05-271-10/+1
|
* dispatcher doesn't need `call` anymoreAaron Patterson2014-05-271-4/+0
|
* give all endpoints a superclassAaron Patterson2014-05-271-3/+10
|
* pass a request to `matches?` so we can avoid creating excess requestsAaron Patterson2014-05-251-1/+1
|
* push is_a?(Dispatcher) check in to one placeAaron Patterson2014-05-241-5/+3
|
* Always construct route objects with Constraint objectsAaron Patterson2014-05-241-1/+1
|
* unwrap the constraints object on initialization, eliminate loopsAaron Patterson2014-05-241-1/+1
| | | | | | | Unwrap Constraints objects. I don't actually think it's possible to pass a Constraints object to this constructor, but there were multiple places that kept testing children of this object. I *think* they were just being defensive, but I have no idea.
* glob_param is never used, so rmAaron Patterson2014-05-231-8/+2
| | | | | | this also changes the constructor. We don't need to pass more options than "defaults" (whatever defaults are, ugh. probably another hash of stupid stuff).
* decouple the router object from the request classAaron Patterson2014-05-231-2/+1
|
* pass the correct custom request to the recognize methodAaron Patterson2014-05-231-1/+1
|
* pull request allocation up one frameAaron Patterson2014-05-231-1/+3
|
* stop using PARAMETERS_KEY, and use the accessor on the request objectAaron Patterson2014-05-221-1/+0
| | | | this decouples our code from the env hash a bit.
* use symbol keys for path_parametersAaron Patterson2014-05-221-2/+2
|
* middle variable is never used, so rmAaron Patterson2014-05-211-1/+1
|
* remove dead code. @klass isn't used anymoreAaron Patterson2014-05-211-1/+0
|
* reuse path formatter from the non-optimized path.Aaron Patterson2014-05-211-6/+1
| | | | | The optimized and non-optimized path share more code now without significant performance degretation
* reduce object allocationsAaron Patterson2014-05-211-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Example: x = [1,2,3,4] y = [3,2,1] def test x, y hash = {} x.zip(y) { |k,v| hash[k] = v } hash end def test2 x, y Hash[x.zip(y)] end def test3 x, y x.zip(y).each_with_object({}) { |(k,v),hash| hash[k] = v } end def stat num start = GC.stat(:total_allocated_object) num.times { yield } total_obj_count = GC.stat(:total_allocated_object) - start puts "#{total_obj_count / num} allocations per call" end stat(100) { test(x,y) } stat(100) { test2(x,y) } stat(100) { test3(x,y) } __END__ 2 allocations per call 7 allocations per call 8 allocations per call
* we don't use this parameter for anything, so rmAaron Patterson2014-05-201-1/+1
|
* fewer hash allocations when calling url_forAaron Patterson2014-05-201-9/+12
|
* fix variable names, only pass hashes to the positional args methodAaron Patterson2014-05-201-8/+10
|
* Only path requirements are relevant to optimized urlsAndrew White2014-05-151-1/+1
| | | | | The bit of URL generation that is optimized is the generation of the path so things like :host, :port, etc. are irrelevant.
* Add missing requires for require 'action_dispatch/routing'Andrew White2014-05-151-0/+2
|
* _recall should be set to a hash or not setAaron Patterson2014-05-131-2/+2
| | | | Then we can avoid nil checks
* we never call url_for with a block, so rmAaron Patterson2014-05-131-1/+0
|
* drop || test for cases that do not need itAaron Patterson2014-05-131-3/+3
|
* no need to check for presence, script names can be blankAaron Patterson2014-05-131-2/+2
|
* this method should always have a parameter passed to it, so remove the defaultAaron Patterson2014-05-131-1/+1
|
* options should always be passed to url_forAaron Patterson2014-05-131-2/+2
|
* calls with :host should still use the optimized pathAaron Patterson2014-05-131-2/+2
|
* use fewer method calls to determine the url_for optionsAaron Patterson2014-05-131-5/+4
|
* just merge instead of dup and mergeAaron Patterson2014-05-131-2/+1
|
* the :only_path option is applied by the time the helper is calledAaron Patterson2014-05-131-4/+1
|
* options already have symbolized keys, so we can avoid this callAaron Patterson2014-05-131-1/+1
|
* Get rid of unused methodCarlos Antonio da Silva2014-05-131-11/+0
| | | | It's usage has been removed in 325c9d5e5235db4b5210d9db6c863835d1ac7eed.