_text_file.html.haml 505 Bytes
Newer Older
gitlabhq's avatar
gitlabhq committed
1 2
- line_old = 0
- line_new = 0
gitlabhq's avatar
gitlabhq committed
3
- lines_arr = diff.diff.lines.to_a
gitlabhq's avatar
gitlabhq committed
4 5 6 7 8 9 10 11
- 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

gitlabhq's avatar
gitlabhq committed
12 13 14
  = diff_line(line, line_new, line_old)
  - if line[0] == "+"
    - line_new += 1
Nihad Abbasov's avatar
Nihad Abbasov committed
15
  - elsif
gitlabhq's avatar
gitlabhq committed
16 17
    - line[0] == "-"
    - line_old += 1
Nihad Abbasov's avatar
Nihad Abbasov committed
18
  - else
gitlabhq's avatar
gitlabhq committed
19 20 21
    - line_new += 1
    - line_old += 1