Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
5d773f8d
R
rails
项目概览
张重言
/
rails
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rails
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
5d773f8d
编写于
9月 22, 2010
作者:
E
Emilio Tagua
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove warning "URI.unescape is obsolete" from actionpack.
上级
535371e9
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
34 addition
and
14 deletion
+34
-14
actionpack/lib/action_controller/caching/actions.rb
actionpack/lib/action_controller/caching/actions.rb
+5
-1
actionpack/lib/action_controller/caching/pages.rb
actionpack/lib/action_controller/caching/pages.rb
+5
-1
actionpack/lib/action_controller/test_case.rb
actionpack/lib/action_controller/test_case.rb
+5
-1
actionpack/lib/action_dispatch/routing/mapper.rb
actionpack/lib/action_dispatch/routing/mapper.rb
+9
-9
actionpack/lib/action_dispatch/routing/route_set.rb
actionpack/lib/action_dispatch/routing/route_set.rb
+10
-2
未找到文件。
actionpack/lib/action_controller/caching/actions.rb
浏览文件 @
5d773f8d
...
...
@@ -161,7 +161,11 @@ def initialize(controller, options = {}, infer_extension = true)
def
normalize!
(
path
)
path
<<
'index'
if
path
[
-
1
]
==
?/
path
<<
".
#{
extension
}
"
if
extension
and
!
path
.
ends_with?
(
extension
)
URI
.
unescape
(
path
)
uri_parser
.
unescape
(
path
)
end
def
uri_parser
@uri_parser
||=
URI
.
const_defined?
(
:Parser
)
?
URI
::
Parser
.
new
:
URI
end
end
end
...
...
actionpack/lib/action_controller/caching/pages.rb
浏览文件 @
5d773f8d
...
...
@@ -99,7 +99,7 @@ def caches_page(*actions)
private
def
page_cache_file
(
path
)
name
=
(
path
.
empty?
||
path
==
"/"
)
?
"/index"
:
URI
.
unescape
(
path
.
chomp
(
'/'
))
name
=
(
path
.
empty?
||
path
==
"/"
)
?
"/index"
:
uri_parser
.
unescape
(
path
.
chomp
(
'/'
))
name
<<
page_cache_extension
unless
(
name
.
split
(
'/'
).
last
||
name
).
include?
'.'
return
name
end
...
...
@@ -111,6 +111,10 @@ def page_cache_path(path)
def
instrument_page_cache
(
name
,
path
)
ActiveSupport
::
Notifications
.
instrument
(
"
#{
name
}
.action_controller"
,
:path
=>
path
){
yield
}
end
def
uri_parser
@uri_parser
||=
URI
.
const_defined?
(
:Parser
)
?
URI
::
Parser
.
new
:
URI
end
end
# Expires the page that was cached with the +options+ as a key. Example:
...
...
actionpack/lib/action_controller/test_case.rb
浏览文件 @
5d773f8d
...
...
@@ -127,7 +127,11 @@ def initialize(env = {})
class
Result
<
::
Array
#:nodoc:
def
to_s
()
join
'/'
end
def
self
.
new_escaped
(
strings
)
new
strings
.
collect
{
|
str
|
URI
.
unescape
str
}
new
strings
.
collect
{
|
str
|
uri_parser
.
unescape
str
}
end
def
uri_parser
@uri_parser
||=
URI
.
const_defined?
(
:Parser
)
?
URI
::
Parser
.
new
:
URI
end
end
...
...
actionpack/lib/action_dispatch/routing/mapper.rb
浏览文件 @
5d773f8d
...
...
@@ -395,10 +395,10 @@ def map_method(method, *args, &block)
# namespace "admin" do
# resources :posts, :comments
# end
#
#
# This will create a number of routes for each of the posts and comments
# controller. For Admin::PostsController, Rails will create:
#
#
# GET /admin/photos
# GET /admin/photos/new
# POST /admin/photos
...
...
@@ -406,33 +406,33 @@ def map_method(method, *args, &block)
# GET /admin/photos/1/edit
# PUT /admin/photos/1
# DELETE /admin/photos/1
#
#
# If you want to route /photos (without the prefix /admin) to
# Admin::PostsController, you could use
#
#
# scope :module => "admin" do
# resources :posts, :comments
# end
#
# or, for a single case
#
#
# resources :posts, :module => "admin"
#
#
# If you want to route /admin/photos to PostsController
# (without the Admin:: module prefix), you could use
#
#
# scope "/admin" do
# resources :posts, :comments
# end
#
# or, for a single case
#
#
# resources :posts, :path => "/admin"
#
# In each of these cases, the named routes remain the same as if you did
# not use scope. In the last case, the following paths map to
# PostsController:
#
#
# GET /admin/photos
# GET /admin/photos/new
# POST /admin/photos
...
...
actionpack/lib/action_dispatch/routing/route_set.rb
浏览文件 @
5d773f8d
...
...
@@ -66,7 +66,11 @@ def merge_default_action!(params)
end
def
split_glob_param!
(
params
)
params
[
@glob_param
]
=
params
[
@glob_param
].
split
(
'/'
).
map
{
|
v
|
URI
.
unescape
(
v
)
}
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
...
...
@@ -543,7 +547,7 @@ def recognize_path(path, environment = {})
params
.
each
do
|
key
,
value
|
if
value
.
is_a?
(
String
)
value
=
value
.
dup
.
force_encoding
(
Encoding
::
BINARY
)
if
value
.
encoding_aware?
params
[
key
]
=
URI
.
unescape
(
value
)
params
[
key
]
=
uri_parser
.
unescape
(
value
)
end
end
...
...
@@ -560,6 +564,10 @@ def recognize_path(path, environment = {})
end
private
def
uri_parser
@uri_parser
||=
URI
.
const_defined?
(
:Parser
)
?
URI
::
Parser
.
new
:
URI
end
def
handle_positional_args
(
options
)
return
unless
args
=
options
.
delete
(
:_positional_args
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录