aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2010-09-05 22:59:41 -0300
committerJosé Valim <jose.valim@gmail.com>2010-09-06 13:41:12 +0200
commit9532d746a998f790a5c0c61caff17beeb43f39f0 (patch)
treea23cb91829a387d42a624d45961462c9deceb5ca /actionpack/lib
parent11fccc5f06bc67353b895eeeb65cfab94cb4cd25 (diff)
downloadrails-9532d746a998f790a5c0c61caff17beeb43f39f0.tar.gz
rails-9532d746a998f790a5c0c61caff17beeb43f39f0.tar.bz2
rails-9532d746a998f790a5c0c61caff17beeb43f39f0.zip
Cleanup deprecations in Action Dispatch
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_dispatch/http/url.rb9
-rw-r--r--actionpack/lib/action_dispatch/middleware/stack.rb5
-rw-r--r--actionpack/lib/action_dispatch/testing/test_response.rb93
-rw-r--r--actionpack/lib/action_view/helpers/atom_feed_helper.rb2
4 files changed, 2 insertions, 107 deletions
diff --git a/actionpack/lib/action_dispatch/http/url.rb b/actionpack/lib/action_dispatch/http/url.rb
index f6375902f6..38f46fa120 100644
--- a/actionpack/lib/action_dispatch/http/url.rb
+++ b/actionpack/lib/action_dispatch/http/url.rb
@@ -95,13 +95,6 @@ module ActionDispatch
subdomains(tld_length).join('.')
end
- # Returns the request URI, accounting for server idiosyncrasies.
- # WEBrick includes the full \URL. IIS leaves REQUEST_URI blank.
- def request_uri
- ActiveSupport::Deprecation.warn "Using #request_uri is deprecated. Use fullpath instead.", caller
- fullpath
- end
-
private
def named_host?(host)
@@ -109,4 +102,4 @@ module ActionDispatch
end
end
end
-end \ No newline at end of file
+end
diff --git a/actionpack/lib/action_dispatch/middleware/stack.rb b/actionpack/lib/action_dispatch/middleware/stack.rb
index 6f243574e4..db7f342bc5 100644
--- a/actionpack/lib/action_dispatch/middleware/stack.rb
+++ b/actionpack/lib/action_dispatch/middleware/stack.rb
@@ -69,11 +69,6 @@ module ActionDispatch
push(middleware)
end
- def active
- ActiveSupport::Deprecation.warn "All middlewares in the chain are active since the laziness " <<
- "was removed from the middleware stack", caller
- end
-
def build(app = nil, &block)
app ||= block
raise "MiddlewareStack#build requires an app" unless app
diff --git a/actionpack/lib/action_dispatch/testing/test_response.rb b/actionpack/lib/action_dispatch/testing/test_response.rb
index 44fb1bde99..926034762f 100644
--- a/actionpack/lib/action_dispatch/testing/test_response.rb
+++ b/actionpack/lib/action_dispatch/testing/test_response.rb
@@ -14,99 +14,6 @@ module ActionDispatch
end
end
- module DeprecatedHelpers
- def template
- ActiveSupport::Deprecation.warn("response.template has been deprecated. Use controller.template instead", caller)
- @template
- end
- attr_writer :template
-
- def session
- ActiveSupport::Deprecation.warn("response.session has been deprecated. Use request.session instead", caller)
- @request.session
- end
-
- def assigns
- ActiveSupport::Deprecation.warn("response.assigns has been deprecated. Use controller.assigns instead", caller)
- @template.controller.assigns
- end
-
- def layout
- ActiveSupport::Deprecation.warn("response.layout has been deprecated. Use template.layout instead", caller)
- @template.layout
- end
-
- def redirected_to
- ::ActiveSupport::Deprecation.warn("response.redirected_to is deprecated. Use response.redirect_url instead", caller)
- redirect_url
- end
-
- def redirect_url_match?(pattern)
- ::ActiveSupport::Deprecation.warn("response.redirect_url_match? is deprecated. Use assert_match(/foo/, response.redirect_url) instead", caller)
- return false if redirect_url.nil?
- p = Regexp.new(pattern) if pattern.class == String
- p = pattern if pattern.class == Regexp
- return false if p.nil?
- p.match(redirect_url) != nil
- end
-
- # Returns the template of the file which was used to
- # render this response (or nil)
- def rendered
- ActiveSupport::Deprecation.warn("response.rendered has been deprecated. Use template.rendered instead", caller)
- @template.instance_variable_get(:@_rendered)
- end
-
- # A shortcut to the flash. Returns an empty hash if no session flash exists.
- def flash
- ActiveSupport::Deprecation.warn("response.flash has been deprecated. Use request.flash instead", caller)
- request.session['flash'] || {}
- end
-
- # Do we have a flash?
- def has_flash?
- ActiveSupport::Deprecation.warn("response.has_flash? has been deprecated. Use flash.any? instead", caller)
- !flash.empty?
- end
-
- # Do we have a flash that has contents?
- def has_flash_with_contents?
- ActiveSupport::Deprecation.warn("response.has_flash_with_contents? has been deprecated. Use flash.any? instead", caller)
- !flash.empty?
- end
-
- # Does the specified flash object exist?
- def has_flash_object?(name=nil)
- ActiveSupport::Deprecation.warn("response.has_flash_object? has been deprecated. Use flash[name] instead", caller)
- !flash[name].nil?
- end
-
- # Does the specified object exist in the session?
- def has_session_object?(name=nil)
- ActiveSupport::Deprecation.warn("response.has_session_object? has been deprecated. Use session[name] instead", caller)
- !session[name].nil?
- end
-
- # A shortcut to the template.assigns
- def template_objects
- ActiveSupport::Deprecation.warn("response.template_objects has been deprecated. Use template.assigns instead", caller)
- @template.assigns || {}
- end
-
- # Does the specified template object exist?
- def has_template_object?(name=nil)
- ActiveSupport::Deprecation.warn("response.has_template_object? has been deprecated. Use tempate.assigns[name].nil? instead", caller)
- !template_objects[name].nil?
- end
-
- # Returns binary content (downloadable file), converted to a String
- def binary_content
- ActiveSupport::Deprecation.warn("response.binary_content has been deprecated. Use response.body instead", caller)
- body
- end
- end
- include DeprecatedHelpers
-
# Was the response successful?
def success?
(200..299).include?(response_code)
diff --git a/actionpack/lib/action_view/helpers/atom_feed_helper.rb b/actionpack/lib/action_view/helpers/atom_feed_helper.rb
index 8e7cf2e701..db9d7a08ff 100644
--- a/actionpack/lib/action_view/helpers/atom_feed_helper.rb
+++ b/actionpack/lib/action_view/helpers/atom_feed_helper.rb
@@ -51,7 +51,7 @@ module ActionView
# * <tt>:language</tt>: Defaults to "en-US".
# * <tt>:root_url</tt>: The HTML alternative that this feed is doubling for. Defaults to / on the current host.
# * <tt>:url</tt>: The URL for this feed. Defaults to the current URL.
- # * <tt>:id</tt>: The id for this feed. Defaults to "tag:#{request.host},#{options[:schema_date]}:#{request.request_uri.split(".")[0]}"
+ # * <tt>:id</tt>: The id for this feed. Defaults to "tag:#{request.host},#{options[:schema_date]}:#{request.fullpath.split(".")[0]}"
# * <tt>:schema_date</tt>: The date at which the tag scheme for the feed was first used. A good default is the year you
# created the feed. See http://feedvalidator.org/docs/error/InvalidTAG.html for more information. If not specified,
# 2005 is used (as an "I don't care" value).