Commit message (Collapse) | Author | Age | Files | Lines | ||
---|---|---|---|---|---|---|
... | ||||||
* | | 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. | |||||
* | Optimize URI escaping | Andrew White | 2014-04-20 | 1 | -17/+42 | |
| | | | | | | | | | | | | | The URI::Parser#escape method is a general use method that has to deal with a variety of input however our use of it is limited in scope so we can increase the performance by implementing our specific needs within ActionDispatch::Journey::Router::Utils directly. If there is no encoding required then there is no change in performance or number of objects allocated, but for each character that needs to be encoded we save five object allocations and gain a performance boost. The performance boost seen varies from 20% when there is one character to over 50% when encoding ten characters. | |||||
* | Always escape string passed to url helper. | edogawaconan | 2014-04-20 | 1 | -1/+1 | |
| | | | | | | | | | | Makes it clear that anything passed with the helper must not be percent encoded. Fixes previous behavior which tricks people into believing passing non-percent-encoded will generate a proper percent-encoded path while in reality it doesn't ('%' isn't escaped). The intention is nice but the heuristic is broken. | |||||
* | push move_string in to `move` | Aaron Patterson | 2014-04-01 | 1 | -14/+12 | |
| | ||||||
* | combine move_regexp and move_string so we only loop over states once | Aaron Patterson | 2014-04-01 | 1 | -9/+6 | |
| | ||||||
* | do not create memo objects since we'll just throw them away | Aaron Patterson | 2014-04-01 | 2 | -9/+11 | |
| | ||||||
* | only ask if `t` is empty once. | Aaron Patterson | 2014-04-01 | 1 | -4/+1 | |
| | ||||||
* | Replace map.flatten with flat_map in actionpack | Erik Michaels-Ober | 2014-03-03 | 7 | -18/+18 | |
| | ||||||
* | Replace map.flatten(1) with flat_map | Erik Michaels-Ober | 2014-02-28 | 2 | -5/+5 | |
| | ||||||
* | Revert "Don't remove trailing slash from PATH_INFO for mounted apps" | Piotr Sarnacki | 2014-01-16 | 1 | -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. | |||||
* | Show full route constraints in error message | Andrew White | 2014-01-05 | 1 | -2/+2 | |
| | | | | | | | | When an optimized helper fails to generate, show the full route constraints in the error message. Previously it would only show the contraints that were required as part of the path. Fixes #13592 |