rosa-build/app/helpers/diff_helper.rb

19 lines
406 B
Ruby
Raw Normal View History

2012-01-30 20:39:34 +00:00
# -*- encoding : utf-8 -*-
2011-03-10 13:33:50 +00:00
module DiffHelper
def render_diff(diff)
diff_display ||= Diff::Display::Unified.new(diff.diff)
#res = "<a name='#{h(diff.a_path)}'></a>"
2011-03-10 13:33:50 +00:00
res = "<table class='diff inline' cellspacing='0' cellpadding='0'>"
res += "<tbody>"
res += diff_display.render(Git::Diff::InlineCallback.new)
res += "</tbody>"
res += "</table>"
2011-03-10 13:33:50 +00:00
res.html_safe
2011-03-10 13:33:50 +00:00
end
2012-01-30 20:39:34 +00:00
end