| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
This method was copied from journey at https://github.com/rails/rails/commit/56fee39c392788314c44a575b3fd66e16a50c8b5#diff-2cfaf53c860732fea8689d6f2002594bR78.
`grep -nr 'optional_parts' .`
|
|
|
|
| |
This method wass copied from journey at https://github.com/rails/rails/commit/56fee39c392788314c44a575b3fd66e16a50c8b5#diff-d89de8881fc4b9f10cb3e4fc7b2463f3R53. However it looks the method was unused in journey at those point as well.
|
|\
| |
| | |
Fix OR in Journey patterns
|
| | |
|
|/ |
|
| |
|
|
|
|
|
|
|
|
|
| |
If the route set is empty, or if none of the routes matches with a score > 0,
there is no point showing the deprecation message because we are already be
raising the `ActionController::UrlGenerationError` mentioned in the warning.
In this case it is the expected behavior and the user wouldn't have to take any
actions.
|
|
|
|
|
|
|
|
| |
The internal tests that (incorrectly) relied on this were already fixed in
938d130. However, we cannot simply fix this bug because the guides prior to
b7b9e92 recommended a workaround that relies on this buggy behavior.
Reference #17453
|
| |
|
|
|
|
|
| |
`#tr` is more efficient than `#gsub` and can be used as a drop in
replacement in this context.
|
|
|
|
|
|
|
|
|
|
| |
The scanner in Journey fails to recognize routes that use literals
from the sub-delims section of RFC 3986.
This commit enhance the compatibility of Journey with the RFC by
adding support of authorized delimiters to the scanner.
Fix #17212
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
| |
Previously the generated parser had an intermediate local variable
`result` that really useful if you're building up a stateful object but
Journey always discards the result argument to the reduce functions.
This produces a simpler parser for anybody who actually wants to read
the thing.
Sadly, there's no real performance speedup with this change.
|
|
|
|
|
|
|
|
| |
"recall" is a terrible name. This variable contains the parameters that
we got from the path (e.g. for "/posts/1" it has :controller => "posts",
:id => "1"). Since it contains the parameters we got from the path,
"path_parameters" is a better name. We always pass path_parameters to
`generate`, so lets make it required.
|
|
|
|
|
|
|
|
|
| |
Because URI paths may contain non US-ASCII characters we need to force
the encoding of any unescaped URIs to UTF-8 if they are US-ASCII.
This essentially replicates the functionality of the monkey patch to
URI.parser.unescape in active_support/core_ext/uri.rb.
Fixes #16104.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Fixes issue #15511.
|
| |
|
|
|
|
| |
strexp object
|
| |
|
| |
|
| |
|
| |
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* 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
|
| | |
|
| | |
|
|\ \
| | |
| | |
| | |
| | | |
tgxworld/only_find_routes_as_heads_for_head_request
Call get_routes_as_head only on HEAD requests.
|
| |/ |
|
|/ |
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|\
| |
| | |
Remove AD::Journey::Formatter#verify_required_parts!
|
| |
| |
| |
| |
| | |
Nobody uses this private method, maybe it is a leftover from some old
refactoring. Let's delete it.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
|/
|
|
|
| |
stop hardcoding hash keys and use the accessors provided on the request
object.
|
|
|
|
| |
this decouples our code from the env hash a bit.
|
| |
|
|\
| |
| | |
Rename `stack` to `queue`
|
| |
| |
| |
| |
| |
| |
| | |
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)
|
|\ \
| | |
| | | |
Remove unnecessary `Hash#to_a` call
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
```
|
|/
|
|
|
|
| |
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.
|