diff options
author | Shinya Maeda <gitlab.shinyamaeda@gmail.com> | 2017-05-22 09:17:08 +0300 |
---|---|---|
committer | Shinya Maeda <gitlab.shinyamaeda@gmail.com> | 2017-05-24 14:10:15 +0300 |
commit | a16387486ae6db94b1aa49310cfc67642b68f23c (patch) | |
tree | 703188ff73f62c97764699e4ba4c38387e3a8a8d /lib | |
parent | 22f1d2a1c46ce9eb2835611c4eac6948bd983488 (diff) |
put force_encoding in def reverse_line
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/ci/trace/stream.rb | 6 |
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) |