2011-10-25 21:04:31 +03:00
|
|
|
- line_old = 0
|
|
|
|
- line_new = 0
|
2011-10-21 21:40:36 +03:00
|
|
|
- lines_arr = diff.diff.lines.to_a
|
2011-10-25 21:04:31 +03:00
|
|
|
- lines_arr.each do |line|
|
2011-11-30 15:05:37 +08:00
|
|
|
- line = encode(line)
|
2011-10-27 16:50:35 +03:00
|
|
|
- next if line.match(/^--- \/dev\/null/)
|
2011-10-25 21:04:31 +03:00
|
|
|
- next if line.match(/^--- a/)
|
|
|
|
- next if line.match(/^\+\+\+ b/)
|
|
|
|
- if line.match(/^@@ -/)
|
|
|
|
- line_old = line.match(/\-[0-9]*/)[0].to_i.abs rescue 0
|
|
|
|
- line_new = line.match(/\+[0-9]*/)[0].to_i.abs rescue 0
|
|
|
|
- next
|
|
|
|
|
2011-10-21 21:40:36 +03:00
|
|
|
= diff_line(line, line_new, line_old)
|
|
|
|
- if line[0] == "+"
|
|
|
|
- line_new += 1
|
2011-11-09 17:53:15 +04:00
|
|
|
- elsif line[0] == "-"
|
2011-10-21 21:40:36 +03:00
|
|
|
- line_old += 1
|
2011-10-26 18:46:25 +05:00
|
|
|
- else
|
2011-10-21 21:40:36 +03:00
|
|
|
- line_new += 1
|
|
|
|
- line_old += 1
|