2011-10-25 20:04:31 +02:00
|
|
|
- line_old = 0
|
|
|
|
- line_new = 0
|
2011-10-21 20:40:36 +02:00
|
|
|
- lines_arr = diff.diff.lines.to_a
|
2011-10-25 20:04:31 +02:00
|
|
|
- lines_arr.each do |line|
|
|
|
|
- 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 20:40:36 +02:00
|
|
|
= diff_line(line, line_new, line_old)
|
|
|
|
- if line[0] == "+"
|
|
|
|
- line_new += 1
|
2011-10-26 15:46:25 +02:00
|
|
|
- elsif
|
2011-10-21 20:40:36 +02:00
|
|
|
- line[0] == "-"
|
|
|
|
- line_old += 1
|
2011-10-26 15:46:25 +02:00
|
|
|
- else
|
2011-10-21 20:40:36 +02:00
|
|
|
- line_new += 1
|
|
|
|
- line_old += 1
|
|
|
|
|