Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
a6f6056c
Commit
a6f6056c
authored
May 17, 2017
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use force_encoding when regex contains UTF-8 char
parent
b9950c22
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
lib/gitlab/ci/trace/stream.rb
lib/gitlab/ci/trace/stream.rb
+1
-1
spec/lib/gitlab/ci/trace/stream_spec.rb
spec/lib/gitlab/ci/trace/stream_spec.rb
+3
-3
No files found.
lib/gitlab/ci/trace/stream.rb
View file @
a6f6056c
...
...
@@ -74,7 +74,7 @@ module Gitlab
match
=
""
reverse_line
do
|
line
|
matches
=
line
.
scan
(
regex
)
matches
=
line
.
force_encoding
(
Encoding
.
default_external
).
scan
(
regex
)
next
unless
matches
.
is_a?
(
Array
)
next
if
matches
.
empty?
...
...
spec/lib/gitlab/ci/trace/stream_spec.rb
View file @
a6f6056c
...
...
@@ -266,14 +266,14 @@ describe Gitlab::Ci::Trace::Stream do
end
context
'when regex is multi-byte char'
do
let
(
:data
)
{
'ゴッドファット\n'
}
let
(
:regex
)
{
'ゴッドファット'
}
let
(
:data
)
{
'
95.0
ゴッドファット\n'
}
let
(
:regex
)
{
'
\d+\.\d+
ゴッドファット'
}
before
do
stub_const
(
'Gitlab::Ci::Trace::Stream::BUFFER_SIZE'
,
5
)
end
it
{
is_expected
.
to
be_nil
}
it
{
is_expected
.
to
eq
(
'95.0'
)
}
end
context
'when BUFFER_SIZE is equal to stream.size'
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment