提交 2f326b7f 编写于 作者: E Emilio Tagua 提交者: Santiago Pastorino

Remove warning "URI.unescape is obsolete" from actionpack.

Signed-off-by: NSantiago Pastorino <santiago@wyeworks.com>
上级 8be911c6
......@@ -8,6 +8,7 @@ module ActionController
autoload :Caching
autoload :Metal
autoload :Middleware
autoload :UriParser
autoload_under "metal" do
autoload :Compatibility
......
......@@ -141,6 +141,8 @@ def filter(controller)
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 @@ def normalize!(path)
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
......
require 'fileutils'
require 'uri'
require 'active_support/core_ext/class/attribute_accessors'
module ActionController #:nodoc:
......@@ -58,6 +57,8 @@ module Pages
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)
......
......@@ -129,10 +129,6 @@ def to_s() join '/' end
def self.new_escaped(strings)
new strings.collect {|str| uri_parser.unescape str}
end
def uri_parser
@uri_parser ||= URI.const_defined?(:Parser) ? URI::Parser.new : URI
end
end
def assign_parameters(routes, controller_path, action, parameters = {})
......
require 'uri'
module ActionController #:nodoc:
module UriParser
def uri_parser
@uri_parser ||= URI.const_defined?(:Parser) ? URI::Parser.new : URI
end
end
end
......@@ -5,6 +5,8 @@
module ActionDispatch
module Routing
class RouteSet #:nodoc:
include ActionController::UriParser
PARAMETERS_KEY = 'action_dispatch.request.path_parameters'
class Dispatcher #:nodoc:
......@@ -68,10 +70,6 @@ def merge_default_action!(params)
def split_glob_param!(params)
params[@glob_param] = params[@glob_param].split('/').map { |v| uri_parser.unescape(v) }
end
def uri_parser
@uri_parser ||= URI.const_defined?(:Parser) ? URI::Parser.new : URI
end
end
# A NamedRouteCollection instance is a collection of named routes, and also
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册