summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShinya Maeda <gitlab.shinyamaeda@gmail.com>2017-05-22 15:17:08 +0900
committerShinya Maeda <gitlab.shinyamaeda@gmail.com>2017-05-24 20:10:15 +0900
commita16387486ae6db94b1aa49310cfc67642b68f23c (patch)
tree703188ff73f62c97764699e4ba4c38387e3a8a8d
parent22f1d2a1c46ce9eb2835611c4eac6948bd983488 (diff)
downloadgitlab-ce-a16387486ae6db94b1aa49310cfc67642b68f23c.tar.gz
put force_encoding in def reverse_line
-rw-r--r--lib/gitlab/ci/trace/stream.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/gitlab/ci/trace/stream.rb b/lib/gitlab/ci/trace/stream.rb
index c2abe37f003..45b32e4a7f2 100644
--- a/lib/gitlab/ci/trace/stream.rb
+++ b/lib/gitlab/ci/trace/stream.rb
@@ -74,7 +74,7 @@ module Gitlab
match = ""
reverse_line do |line|
- matches = line.force_encoding(regex.encoding).scan(regex)
+ matches = line.scan(regex)
next unless matches.is_a?(Array)
next if matches.empty?
@@ -108,11 +108,11 @@ module Gitlab
buf = stream.read(read_size) + debris
debris, *lines = buf.each_line.to_a
lines.reverse_each do |line|
- yield(line)
+ yield(line.force_encoding('UTF-8'))
end
end
- yield(debris)
+ yield(debris.force_encoding('UTF-8'))
end
def calc_read_size(pos, max)