diff options
author | gitlabhq <m@gitlabhq.com> | 2011-10-21 22:40:36 +0400 |
---|---|---|
committer | gitlabhq <m@gitlabhq.com> | 2011-10-22 15:08:03 +0400 |
commit | 1a9531c9a42e380d922de98ad1658e85ac5fbde6 (patch) | |
tree | 37c77036ac3877068e26b94beda075c2f41de9dc /app/views/commits/_text_file.html.haml | |
parent | 29e11d1461a5689ff295adb035e38564701ad377 (diff) |
fix #140, commit lil refactor
Diffstat (limited to 'app/views/commits/_text_file.html.haml')
-rw-r--r-- | app/views/commits/_text_file.html.haml | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/app/views/commits/_text_file.html.haml b/app/views/commits/_text_file.html.haml new file mode 100644 index 00000000000..b20aa8afe40 --- /dev/null +++ b/app/views/commits/_text_file.html.haml @@ -0,0 +1,15 @@ +- 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| + = diff_line(line, line_new, line_old) + - if line[0] == "+" + - line_new += 1 + - elsif + - line[0] == "-" + - line_old += 1 + - else + - line_new += 1 + - line_old += 1 + |