From 2f326b7f27349b933fe617d83b3f80c6573ce5d8 Mon Sep 17 00:00:00 2001 From: Emilio Tagua Date: Mon, 27 Sep 2010 15:13:11 -0300 Subject: Remove warning "URI.unescape is obsolete" from actionpack. Signed-off-by: Santiago Pastorino --- actionpack/lib/action_controller/caching/actions.rb | 6 ++---- actionpack/lib/action_controller/caching/pages.rb | 3 ++- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'actionpack/lib/action_controller/caching') diff --git a/actionpack/lib/action_controller/caching/actions.rb b/actionpack/lib/action_controller/caching/actions.rb index e00f4a7b1d..cd352f69fc 100644 --- a/actionpack/lib/action_controller/caching/actions.rb +++ b/actionpack/lib/action_controller/caching/actions.rb @@ -141,6 +141,8 @@ module ActionController #:nodoc: end class ActionCachePath + include UriParser + attr_reader :path, :extension # If +infer_extension+ is true, the cache path extension is looked up from the request's @@ -163,10 +165,6 @@ module ActionController #:nodoc: path << ".#{extension}" if extension and !path.ends_with?(extension) uri_parser.unescape(path) end - - def uri_parser - @uri_parser ||= URI.const_defined?(:Parser) ? URI::Parser.new : URI - end end end end diff --git a/actionpack/lib/action_controller/caching/pages.rb b/actionpack/lib/action_controller/caching/pages.rb index b845c6f6f9..f0e00718ac 100644 --- a/actionpack/lib/action_controller/caching/pages.rb +++ b/actionpack/lib/action_controller/caching/pages.rb @@ -1,5 +1,4 @@ require 'fileutils' -require 'uri' require 'active_support/core_ext/class/attribute_accessors' module ActionController #:nodoc: @@ -58,6 +57,8 @@ module ActionController #:nodoc: end module ClassMethods + include UriParser + # Expires the page that was cached with the +path+ as a key. Example: # expire_page "/lists/show" def expire_page(path) -- cgit v1.2.3