Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
583ddf22
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,发现更多精彩内容 >>
提交
583ddf22
编写于
9月 22, 2010
作者:
E
Emilio Tagua
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove more warnings shadowing outer local variable.
上级
dafb4bd3
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
17 addition
and
17 deletion
+17
-17
actionpack/lib/action_controller/metal/helpers.rb
actionpack/lib/action_controller/metal/helpers.rb
+3
-3
actionpack/lib/action_controller/vendor/html-scanner/html/node.rb
...ck/lib/action_controller/vendor/html-scanner/html/node.rb
+3
-3
actionpack/lib/action_dispatch/testing/assertions/selector.rb
...onpack/lib/action_dispatch/testing/assertions/selector.rb
+2
-2
actionpack/test/dispatch/response_test.rb
actionpack/test/dispatch/response_test.rb
+8
-8
actionpack/test/template/text_helper_test.rb
actionpack/test/template/text_helper_test.rb
+1
-1
未找到文件。
actionpack/lib/action_controller/metal/helpers.rb
浏览文件 @
583ddf22
...
...
@@ -96,9 +96,9 @@ def all_application_helpers
def
all_helpers_from_path
(
path
)
helpers
=
[]
Array
.
wrap
(
path
).
each
do
|
p
ath
|
extract
=
/^
#{
Regexp
.
quote
(
p
ath
.
to_s
)
}
\/?(.*)_helper.rb$/
helpers
+=
Dir
[
"
#{
p
ath
}
/**/*_helper.rb"
].
map
{
|
file
|
file
.
sub
(
extract
,
'\1'
)
}
Array
.
wrap
(
path
).
each
do
|
p
|
extract
=
/^
#{
Regexp
.
quote
(
p
.
to_s
)
}
\/?(.*)_helper.rb$/
helpers
+=
Dir
[
"
#{
p
}
/**/*_helper.rb"
].
map
{
|
file
|
file
.
sub
(
extract
,
'\1'
)
}
end
helpers
.
sort!
helpers
.
uniq!
...
...
actionpack/lib/action_controller/vendor/html-scanner/html/node.rb
浏览文件 @
583ddf22
...
...
@@ -18,12 +18,12 @@ def initialize(hash)
hash
[
k
]
=
Conditions
.
new
(
v
)
when
:children
hash
[
k
]
=
v
=
keys_to_symbols
(
v
)
v
.
each
do
|
k
,
v2
|
case
k
v
.
each
do
|
k
ey
,
v2
|
case
k
ey
when
:count
,
:greater_than
,
:less_than
# keys are valid, and require no further processing
when
:only
v
[
k
]
=
Conditions
.
new
(
v2
)
v
[
k
ey
]
=
Conditions
.
new
(
v2
)
else
raise
"illegal key
#{
k
.
inspect
}
=>
#{
v2
.
inspect
}
"
end
...
...
actionpack/lib/action_dispatch/testing/assertions/selector.rb
浏览文件 @
583ddf22
...
...
@@ -513,8 +513,8 @@ def assert_select_encoded(element = nil, &block)
node
.
content
.
gsub
(
/<!\[CDATA\[(.*)(\]\]>)?/m
)
{
Rack
::
Utils
.
escapeHTML
(
$1
)
}
end
selected
=
elements
.
map
do
|
ele
ment
|
text
=
ele
ment
.
children
.
select
{
|
c
|
not
c
.
tag?
}.
map
{
|
c
|
fix_content
[
c
]
}.
join
selected
=
elements
.
map
do
|
ele
|
text
=
ele
.
children
.
select
{
|
c
|
not
c
.
tag?
}.
map
{
|
c
|
fix_content
[
c
]
}.
join
root
=
HTML
::
Document
.
new
(
CGI
.
unescapeHTML
(
"<encoded>
#{
text
}
</encoded>"
)).
root
css_select
(
root
,
"encoded:root"
,
&
block
)[
0
]
end
...
...
actionpack/test/dispatch/response_test.rb
浏览文件 @
583ddf22
...
...
@@ -120,10 +120,10 @@ def setup
end
test
"read cache control"
do
resp
=
ActionDispatch
::
Response
.
new
.
tap
{
|
resp
|
resp
.
cache_control
[
:public
]
=
true
resp
.
etag
=
'123'
resp
.
body
=
'Hello'
resp
=
ActionDispatch
::
Response
.
new
.
tap
{
|
_
resp
|
_
resp
.
cache_control
[
:public
]
=
true
_
resp
.
etag
=
'123'
_
resp
.
body
=
'Hello'
}
resp
.
to_a
...
...
@@ -135,10 +135,10 @@ def setup
end
test
"read charset and content type"
do
resp
=
ActionDispatch
::
Response
.
new
.
tap
{
|
resp
|
resp
.
charset
=
'utf-16'
resp
.
content_type
=
Mime
::
XML
resp
.
body
=
'Hello'
resp
=
ActionDispatch
::
Response
.
new
.
tap
{
|
_
resp
|
_
resp
.
charset
=
'utf-16'
_
resp
.
content_type
=
Mime
::
XML
_
resp
.
body
=
'Hello'
}
resp
.
to_a
...
...
actionpack/test/template/text_helper_test.rb
浏览文件 @
583ddf22
...
...
@@ -491,7 +491,7 @@ def test_auto_link_with_block
url
=
"http://api.rubyonrails.com/Foo.html"
email
=
"fantabulous@shiznadel.ic"
assert_equal
%(<p><a href="#{url}">#{url[0...7]}...</a><br /><a href="mailto:#{email}">#{email[0...7]}...</a><br /></p>)
,
auto_link
(
"<p>
#{
url
}
<br />
#{
email
}
<br /></p>"
)
{
|
u
rl
|
truncate
(
url
,
:length
=>
10
)
}
assert_equal
%(<p><a href="#{url}">#{url[0...7]}...</a><br /><a href="mailto:#{email}">#{email[0...7]}...</a><br /></p>)
,
auto_link
(
"<p>
#{
url
}
<br />
#{
email
}
<br /></p>"
)
{
|
u
|
truncate
(
u
,
:length
=>
10
)
}
end
def
test_auto_link_with_block_with_html
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录