aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/journey
Commit message (Collapse)AuthorAgeFilesLines
* Enable `Layout/LeadingCommentSpace` to not allow cosmetic changes in the futureRyuta Kamizono2017-12-141-10/+10
| | | | Follow up of #31432.
* removed unnecessary returnsShuhei Kitagawa2017-10-281-1/+1
|
* [Action Pack] require => require_relativeAkira Matsuda2017-10-219-16/+16
| | | | | This basically reverts e9fca7668b9eba82bcc832cb0061459703368397, d08da958b9ae17d4bbe4c9d7db497ece2450db5f, d1fe1dcf8ab1c0210a37c2a78c1ee52cf199a66d, and 68eaf7b4d5f2bb56d939f71c5ece2d61cf6680a3
* Update links to use https link instead of http [ci skip]Yoshiyuki Hirano2017-08-221-1/+1
|
* Path parameters should default to UTF8eileencodes2017-08-011-1/+6
| | | | | | | | | | | | | | | | | | | | This commit changes the behavior such the path_params now default to UTF8 just like regular parameters. This also changes the behavior such that if a path parameter contains invalid UTF8 it returns a 400 bad request. Previously the behavior was to encode the path params as binary but that's not the same as query params. So this commit makes path params behave the same as query params. It's important to test with a path that's encoded as binary because that's how paths are encoded from the socket. The test that was altered was changed to make the behavior for bad encoding the same as query params. We want to treat path params the same as query params. The params in the test are invalid UTF8 so they should return a bad request. Fixes #29669 *Eileen M. Uchitelle, Aaron Patterson, & Tsukuru Tanimichi*
* Use frozen string literal in actionpack/Kir Shatrov2017-07-2914-1/+29
|
* normalize_path used to be nil tolerantAkira Matsuda2017-07-121-0/+1
| | | | fixes a regression introduced at 8607c25ba7810573733d9b37d0015154ba059f5e
* [Action Pack] `rubocop -a --only Layout/EmptyLineAfterMagicComment`Koichi ITO2017-07-113-0/+3
|
* Prepare AP and AR to be frozen string friendlyKir Shatrov2017-07-062-3/+5
|
* Merge branch 'master' into require_relative_2017Xavier Noria2017-07-021-3/+3
|\
| * Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-0216-16/+0
| | | | | | | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
| * Merge pull request #29540 from kirs/rubocop-frozen-stringMatthew Draper2017-07-0216-0/+16
| |\ | | | | | | | | | Enforce frozen string in Rubocop
| | * Enforce frozen string in RubocopKir Shatrov2017-07-0116-0/+16
| | |
| * | Make ActionView frozen string literal friendly.Pat Allan2017-06-201-1/+1
| | | | | | | | | | | | Plus a couple of related ActionPack patches.
| * | Make ActionMailer frozen string literal friendly.Pat Allan2017-06-201-1/+1
| | |
| * | Make ActiveModel frozen string literal friendly.Pat Allan2017-06-201-1/+1
| |/ | | | | | | Includes two external changes because they're referenced within the ActiveModel test suite.
* / [Action Dispatch] require => require_relativeAkira Matsuda2017-07-019-16/+16
|/
* Merge pull request #29191 from ↵Kasper Timm Hansen2017-05-291-5/+5
|\ | | | | | | | | bogdanvlviv/pass_params_filename_lineno_to_class_eval Pass params __FILE__ and __LINE__ + 1 if class_eval with <<
| * Pass params __FILE__ and __LINE__ + 1 if class_eval with <<bogdanvlviv2017-05-291-5/+5
| |
* | Merge pull request #29176 from bogdanvlviv/define-path-with__dir__Matthew Draper2017-05-261-1/+1
|\ \ | |/ |/| Define path with __dir__
| * Define path with __dir__bogdanvlviv2017-05-231-1/+1
| | | | | | | | | | | | ".. with __dir__ we can restore order in the Universe." - by @fxn Related to 5b8738c2df003a96f0e490c43559747618d10f5f
* | Remove unused simulate methodeileencodes2017-05-221-8/+0
|/ | | | | | This method was only used in the Rails tests and not by other methods in the Rails simulator. Because it's a no-doc'd class it should be safe to remove without deprecation.
* Maintain original encoding from patheileencodes2017-05-121-0/+2
| | | | | | | | | When the path info is read from the socket it's encoded as ASCII 8BIT. The unescape method changes the encoding to UTF8 but it should maintain the encoding of the string that's passed in. This causes parameters to be force encoded to UTF8 when we don't actually know what the encoding of the parameter should be.
* Remove `:doc:` in `:nodoc:` class [ci skip]Ryuta Kamizono2017-05-011-2/+2
| | | | | The `:doc:` was added in bc478158 but originally `UriEncoder` is a `:nodoc:` class.
* Add periodJon Moss2017-04-301-1/+1
| | | | [ci skip]
* Add docs for Router::Utils.unescape_uri methoddixpac2017-04-301-0/+4
|
* [docs] fix ActionDispatch documentationHrvoje Šimić2017-03-135-5/+11
|
* Correct spellingBenjamin Fleischer2017-02-051-1/+1
| | | | | | | ``` go get -u github.com/client9/misspell/cmd/misspell misspell -w -error -source=text . ```
* Merge pull request #27647 from Shopify/fully-eagerload-journeyRafael França2017-01-303-0/+22
|\ | | | | Fully initialize routes before the first request is handled
| * Fully initialize routes before the first request is handledJean Boussier2017-01-183-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | `AD::Journey::GTG::Simulator` is lazily built the first time `Journey::Router#find_routes` is invoked, which happens when the first request is served. On large applications with many routes, building the simulator can take several hundred milliseconds (~700ms for us). Triggering this initialization during the boot process reduces the impact of deploys on the application response time.
* | class Foo < Struct.new(:x) creates an extra unneeded anonymous classAkira Matsuda2017-01-131-1/+1
|/ | | | because Struct.new returns a Class, we just can give it a name and use it directly without inheriting from it
* Use `next` instead of `break`; avoid terminating whole loopJon Moss2016-12-291-1/+1
| | | | | | | | | | | | | | We want to avoid terminating the whole loop here, because it will cause parameters that should be removed to not be removed, since we are terminating early. In this specific case, `param2` is processed before `param1` due to the reversing of `route.parts`, and since `param2` fails the check on this line, it would previously cause the whole loop to fail, and `param1` would still be in `parameterized_parts`. Now, we are simply calling `next`, which is the intended behavior. Introduced by 8ca8a2d773b942c4ea76baabe2df502a339d05b1. Fixes #27454.
* Optimize Journey::Route#scoreBen Hughes2016-12-282-5/+14
| | | | | | | | Scoring routes based on constraints repeated many type conversions that could be performed in the outer loop. Determinations of score and fitness also used Array operations that required allocations. Against my benchmark with a large routeset, this reduced object allocations by over 30x and wall time by over 3x.
* Shave a couple of allocations off Journey scan & parseMatthew Draper2016-12-253-203/+207
|
* Privatize unneededly protected methods in Action PackAkira Matsuda2016-12-241-3/+3
|
* Add more rubocop rules about whitespacesRafael Mendonça França2016-10-298-12/+12
|
* Fix :stopdoc: to :startdoc: [ci skip]Ryuta Kamizono2016-10-281-1/+1
|
* Remove all Journey constant from public APIRafael Mendonça França2016-10-265-7/+17
| | | | | | There were never public API only there by mistake. [ci skip]
* Show an "unmatched constraints" error for mismatching and present paramsChris Carter2016-10-031-1/+5
| | | | | | | | | | | | Currently a misleading "missing required keys" error is thrown when a param fails to match the constraints of a particular route. This commit ensures that these params are recognised as unmatching rather than missing. Note: this means that a different error message will be provided between optimized and non-optimized path helpers, due to the fact that the former does not check constraints when matching routes. Fixes #26470.
* Fix broken comments indentation caused by rubocop auto-correct [ci skip]Ryuta Kamizono2016-09-141-11/+11
| | | | | | All indentation was normalized by rubocop auto-correct at 80e66cc4d90bf8c15d1a5f6e3152e90147f00772. But comments was still kept absolute position. This commit aligns comments with method definitions for consistency.
* Fix broken heredoc indentation caused by rubocop auto-correctRyuta Kamizono2016-09-031-1/+1
| | | | | | All indentation was normalized by rubocop auto-correct at 80e66cc4d90bf8c15d1a5f6e3152e90147f00772. But heredocs was still kept absolute position. This commit aligns heredocs indentation for consistency.
* Merge pull request #26156 from sfaxon/route_visualizer_fixRafael França2016-08-161-1/+3
|\ | | | | fix Rails.application.routes.router.visualizer for router debugging
| * fix Rails.application.routes.router.visualizer for router debuggingSeth Faxon2016-08-131-1/+3
| | | | | | | | fixes error due to Routes#partitioned_routes being removed
* | Add three new rubocop rulesRafael Mendonça França2016-08-163-4/+4
|/ | | | | | | | Style/SpaceBeforeBlockBraces Style/SpaceInsideBlockBraces Style/SpaceInsideHashLiteralBraces Fix all violations in the repository.
* revises more Lint/EndAlignment offensesXavier Noria2016-08-081-2/+2
|
* Add `Style/EmptyLines` in `.rubocop.yml` and remove extra empty linesRyuta Kamizono2016-08-071-1/+0
|
* applies remaining conventions across the projectXavier Noria2016-08-065-6/+4
|
* normalizes indentation and whitespace across the projectXavier Noria2016-08-064-173/+173
|
* remove redundant curlies from hash argumentsXavier Noria2016-08-061-1/+1
|
* modernizes hash syntax in actionpackXavier Noria2016-08-061-1/+1
|