aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* drop object allocation during routes setupAaron Patterson2015-08-172-44/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit introduces a functional Path AST visitor and implements `each` on the AST in terms of the functional visitor. The functional visitor doesn't maintain state, so we only need to allocate one of them. Given this benchmark route file: ```ruby require 'action_pack' require 'action_dispatch' route_set = ActionDispatch::Routing::RouteSet.new routes = ActionDispatch::Routing::Mapper.new route_set ObjectSpace::AllocationTracer.setup(%i{path line type}) result = ObjectSpace::AllocationTracer.trace do 500.times{|i| routes.resource :omglol } end result.find_all { |k,v| k.first =~ /git\/rails/ }.sort_by { |k,v| v.first }.each { |k,v| p k => v } ``` node.rb line 17 was in our top 3 allocation spot: ``` {["/Users/aaron/git/rails/actionpack/lib/action_dispatch/journey/nodes/node.rb", 17, :T_OBJECT]=>[31526, 0, 28329, 0, 2, 1123160]} {["/Users/aaron/git/rails/actionpack/lib/action_dispatch/routing/mapper.rb", 2080, :T_IMEMO]=>[34002, 0, 30563, 0, 2, 1211480]} {["/Users/aaron/git/rails/actionpack/lib/action_dispatch/routing/mapper.rb", 2071, :T_IMEMO]=>[121934, 1, 109608, 0, 7, 4344400]} ``` This commit eliminates allocations at that place.
* avoid is_a? checksAaron Patterson2015-08-172-2/+4
| | | | add another predicate method so we can avoid is_a checks
* pull RegexpOffsets in to a methodAaron Patterson2015-08-171-27/+14
| | | | we don't really need this visitor
* `required_defaults` is always passed in, remove conditionalAaron Patterson2015-08-171-1/+1
| | | | | Routes are always constructed with a list of required_defaults, so there's no need to check whether or not it's nil
* Merge pull request #21276 from rodzyn/fix_buildRafael Mendonça França2015-08-171-0/+1
|\ | | | | Fix master build
| * Fix master buildMarcin Olichwirowicz2015-08-171-0/+1
|/
* Merge pull request #21273 from piton4eg/patch-6Robin Dupret2015-08-171-6/+5
|\ | | | | Small fixes [ci skip]
| * Small fixes [ci skip]Alexey Markov2015-08-171-6/+5
| |
* | use predicate methods to avoid is_a? checksAaron Patterson2015-08-172-1/+3
| | | | | | | | | | we may want to change the name of the class at some point, so it's better to use a predicate
* | default pattern to use a joined stringAaron Patterson2015-08-174-16/+20
|/ | | | | The string we create is almost always the same, so rather than joining all the time, lets join once, then reuse that string everywhere.
* Merge pull request #21270 from jonatack/update-debugging-guide-byebug-infoKasper Timm Hansen2015-08-171-17/+6
|\ | | | | Update the Debugging Rails Guide [skip ci]
| * Update the Debugging Rails GuideJon Atack2015-08-171-17/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | [skip ci]. - Update to the current output when running `byebug help`. - Remove the alias `exit` because it does not work and seems to have been removed from Byebug, as confirmed by the source code here: https://github.com/deivid-rodriguez/byebug/blob/master/lib/byebug/comman ds/quit.rb - Added the useful `q!` instead to avoid the "Really quit? (y/n)" prompt.
* | Merge pull request #21244 from ronakjangir47/method_call_assertions_fixKasper Timm Hansen2015-08-172-1/+7
|\ \ | | | | | | Replacing lambda with proc getting argument error because of it.
| * | Replacing lambda with proc getting argument error because of it.Ronak Jangir2015-08-172-1/+7
| | |
* | | Merge pull request #21272 from amitsuroliya/fix_docsArun Agrawal2015-08-171-1/+1
|\ \ \ | | | | | | | | fix Docs [ci skip]
| * | | fix Docs [ci skip]amitkumarsuroliya2015-08-181-1/+1
|/ / /
* | | Merge pull request #21271 from amitsuroliya/typo_fixRichard Schneeman2015-08-171-2/+2
|\ \ \ | | | | | | | | typo fix [ci skip]
| * | | typo fix [ci skip]amitkumarsuroliya2015-08-181-2/+2
|/ / /
* | | Merge pull request #21252 from rodzyn/improve_params_parserRafael Mendonça França2015-08-171-2/+11
|\ \ \ | | | | | | | | Improve params parser
| * | | Cleanup ActionDispatch:ParamsParserMarcin Olichwirowicz2015-08-171-2/+11
| | | |
* | | | reorganize testing guide. [Zachary Scott & Yves Senn]Zachary Scott2015-08-171-329/+305
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ci skip] Better reading flow for the information presented in this guide. The first part is written in a similar fashion as the "Getting Started Guide" and can be read from start to finish. The second section introduces the different testing components that Rails provides and explains how and when to use them. The guide is still work in progress.
* | | | Merge pull request #21264 from jonatack/fix-action-controller-strong-params-typoRafael Mendonça França2015-08-171-1/+1
|\ \ \ \ | |_|_|/ |/| | | [skip ci] Fix minor typo
| * | | [skip ci] Fix minor typoJon Atack2015-08-171-1/+1
|/ / /
* | | Merge pull request #21263 from printercu/patch-1Rafael Mendonça França2015-08-171-1/+2
|\ \ \ | | | | | | | | Fixed syslog example in production config template
| * | | Fixed syslog example in production config templateprintercu2015-08-171-1/+2
|/ / /
* | | Merge pull request #21135 from DropsOfSerenity/masterSean Griffin2015-08-176-19/+83
|\ \ \ | | | | | | | | make disable_with default in submit_tag
| * | | Make disable_with default in submit_tagJustin Schiff2015-08-116-19/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prevents double submission by making disable_with the default. Default disable_with option will only be applied if user has not specified her/his own disable_with option, whether that is in the `data-disable-with` string form or the `:data => { :disable_with => "Saving..." }` hash form. disable_with will default to the value attribute. A configuration option was added to opt out of this functionality if the user so desires. `config.action_view.automatically_disable_submit_tag = false`
* | | | Merge pull request #21258 from unfunco/plugin-semver-updateGuillermo Iguaran2015-08-163-4/+9
|\ \ \ \ | | | | | | | | | | Plugins are generated with the version 0.1.0
| * | | | Updated tests for the generated version number changeDaniel Morris2015-08-161-3/+3
| | | | |
| * | | | Plugins are generated with the version 0.1.0Daniel Morris2015-08-162-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The semantic versioning specification uses MAJOR.MINOR.PATCH – it would make more sense to set the version to 0.1.0 for initial development since a patch release cannot be created before a minor feature release.
* | | | | Fix typo on method nameRafael Mendonça França2015-08-161-3/+3
|/ / / / | | | | | | | | | | | | [Robin Dupret]
* | | | Merge pull request #21253 from ↵Claudio B.2015-08-161-0/+1
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | vincefrancesi/date-helper-use-hidden-documentation Documentation for ActionView::Helpers::DateHelper :use_hidden option
| * | | | Add documentation for ActionView::Helpers::DateHelper :use_hidden option [ci ↵Vince Francesi2015-08-151-0/+1
| | |/ / | |/| | | | | | | | | | skip]
* | | | Add a changelog entry for #21124 [ci skip]Robin Dupret2015-08-161-0/+6
| | | | | | | | | | | | | | | | [Kir Shatrov & Robin Dupret]
* | | | Tiny documentation fixes [ci skip]Robin Dupret2015-08-162-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | * Add missing `def` and remove useless `do` keywords. * Move `:nodoc:` in front of the methods' definition so that methods under these ones are correctly visible on the API.
* | | | move route allocation to a factory method on the mapping objectAaron Patterson2015-08-152-8/+13
| | | | | | | | | | | | | | | | | | | | | | | | I would like to change the signature of the Route constructor. Since the mapping object has all the data required to construct a Route object, move the allocation to a factory method.
* | | | use the mapper to build the routing tableAaron Patterson2015-08-152-231/+103
| | | | | | | | | | | | | | | | | | | | | | | | We should build the routes using the user facing API which is `Mapper`. This frees up the library internals to change as we see fit. IOW we shouldn't be testing internals.
* | | | only process `via` onceAaron Patterson2015-08-151-5/+3
| | | | | | | | | | | | | | | | | | | | we can directly turn it in to a regular expression here, so we don't need to test its value twice
* | | | Fix test assign_parameter method signatureeileencodes2015-08-151-1/+1
|/ / / | | | | | | | | | | | | | | | | | | | | | Oops, I broke the build :( Fixes the method signature of `assign_parameters` which now takes 6 arguments instead of 4. We likely will end up chaning the method signature further so good to know this test is here.
* | | Refactor how assign_parameters sets generated_path & query_string_keyseileencodes2015-08-151-8/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is part of a larger refactoring on controller tests. We needed to move these methods here so that we could get rid of the `|| key == :action || key == :controller` in `assign_parameters`. We know this is ugly and intend to fix it but for now `generate_extras` needs to be used in the two methods to access the path and the query_string_keys. We're adding `:controller` and `:action` to the `query_string_keys` because we always need a controller and action. If someone passed `action` or `controller` in in there test they are unambigious - we know they have to go into the query params.
* | | Merge pull request #21248 from y-yagi/fix_deprecation_warning_in_aj_testRafael Mendonça França2015-08-151-1/+1
|\ \ \ | | | | | | | | use `average_scheduled_poll_interval` option instead of deprecated `poll_interval`
| * | | use `average_scheduled_poll_interval` option instead of deprecated ↵yuuji.yaginuma2015-08-151-1/+1
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | `poll_interval` this removes the following warning: ``` DEPRECATION: `config.poll_interval = 0.5` will be removed in Sidekiq 4. Please update to `config.average_scheduled_poll_interval = 0.5`. ```
* | | Merge pull request #21247 from maclover7/rdoc-to-mdRafael Mendonça França2015-08-151-37/+47
|\ \ \ | | | | | | | | Convert Releasing Rails guide to Markdown
| * | | Convert Releasing Rails guide to Markdownmaclover72015-08-151-37/+47
| |/ /
* | | Merge pull request #21249 from rodzyn/initialize_symbolsRafael Mendonça França2015-08-151-2/+2
|\ \ \ | |/ / |/| | Initialize symbols instead of mapping to_sym on the set of strings
| * | Initialize symbols instead of mapping to_sym on the set of stringsMarcin Olichwirowicz2015-08-151-2/+2
|/ /
* | only keep one hash of named routesAaron Patterson2015-08-145-19/+18
| | | | | | | | | | The outer router object already keeps a hash of named routes, so we should just use that.
* | Merge pull request #21240 from piton4eg/patch-5Claudio B.2015-08-141-10/+10
|\ \ | | | | | | Small fixes [ci skip]
| * | Small fixes [ci skip]Alexey Markov2015-08-151-10/+10
| | |
* | | rm add_route2Aaron Patterson2015-08-144-49/+53
| | | | | | | | | | | | | | | refactor the tests with a backwards compatible method call so we can rm add_route2 from the journey router