|
|
|
@ -26,6 +26,7 @@ class CreateDiffRecordService < ApplicationService
|
|
|
|
|
fragment_size = 1
|
|
|
|
|
Rails.logger.info("diff_line_content:#{Diffy::Diff.new(before, after)}")
|
|
|
|
|
Diffy::Diff.new(before, after).each do |line|
|
|
|
|
|
unless line.include?("\\ 文件尾没有 newline 字符")
|
|
|
|
|
unless line =~ /^[\+-]/
|
|
|
|
|
if arr.empty? && index < fragment_size
|
|
|
|
|
content += line
|
|
|
|
@ -44,6 +45,7 @@ class CreateDiffRecordService < ApplicationService
|
|
|
|
|
arr.clear
|
|
|
|
|
Rails.logger.info("diff_line:#{line}")
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
content
|
|
|
|
|
end
|
|
|
|
|
end
|