Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
faa5dffb
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
faa5dffb
编写于
4月 13, 2017
作者:
L
Lin Jen-Shin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
After Trace#limit, we seek to the next line in case
of breaking ANSI sequence or Unicode
上级
7629c9ec
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
32 addition
and
3 deletion
+32
-3
lib/gitlab/ci/trace/stream.rb
lib/gitlab/ci/trace/stream.rb
+1
-0
spec/fixtures/trace/ansi-sequence-and-unicode
spec/fixtures/trace/ansi-sequence-and-unicode
+5
-0
spec/lib/gitlab/ci/trace/stream_spec.rb
spec/lib/gitlab/ci/trace/stream_spec.rb
+21
-1
spec/support/fixture_helpers.rb
spec/support/fixture_helpers.rb
+5
-2
未找到文件。
lib/gitlab/ci/trace/stream.rb
浏览文件 @
faa5dffb
...
...
@@ -30,6 +30,7 @@ module Gitlab
last_bytes
=
stream_size
end
stream
.
seek
(
-
last_bytes
,
IO
::
SEEK_END
)
stream
.
readline
end
def
append
(
data
,
offset
)
...
...
spec/fixtures/trace/ansi-sequence-and-unicode
0 → 100644
浏览文件 @
faa5dffb
[0m[01;34m.[0m
[30;42m..[0m
😺
ヾ(´༎ຶД༎ຶ`)ノ
[01;32m許功蓋[0m
spec/lib/gitlab/ci/trace/stream_spec.rb
浏览文件 @
faa5dffb
...
...
@@ -21,7 +21,7 @@ describe Gitlab::Ci::Trace::Stream do
end
end
it
'if size is larger we start from beg
gi
ning'
do
it
'if size is larger we start from beg
in
ning'
do
stream
.
limit
(
10
)
expect
(
stream
.
tell
).
to
eq
(
0
)
...
...
@@ -32,6 +32,26 @@ describe Gitlab::Ci::Trace::Stream do
expect
(
stream
.
tell
).
to
eq
(
6
)
end
context
'when the trace contains ANSI sequence and Unicode'
do
let
(
:stream
)
do
described_class
.
new
do
File
.
open
(
expand_fixture_path
(
'trace/ansi-sequence-and-unicode'
))
end
end
it
'forwards to the next linefeed, case 1'
do
stream
.
limit
(
7
)
expect
(
stream
.
raw
).
to
eq
(
''
)
end
it
'forwards to the next linefeed, case 2'
do
stream
.
limit
(
29
)
expect
(
stream
.
raw
).
to
eq
(
"
\e
[01;32m許功蓋
\e
[0m
\n
"
)
end
end
end
describe
'#append'
do
...
...
spec/support/fixture_helpers.rb
浏览文件 @
faa5dffb
module
FixtureHelpers
def
fixture_file
(
filename
)
return
''
if
filename
.
blank?
file_path
=
File
.
expand_path
(
Rails
.
root
.
join
(
'spec/fixtures/'
,
filename
))
File
.
read
(
file_path
)
File
.
read
(
expand_fixture_path
(
filename
))
end
def
expand_fixture_path
(
filename
)
File
.
expand_path
(
Rails
.
root
.
join
(
'spec/fixtures/'
,
filename
))
end
end
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录