Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
1ab2ab07
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,发现更多精彩内容 >>
提交
1ab2ab07
编写于
9月 27, 2010
作者:
E
Emilio Tagua
提交者:
Santiago Pastorino
9月 27, 2010
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove more warnings shadowing outer local variable.
Signed-off-by:
N
Santiago Pastorino
<
santiago@wyeworks.com
>
上级
2f326b7f
变更
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
浏览文件 @
1ab2ab07
...
...
@@ -96,9 +96,9 @@ def all_application_helpers
def
all_helpers_from_path
(
path
)
helpers
=
[]
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'
)
}
Array
.
wrap
(
path
).
each
do
|
_path
|
extract
=
/^
#{
Regexp
.
quote
(
_path
.
to_s
)
}
\/?(.*)_helper.rb$/
helpers
+=
Dir
[
"
#{
_path
}
/**/*_helper.rb"
].
map
{
|
file
|
file
.
sub
(
extract
,
'\1'
)
}
end
helpers
.
sort!
helpers
.
uniq!
...
...
actionpack/lib/action_controller/vendor/html-scanner/html/node.rb
浏览文件 @
1ab2ab07
...
...
@@ -18,14 +18,14 @@ def initialize(hash)
hash
[
k
]
=
Conditions
.
new
(
v
)
when
:children
hash
[
k
]
=
v
=
keys_to_symbols
(
v
)
v
.
each
do
|
key
,
v
2
|
v
.
each
do
|
key
,
v
alue
|
case
key
when
:count
,
:greater_than
,
:less_than
# keys are valid, and require no further processing
when
:only
v
[
key
]
=
Conditions
.
new
(
v
2
)
v
[
key
]
=
Conditions
.
new
(
v
alue
)
else
raise
"illegal key
#{
k
.
inspect
}
=>
#{
v2
.
inspect
}
"
raise
"illegal key
#{
k
ey
.
inspect
}
=>
#{
value
.
inspect
}
"
end
end
else
...
...
actionpack/lib/action_dispatch/testing/assertions/selector.rb
浏览文件 @
1ab2ab07
...
...
@@ -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
|
text
=
ele
.
children
.
select
{
|
c
|
not
c
.
tag?
}.
map
{
|
c
|
fix_content
[
c
]
}.
join
selected
=
elements
.
map
do
|
_element
|
text
=
_element
.
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
浏览文件 @
1ab2ab07
...
...
@@ -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
{
|
response
|
response
.
cache_control
[
:public
]
=
true
response
.
etag
=
'123'
response
.
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
{
|
response
|
response
.
charset
=
'utf-16'
response
.
content_type
=
Mime
::
XML
response
.
body
=
'Hello'
}
resp
.
to_a
...
...
actionpack/test/template/text_helper_test.rb
浏览文件 @
1ab2ab07
...
...
@@ -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
|
truncate
(
u
,
: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>"
)
{
|
_url
|
truncate
(
_url
,
: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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录