put force_encoding in def reverse_line

This commit is contained in:
Shinya Maeda 2017-05-22 15:17:08 +09:00
parent 22f1d2a1c4
commit a16387486a
1 changed files with 3 additions and 3 deletions

View File

@ -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)