aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/journey
Commit message (Collapse)AuthorAgeFilesLines
* Fix array routing constraintsfatkodima2018-02-171-2/+2
|
* Write the code in a more natural way.Rafael Mendonça França2018-02-161-2/+2
|
* PERF: reduce retained objects in JourneySam2018-02-161-2/+2
| | | | | | | | | | | | | | | | | | | | Before: Total allocated: 209050523 bytes (2219202 objects) Total retained: 36580305 bytes (323462 objects) After: Total allocated: 209180253 bytes (2222455 objects) Total retained: 36515599 bytes (321850 objects) --- Modest saving of 1612 RVALUEs in the heap on Discourse boot The larger the route file the better the results. Saving will only be visible on Ruby 2.5 and up.
* correct the dedup codeSam2018-02-151-3/+3
|
* Revert "Revert "Merge pull request #31999 from SamSaffron/patch-1""Rafael Mendonça França2018-02-151-4/+11
| | | | This reverts commit f282f3758d31e8445d0854e2ae7a67f17cede3bc.
* Revert "Merge pull request #31999 from SamSaffron/patch-1"Rafael Mendonça França2018-02-151-11/+4
| | | | | | | This reverts commit 9f65d2a08bc80a94bbb2c0b6e00957c7059aed25, reversing changes made to 966843732a607864b077b72b2a17168d4e3548cc. This broken a lot of tests.
* PERF: dedupe scanned route fragmentsSam2018-02-151-4/+11
| | | | | | | | | | | | | | | | | | | | Per: https://bugs.ruby-lang.org/issues/13077 String @- will dedupe strings. This takes advantage of this by deduping route fragments that are full of duplication usually. For Discourse: Before: Total allocated: 207574305 bytes (2214916 objects) Total retained: 36470010 bytes (322194 objects) After Total allocated: 207556847 bytes (2214711 objects) Total retained: 36327973 bytes (318627 objects) <- object that GC can not collect So we save 3500 or so RVALUES this way, not the largest saving in the world, but worth it especially for large route files.
* 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