Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
12701d5a
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 搜索 >>
未验证
提交
12701d5a
编写于
3月 29, 2019
作者:
P
Prathamesh Sonpatki
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix annotated typo
上级
da2c9237
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
9 addition
and
9 deletion
+9
-9
actionpack/lib/action_controller/metal/live.rb
actionpack/lib/action_controller/metal/live.rb
+1
-1
actionpack/lib/action_dispatch/middleware/debug_exceptions.rb
...onpack/lib/action_dispatch/middleware/debug_exceptions.rb
+1
-1
actionview/lib/action_view/renderer/streaming_template_renderer.rb
...w/lib/action_view/renderer/streaming_template_renderer.rb
+1
-1
actionview/lib/action_view/template/error.rb
actionview/lib/action_view/template/error.rb
+2
-2
actionview/test/template/render_test.rb
actionview/test/template/render_test.rb
+4
-4
未找到文件。
actionpack/lib/action_controller/metal/live.rb
浏览文件 @
12701d5a
...
...
@@ -305,7 +305,7 @@ def log_error(exception)
logger
.
fatal
do
message
=
+
"
\n
#{
exception
.
class
}
(
#{
exception
.
message
}
):
\n
"
message
<<
exception
.
annot
ed_source_code
.
to_s
if
exception
.
respond_to?
(
:anno
ted_source_code
)
message
<<
exception
.
annot
ated_source_code
.
to_s
if
exception
.
respond_to?
(
:annota
ted_source_code
)
message
<<
" "
<<
exception
.
backtrace
.
join
(
"
\n
"
)
"
#{
message
}
\n\n
"
end
...
...
actionpack/lib/action_dispatch/middleware/debug_exceptions.rb
浏览文件 @
12701d5a
...
...
@@ -146,7 +146,7 @@ def log_error(request, wrapper)
message
=
[]
message
<<
" "
message
<<
"
#{
exception
.
class
}
(
#{
exception
.
message
}
):"
message
.
concat
(
exception
.
annot
ed_source_code
)
if
exception
.
respond_to?
(
:anno
ted_source_code
)
message
.
concat
(
exception
.
annot
ated_source_code
)
if
exception
.
respond_to?
(
:annota
ted_source_code
)
message
<<
" "
message
.
concat
(
trace
)
...
...
actionview/lib/action_view/renderer/streaming_template_renderer.rb
浏览文件 @
12701d5a
...
...
@@ -34,7 +34,7 @@ def log_error(exception)
return
unless
logger
message
=
+
"
\n
#{
exception
.
class
}
(
#{
exception
.
message
}
):
\n
"
message
<<
exception
.
annot
ed_source_code
.
to_s
if
exception
.
respond_to?
(
:anno
ted_source_code
)
message
<<
exception
.
annot
ated_source_code
.
to_s
if
exception
.
respond_to?
(
:annota
ted_source_code
)
message
<<
" "
<<
exception
.
backtrace
.
join
(
"
\n
"
)
logger
.
fatal
(
"
#{
message
}
\n\n
"
)
end
...
...
actionview/lib/action_view/template/error.rb
浏览文件 @
12701d5a
...
...
@@ -109,7 +109,7 @@ def line_number
end
end
def
annoted_source_code
def
annot
at
ed_source_code
source_extract
(
4
)
end
...
...
@@ -151,7 +151,7 @@ def message
MESSAGE
end
def
annoted_source_code
def
annot
at
ed_source_code
@offending_code_string
.
split
(
"
\n
"
).
map
.
with_index
(
1
)
{
|
line
,
index
|
indentation
=
" "
*
4
"
#{
index
}
:
#{
indentation
}#{
line
}
"
...
...
actionview/test/template/render_test.rb
浏览文件 @
12701d5a
...
...
@@ -262,7 +262,7 @@ def test_render_partial_with_hyphen_and_invalid_option_as
def
test_render_template_with_syntax_error
e
=
assert_raises
(
ActionView
::
Template
::
Error
)
{
@view
.
render
(
template:
"test/syntax_error"
)
}
assert_match
%r!syntax!
,
e
.
message
assert_equal
"1: <%= foo("
,
e
.
annoted_source_code
[
0
].
strip
assert_equal
"1: <%= foo("
,
e
.
annot
at
ed_source_code
[
0
].
strip
end
def
test_render_partial_with_errors
...
...
@@ -270,13 +270,13 @@ def test_render_partial_with_errors
assert_match
%r!method.*doesnt_exist!
,
e
.
message
assert_equal
""
,
e
.
sub_template_message
assert_equal
"1"
,
e
.
line_number
assert_equal
"1: <%= doesnt_exist %>"
,
e
.
annoted_source_code
[
0
].
strip
assert_equal
"1: <%= doesnt_exist %>"
,
e
.
annot
at
ed_source_code
[
0
].
strip
assert_equal
File
.
expand_path
(
"
#{
FIXTURE_LOAD_PATH
}
/test/_raise.html.erb"
),
e
.
file_name
end
def
test_render_error_indentation
e
=
assert_raises
(
ActionView
::
Template
::
Error
)
{
@view
.
render
(
partial:
"test/raise_indentation"
)
}
error_lines
=
e
.
annoted_source_code
error_lines
=
e
.
annot
at
ed_source_code
assert_match
%r!error
\s
here!
,
e
.
message
assert_equal
"11"
,
e
.
line_number
assert_equal
" 9: <p>Ninth paragraph</p>"
,
error_lines
.
second
...
...
@@ -296,7 +296,7 @@ def test_render_file_with_errors
assert_match
%r!method.*doesnt_exist!
,
e
.
message
assert_equal
""
,
e
.
sub_template_message
assert_equal
"1"
,
e
.
line_number
assert_equal
"1: <%= doesnt_exist %>"
,
e
.
annoted_source_code
[
0
].
strip
assert_equal
"1: <%= doesnt_exist %>"
,
e
.
annot
at
ed_source_code
[
0
].
strip
assert_equal
File
.
expand_path
(
"
#{
FIXTURE_LOAD_PATH
}
/test/_raise.html.erb"
),
e
.
file_name
end
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录