Commit message (Collapse) | Author | Age | Files | Lines | ||
---|---|---|---|---|---|---|
... | ||||||
* | Fix request's path_info when a rack app mounted at '/'. | Larry Lv | 2014-06-14 | 1 | -0/+1 | |
| | | | | Fixes issue #15511. | |||||
* | no more is_a checks on instantiation | Aaron Patterson | 2014-05-29 | 1 | -9/+4 | |
| | ||||||
* | Path::Pattern is instantiated internally, so make the contructor require a ↵ | Aaron Patterson | 2014-05-29 | 1 | -7/+6 | |
| | | | | strexp object | |||||
* | Strexp#names is only used in a test, so rm | Aaron Patterson | 2014-05-29 | 1 | -4/+0 | |
| | ||||||
* | add an alternate constructor to Strexp that takes a string | Aaron Patterson | 2014-05-29 | 1 | -7/+9 | |
| | ||||||
* | ask the strexp for the ast | Aaron Patterson | 2014-05-29 | 2 | -3/+7 | |
| | ||||||
* | use a parser to extract the group parts from the path | Aaron Patterson | 2014-05-29 | 1 | -0/+4 | |
| | ||||||
* | Merge branch 'constraints' | Aaron Patterson | 2014-05-27 | 2 | -10/+2 | |
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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 application | Aaron Patterson | 2014-05-25 | 1 | -1/+1 | |
| | | ||||||
| * | push is_a?(Dispatcher) check in to one place | Aaron Patterson | 2014-05-24 | 1 | -9/+1 | |
| | | ||||||
* | | Merge pull request #15321 from ↵ | Santiago Pastorino | 2014-05-27 | 1 | -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 Tan | 2014-05-25 | 1 | -1/+4 | |
| |/ | ||||||
* / | Remove unnecessary flatten! method call. | Guo Xiang Tan | 2014-05-25 | 1 | -3/+1 | |
|/ | ||||||
* | unwrap the constraints object on initialization, eliminate loops | Aaron Patterson | 2014-05-24 | 1 | -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. | |||||
* | Fix router visualizer CSS and JS resources | Franco Catena | 2014-05-23 | 1 | -2/+2 | |
| | ||||||
* | there is no formatter on the router object, so rm | Aaron Patterson | 2014-05-23 | 1 | -1/+0 | |
| | ||||||
* | Merge pull request #15273 from DNNX/formatter-refactoring-4 | Rafael Mendonça França | 2014-05-23 | 1 | -5/+0 | |
|\ | | | | | Remove AD::Journey::Formatter#verify_required_parts! | |||||
| * | Remove AD::Journey::Formatter#verify_required_parts! | Viktar Basharymau | 2014-05-23 | 1 | -5/+0 | |
| | | | | | | | | | | Nobody uses this private method, maybe it is a leftover from some old refactoring. Let's delete it. | |||||
* | | decouple the router object from the request class | Aaron Patterson | 2014-05-23 | 1 | -5/+3 | |
| | | ||||||
* | | pass the correct custom request to the recognize method | Aaron Patterson | 2014-05-23 | 1 | -3/+1 | |
| | | ||||||
* | | switch to the `serve` method so we can remove the request class (eventually) | Aaron Patterson | 2014-05-23 | 1 | -6/+0 | |
| | | ||||||
* | | extract request allocation from the main app serving routine | Aaron Patterson | 2014-05-23 | 1 | -2/+4 | |
| | | ||||||
* | | use the accessors on the request object rather than touching env | Aaron Patterson | 2014-05-23 | 1 | -2/+2 | |
| | | ||||||
* | | find_routes only use the request, so stop passing env | Aaron Patterson | 2014-05-23 | 1 | -3/+3 | |
| | | ||||||
* | | remove NullRequest and just always pass a request class | Aaron Patterson | 2014-05-23 | 1 | -26/+1 | |
| | | ||||||
* | | use the request object since we have it | Aaron Patterson | 2014-05-23 | 1 | -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 object | Aaron Patterson | 2014-05-22 | 1 | -6/+6 | |
| | | | | this decouples our code from the env hash a bit. | |||||
* | pass the instantiated request to the find_routes method | Aaron Patterson | 2014-05-22 | 1 | -5/+7 | |
| | ||||||
* | Merge pull request #15254 from DNNX/formatter-refactoring-3 | Rafael Mendonça França | 2014-05-22 | 1 | -4/+4 | |
|\ | | | | | Rename `stack` to `queue` | |||||
| * | Rename `stack` to `queue` | Viktar Basharymau | 2014-05-22 | 1 | -4/+4 | |
| | | | | | | | | | | | | | | Because it is used as a queue (FIFO), not as a stack (LIFO). * http://en.wikipedia.org/wiki/Stack_(abstract_data_type) * http://en.wikipedia.org/wiki/Queue_(data_structure) | |||||
* | | Merge pull request #15252 from DNNX/formatter-refactoring-2 | Rafael Mendonça França | 2014-05-22 | 1 | -1/+1 | |
|\ \ | | | | | | | Remove unnecessary `Hash#to_a` call | |||||
| * | | Remove unnecessary `Hash#to_a` call | Viktar Basharymau | 2014-05-22 | 1 | -1/+1 | |
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Inspired by https://github.com/rails/rails/commit/931ee4186b877856b212b0085cd7bd7f6a4aea67 ```ruby 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 h = { 'x' => 'y' } stat(100) { h. each { |pair| pair } } stat(100) { h.to_a.each { |pair| pair } } __END__ 1 allocations per call 2 allocations per call ``` | |||||
* / | Use `break` instead of `next` in AD::Journey::Formatter#match_route | Viktar Basharymau | 2014-05-22 | 1 | -1/+1 | |
|/ | | | | | | The array is sorted in descending order, so there is no point in iterating further if we met a negative item - all the rest will be negative too. | |||||
* | drop hash allocations during match | Aaron Patterson | 2014-05-21 | 1 | -2/+2 | |
| | ||||||
* | fewer object allocations and method calls during route match | Aaron Patterson | 2014-05-21 | 1 | -5/+5 | |
| | ||||||
* | middle variable is never used, so rm | Aaron Patterson | 2014-05-21 | 1 | -1/+1 | |
| | ||||||
* | reuse path formatter from the non-optimized path. | Aaron Patterson | 2014-05-21 | 2 | -33/+2 | |
| | | | | | The optimized and non-optimized path share more code now without significant performance degretation | |||||
* | make variable name more clear | Aaron Patterson | 2014-05-21 | 1 | -2/+2 | |
| | ||||||
* | do not mutate parameters, let the caller do mutations | Aaron Patterson | 2014-05-21 | 2 | -4/+6 | |
| | ||||||
* | push the formatter up to the Route object | Aaron Patterson | 2014-05-21 | 2 | -4/+4 | |
| | ||||||
* | we don't use this parameter for anything, so rm | Aaron Patterson | 2014-05-20 | 1 | -1/+1 | |
| | ||||||
* | remove dead code | Aaron Patterson | 2014-05-20 | 1 | -57/+0 | |
| | ||||||
* | cache the formatter on the path object | Aaron Patterson | 2014-05-20 | 2 | -2/+6 | |
| | ||||||
* | translate AST to a formatter before url generation | Aaron Patterson | 2014-05-20 | 2 | -1/+72 | |
| | ||||||
* | prepopulate the dispatch cache so we don't need the ThreadSafe cache. | Aaron Patterson | 2014-05-20 | 1 | -7/+9 | |
| | ||||||
* | make the each visitor top-down left-right | Aaron Patterson | 2014-05-20 | 1 | -1/+1 | |
| | ||||||
* | make the AST go from left to right, rather than right to left | Aaron Patterson | 2014-05-19 | 2 | -45/+48 | |
| | ||||||
* | fix escaping in generation | Aaron Patterson | 2014-05-19 | 1 | -1/+7 | |
| | ||||||
* | Revert "Rewrite journey routes formatter for performance" | Aaron Patterson | 2014-05-19 | 1 | -28/+23 | |
| | | | | | | | | | | This reverts commit 5c224de9e110763ec7a0f01f5b604bcf81f40bfb. Conflicts: actionpack/lib/action_dispatch/journey/visitors.rb 5c224de9e110763ec7a0f01f5b604bcf81f40bfb introduced a bug in the formatter. This commit includes a regression test. | |||||
* | Make URL escaping more consistent | Andrew White | 2014-04-20 | 3 | -4/+30 | |
| | | | | | | | | | | | | | | | | | | | | | | 1. Escape '%' characters in URLs - only unescaped data should be passed to URL helpers 2. Add an `escape_segment` helper to `Router::Utils` that escapes '/' characters 3. Use `escape_segment` rather than `escape_fragment` in optimized URL generation 4. Use `escape_segment` rather than `escape_path` in URL generation For point 4 there are two exceptions. Firstly, when a route uses wildcard segments (e.g. *foo) then we use `escape_path` as the value may contain '/' characters. This means that wildcard routes can't be optimized. Secondly, if a `:controller` segment is used in the path then this uses `escape_path` as the controller may be namespaced. Fixes #14629, #14636 and #14070. |