aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/middleware/stack.rb
Commit message (Collapse)AuthorAgeFilesLines
* Enable `Layout/EmptyLinesAroundAccessModifier` copRyuta Kamizono2019-06-131-1/+0
| | | | | | | | | | | We sometimes say "✂️ newline after `private`" in a code review (e.g. https://github.com/rails/rails/pull/18546#discussion_r23188776, https://github.com/rails/rails/pull/34832#discussion_r244847195). Now `Layout/EmptyLinesAroundAccessModifier` cop have new enforced style `EnforcedStyle: only_before` (https://github.com/rubocop-hq/rubocop/pull/7059). That cop and enforced style will reduce the our code review cost.
* Only build middleware proxy when instrumentatingJohn Hawthorn2019-05-081-2/+13
| | | | | | | | | | | | | | | | | The instrumentation proxy adds three stack frames per-middleware, even when nothing is listening. This commit, when the middleware stack is built, only adds instrumentation when the `process_middleware.action_dispatch` event has already been subscribed to. The advantage to this is that we don't have any extra stack frames in apps which don't need middleware instrumentation. The disadvantage is that the subscriptions need to be in place when the middleware stack is built (during app boot). I think this is likely okay because temporary AS::Notifications subscriptions are strongly discouraged.
* Instrument middleware processingDaniel Schierbeck2019-03-191-1/+22
| | | | | Adds ActiveSupport::Notifications instrumentation of the processing of each middleware in the stack.
* ActionPack Proc.new without a blockutilum2019-02-131-2/+2
| | | | | | This commit fixes cases that use pre Ruby [r66772](https://bugs.ruby-lang.org/projects/ruby-trunk/repository/trunk/revisions/66772) syntax that are not tickled by the test suite.
* Use frozen string literal in actionpack/Kir Shatrov2017-07-291-0/+2
|
* Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-021-1/+0
| | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
* Enforce frozen string in RubocopKir Shatrov2017-07-011-0/+1
|
* Remove deprecated support to passing strings to the middleware stackRafael Mendonça França2016-10-101-20/+1
|
* 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.
* normalizes indentation and whitespace across the projectXavier Noria2016-08-061-18/+18
|
* Add #== back to ActionDispatch::MiddlewareStack::MiddlewareJon Moss2015-12-211-0/+9
| | | | | This was causing bug #22738 to occur. Also added extra tests to make sure everything is A-OK.
* Show middleware classes on /rails/info/propertiesclaudiob2015-11-111-1/+5
| | | | | | | Closes #21230 by following the indication of @rafaelfranca: > I think the output change would be simpler. > What is really important to show is the class of the middleware, so we should change the output to show that.
* Make `assert_index` privateMarcin Olichwirowicz2015-08-251-3/+1
| | | | | This `protected` keyword looks like some leftover, since we are not using explicit receiver, this should go under `private`
* finish deprecating handling strings and symbolsAaron Patterson2015-08-071-19/+4
| | | | | since we only work with instances of classes, it greatly simplifies the `Middleware` implementation.
* Using strings or symbols for middleware class names is deprecated.Aaron Patterson2015-08-071-18/+25
| | | | | | | | | | Convert things like this: middleware.use "Foo::Bar" to this: middleware.use Foo::Bar
* simplify the Middleware constructorAaron Patterson2015-08-071-10/+13
| | | | | | We should do the hard work outside the constructor. Also fix the tests to not directly construct middleware objects, but to go through the stack object.
* use Proc.new to reduce some conditionalsAaron Patterson2015-08-071-3/+1
| | | | | | Proc.new will pick up the passed in block, but since it's a default param, it won't get evaluated unless someone doesn't pass in an app. It will raise an exception if no block is provided.
* Add the #unshift method to the middleware stackRich Healey2012-05-181-0/+5
| | | | | | The docs suggest that the middleware stack is an Array, so I've added the unshift method to it. Originally I added some more Array methods, but it was agreed that they lacked usecases.
* Freeze the middleware stack after it's builtJeremy Kemper2012-04-201-1/+1
| | | | | | So apps that accidentally add middlewares later aren't unwittingly dumping them in a black hole. Closes #5911
* Fix GH #4873. Allow swapping middleware of same classkennyj2012-02-041-2/+3
|
* make sure string keys are always looked up from the class cacheAaron Patterson2011-03-021-2/+3
|
* yo dawg, directly use the class cache rather than the cache of the cacheAaron Patterson2011-03-011-1/+2
|
* refactor Reference to a ClassCache object, fix lazy lookup in Middleware so ↵Aaron Patterson2011-03-011-3/+10
| | | | that anonymous classes are supported
* Enumerable gives us include?, so remove include?Aaron Patterson2011-03-011-4/+0
|
* prefer composition over inheritance with AD::MSAaron Patterson2011-03-011-8/+37
|
* Avoid (@_var ||= nil) pattern by using initialize methods and ensuring ↵José Valim2010-09-291-0/+4
| | | | everyone calls super as expected.
* No need to call super here. Use yield instead block.callEmilio Tagua2010-09-281-3/+2
|
* Cleanup deprecations in Action DispatchCarlos Antonio da Silva2010-09-061-5/+0
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* require 'active_support/dependencies' in action_dispatch/middleware/stackPiotr Sarnacki2010-09-031-0/+1
|
* Deletes trailing whitespaces (over text files only find * -type f -exec sed ↵Santiago Pastorino2010-08-141-1/+1
| | | | 's/[ \t]*$//' -i {} \;)
* Ensure insert_before in middleware stack raises a meaningful error message ↵José Valim2010-07-211-4/+11
| | | | [#3679 state:resolved]
* Fix a bunch of minor spelling mistakesEvgeniy Dolzhenko2010-06-111-1/+1
|
* Simplify middleware stack lazy compares using named const referencesJeremy Kemper2010-06-051-13/+5
|
* Add :only and :except to controllers MiddlewareStack. This allowsJosé Valim2010-05-301-4/+4
| | | | | | | | you to do the following: class PostsController < ApplicationController use AutheMiddleware, :except => [:index, :show] end
* Remove the laziness from the middleware stack.José Valim2010-05-291-57/+15
|
* Simplify the action endpoint:Carlhuda2010-03-081-1/+5
| | | | | | | * Remove ActionEndpoint in favor of passing a block to MiddlewareStack * Always create a Request; the performance win of RackDelegation is around the response; the Request object hit is limited to a single object allocation * #dispatch takes a Request
* Make many parts of Rails lazy. In order to facilitate this,wycats2010-03-071-1/+1
| | | | | | | | | | | | add lazy_load_hooks.rb, which allows us to declare code that should be run at some later time. For instance, this allows us to defer requiring ActiveRecord::Base at boot time purely to apply configuration. Instead, we register a hook that should apply configuration once ActiveRecord::Base is loaded. With these changes, brings down total boot time of a new app to 300ms in production and 400ms in dev. TODO: rename base_hook
* As first step setup the load path and lazy compare middlewares.José Valim2010-01-251-1/+13
|
* Cleanup middleware introspection outputJoshua Peek2010-01-191-3/+1
|
* Complain if there's no such middlewareJeremy Kemper2009-12-281-2/+3
|
* Break up inflector to reduce the dependency burden on dependency-les methods ↵Yehuda Katz2009-11-071-2/+4
| | | | like constantize.
* Rework Middleware stack to match the Rack middleware protocol more closelyYehuda Katz + Carl Lerche2009-08-251-3/+3
|
* Merge branch 'master' into wip_abstract_controllerYehuda Katz + Carl Lerche2009-05-111-2/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: actionpack/lib/action_controller/abstract/callbacks.rb actionpack/lib/action_controller/abstract/renderer.rb actionpack/lib/action_controller/base/base.rb actionpack/lib/action_controller/dispatch/dispatcher.rb actionpack/lib/action_controller/routing/route_set.rb actionpack/lib/action_controller/testing/process.rb actionpack/test/abstract_controller/layouts_test.rb actionpack/test/controller/filters_test.rb actionpack/test/controller/helper_test.rb actionpack/test/controller/render_test.rb actionpack/test/new_base/test_helper.rb
| * Show lazy middleware args in pretty printJoshua Peek2009-05-031-2/+1
| |
* | Renamed Base2 to Base and don't require old action_controller for new BaseYehuda Katz + Carl Lerche2009-05-011-2/+0
|/
* Move middleware stack out of utils folderJoshua Peek2009-04-141-0/+119