diff options
author | José Valim <jose.valim@gmail.com> | 2010-01-14 19:53:07 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-01-15 12:24:30 +0100 |
commit | 8c8942ed4f2da52aa42ccd46560acb0b5fd37cb8 (patch) | |
tree | 976072122a45b4d050a0d6e798ae55ac3fea67a7 /actionpack/lib/action_controller/deprecated/dispatcher.rb | |
parent | 5a8e7287c542cbe82d3127cae83dab8571ab9114 (diff) | |
download | rails-8c8942ed4f2da52aa42ccd46560acb0b5fd37cb8.tar.gz rails-8c8942ed4f2da52aa42ccd46560acb0b5fd37cb8.tar.bz2 rails-8c8942ed4f2da52aa42ccd46560acb0b5fd37cb8.zip |
Move Dispatcher setup to Railties and add instrumentation hook.
Diffstat (limited to 'actionpack/lib/action_controller/deprecated/dispatcher.rb')
-rw-r--r-- | actionpack/lib/action_controller/deprecated/dispatcher.rb | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/actionpack/lib/action_controller/deprecated/dispatcher.rb b/actionpack/lib/action_controller/deprecated/dispatcher.rb new file mode 100644 index 0000000000..3da3c8ce7d --- /dev/null +++ b/actionpack/lib/action_controller/deprecated/dispatcher.rb @@ -0,0 +1,31 @@ +module ActionController + class Dispatcher + cattr_accessor :prepare_each_request + self.prepare_each_request = false + + class << self + def before_dispatch(*args, &block) + ActiveSupport::Deprecation.warn "ActionController::Dispatcher.before_dispatch is deprecated. " << + "Please use ActionDispatch::Callbacks.before instead.", caller + ActionDispatch::Callbacks.before(*args, &block) + end + + def after_dispatch(*args, &block) + ActiveSupport::Deprecation.warn "ActionController::Dispatcher.after_dispatch is deprecated. " << + "Please use ActionDispatch::Callbacks.after instead.", caller + ActionDispatch::Callbacks.after(*args, &block) + end + + def to_prepare(*args, &block) + ActiveSupport::Deprecation.warn "ActionController::Dispatcher.to_prepare is deprecated. " << + "Please use ActionDispatch::Callbacks.to_prepare instead.", caller + ActionDispatch::Callbacks.after(*args, &block) + end + + def new + ActiveSupport::Deprecation.warn "ActionController::Dispatcher.new is deprecated, use Rails.application instead." + Rails.application + end + end + end +end |