From 6c57177f2c7f4f934716d588545902d5fc00fa99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Tue, 20 Dec 2011 15:12:38 +0100 Subject: Remove deprecation warnings from Action Pack. --- .../action_dispatch/middleware/show_exceptions.rb | 26 +--------------------- .../lib/action_dispatch/routing/redirection.rb | 9 -------- 2 files changed, 1 insertion(+), 34 deletions(-) (limited to 'actionpack/lib/action_dispatch') diff --git a/actionpack/lib/action_dispatch/middleware/show_exceptions.rb b/actionpack/lib/action_dispatch/middleware/show_exceptions.rb index 5eceeece1f..3d06214bf1 100644 --- a/actionpack/lib/action_dispatch/middleware/show_exceptions.rb +++ b/actionpack/lib/action_dispatch/middleware/show_exceptions.rb @@ -22,31 +22,7 @@ module ActionDispatch "application's log file and/or the web server's log file to find out what " << "went wrong."]] - class << self - def rescue_responses - ActiveSupport::Deprecation.warn "ActionDispatch::ShowExceptions.rescue_responses is deprecated. " \ - "Please configure your exceptions using a railtie or in your application config instead." - ExceptionWrapper.rescue_responses - end - - def rescue_templates - ActiveSupport::Deprecation.warn "ActionDispatch::ShowExceptions.rescue_templates is deprecated. " \ - "Please configure your exceptions using a railtie or in your application config instead." - ExceptionWrapper.rescue_templates - end - end - - def initialize(app, exceptions_app = nil) - if [true, false].include?(exceptions_app) - ActiveSupport::Deprecation.warn "Passing consider_all_requests_local option to ActionDispatch::ShowExceptions middleware no longer works" - exceptions_app = nil - end - - if exceptions_app.nil? - raise ArgumentError, "You need to pass an exceptions_app when initializing ActionDispatch::ShowExceptions. " \ - "In case you want to render pages from a public path, you can use ActionDispatch::PublicExceptions.new('path/to/public')" - end - + def initialize(app, exceptions_app) @app = app @exceptions_app = exceptions_app end diff --git a/actionpack/lib/action_dispatch/routing/redirection.rb b/actionpack/lib/action_dispatch/routing/redirection.rb index 330400e139..617b24b46a 100644 --- a/actionpack/lib/action_dispatch/routing/redirection.rb +++ b/actionpack/lib/action_dispatch/routing/redirection.rb @@ -97,16 +97,7 @@ module ActionDispatch } if String === path block = path if path.respond_to? :call - - # :FIXME: remove in Rails 4.0 - if block && block.respond_to?(:arity) && block.arity < 2 - msg = "redirect blocks with arity of #{block.arity} are deprecated. Your block must take 2 parameters: the environment, and a request object" - ActiveSupport::Deprecation.warn msg - block = lambda { |params, _| block.call(params) } - end - raise ArgumentError, "redirection argument not supported" unless block - Redirect.new status, block end end -- cgit v1.2.3