diff options
author | Josh Kalderimis <josh.kalderimis@gmail.com> | 2011-05-24 23:38:59 +0200 |
---|---|---|
committer | Josh Kalderimis <josh.kalderimis@gmail.com> | 2011-05-24 23:38:59 +0200 |
commit | d182b6ee9c99901553e6e948f91102d03bb041b0 (patch) | |
tree | 136116fbbd3205946cbacf57273501c3675458aa /actionpack/lib/action_dispatch | |
parent | 90f59b24dc994b0edca22dbed30846738ddcc41d (diff) | |
download | rails-d182b6ee9c99901553e6e948f91102d03bb041b0.tar.gz rails-d182b6ee9c99901553e6e948f91102d03bb041b0.tar.bz2 rails-d182b6ee9c99901553e6e948f91102d03bb041b0.zip |
removed deprecated methods, and related tests, from ActionPack
Diffstat (limited to 'actionpack/lib/action_dispatch')
5 files changed, 3 insertions, 46 deletions
diff --git a/actionpack/lib/action_dispatch/http/request.rb b/actionpack/lib/action_dispatch/http/request.rb index ccb866f4f7..f3e94df4b9 100644 --- a/actionpack/lib/action_dispatch/http/request.rb +++ b/actionpack/lib/action_dispatch/http/request.rb @@ -2,7 +2,6 @@ require 'tempfile' require 'stringio' require 'strscan' -require 'active_support/core_ext/module/deprecation' require 'active_support/core_ext/hash/indifferent_access' require 'active_support/core_ext/string/access' require 'active_support/inflector' @@ -26,7 +25,7 @@ module ActionDispatch HTTP_ACCEPT HTTP_ACCEPT_CHARSET HTTP_ACCEPT_ENCODING HTTP_ACCEPT_LANGUAGE HTTP_CACHE_CONTROL HTTP_FROM HTTP_NEGOTIATE HTTP_PRAGMA ].freeze - + ENV_METHODS.each do |env| class_eval <<-METHOD, __FILE__, __LINE__ + 1 def #{env.sub(/^HTTP_/n, '').downcase} @@ -134,11 +133,6 @@ module ActionDispatch @fullpath ||= super end - def forgery_whitelisted? - get? - end - deprecate :forgery_whitelisted? => "it is just an alias for 'get?' now, update your code" - def media_type content_mime_type.to_s end diff --git a/actionpack/lib/action_dispatch/http/response.rb b/actionpack/lib/action_dispatch/http/response.rb index 76d0857b93..f1e85559a3 100644 --- a/actionpack/lib/action_dispatch/http/response.rb +++ b/actionpack/lib/action_dispatch/http/response.rb @@ -116,32 +116,9 @@ module ActionDispatch # :nodoc: EMPTY = " " - class BodyBuster #:nodoc: - def initialize(response) - @response = response - @body = "" - end - - def bust(body) - body.call(@response, self) - body.close if body.respond_to?(:close) - @body - end - - def write(string) - @body << string.to_s - end - end - def body=(body) @blank = true if body == EMPTY - if body.respond_to?(:call) - ActiveSupport::Deprecation.warn "Setting a Proc or an object that responds to call " \ - "in response_body is no longer supported", caller - body = BodyBuster.new(self).bust(body) - end - # Explicitly check for strings. This is *wrong* theoretically # but if we don't check this, the performance on string bodies # is bad on Ruby 1.8 (because strings responds to each then). diff --git a/actionpack/lib/action_dispatch/middleware/callbacks.rb b/actionpack/lib/action_dispatch/middleware/callbacks.rb index 1bb2ad7f67..8c0f4052ec 100644 --- a/actionpack/lib/action_dispatch/middleware/callbacks.rb +++ b/actionpack/lib/action_dispatch/middleware/callbacks.rb @@ -19,8 +19,7 @@ module ActionDispatch set_callback(:call, :after, *args, &block) end - def initialize(app, unused = nil) - ActiveSupport::Deprecation.warn "Passing a second argument to ActionDispatch::Callbacks.new is deprecated." unless unused.nil? + def initialize(app) @app = app end diff --git a/actionpack/lib/action_dispatch/middleware/session/abstract_store.rb b/actionpack/lib/action_dispatch/middleware/session/abstract_store.rb index 8ad1ad1f2f..a70d814749 100644 --- a/actionpack/lib/action_dispatch/middleware/session/abstract_store.rb +++ b/actionpack/lib/action_dispatch/middleware/session/abstract_store.rb @@ -73,13 +73,7 @@ module ActionDispatch include StaleSessionCheck def destroy_session(env, sid, options) - ActiveSupport::Deprecation.warn "Implementing #destroy in session stores is deprecated. " << - "Please implement destroy_session(env, session_id, options) instead." - destroy(env) - end - - def destroy(env) - raise '#destroy needs to be implemented.' + raise '#destroy_session needs to be implemented.' end end end diff --git a/actionpack/lib/action_dispatch/routing/route.rb b/actionpack/lib/action_dispatch/routing/route.rb index a049510182..10b3d38346 100644 --- a/actionpack/lib/action_dispatch/routing/route.rb +++ b/actionpack/lib/action_dispatch/routing/route.rb @@ -1,5 +1,3 @@ -require 'active_support/core_ext/module/deprecation' - module ActionDispatch module Routing class Route #:nodoc: @@ -47,11 +45,6 @@ module ActionDispatch @segment_keys ||= conditions[:path_info].names.compact.map { |key| key.to_sym } end - def to_a - [@app, @conditions, @defaults, @name] - end - deprecate :to_a - def to_s @to_s ||= begin "%-6s %-40s %s" % [(verb || :any).to_s.upcase, path, requirements.inspect] |