fixed diff issue

This commit is contained in:
Dmitriy Zaporozhets 2011-10-25 21:07:39 +03:00
parent 1d69788099
commit 23187d60c4

View file

@ -1,8 +1,14 @@
- line_old = 0
- line_new = 0
- lines_arr = diff.diff.lines.to_a
- line_old = lines_arr[2].match(/-(\d)/)[0].to_i.abs rescue 0
- line_new = lines_arr[2].match(/\+(\d)/)[0].to_i.abs rescue 0
- lines = lines_arr[3..-1].join
- lines.each_line do |line|
- 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
= diff_line(line, line_new, line_old)
- if line[0] == "+"
- line_new += 1