DiffRenderer creates pretty HTML diffs for text and bits of html documents.
#!/usr/bin/ruby require 'rubygems' require 'diffrenderer' old_text = ['This was some text'] new_text = ['This is some text'] puts DiffRenderer.new(old_text, new_text).to_html
Generates :
<p> This <span class="removed">was</span> <span class="added">is</span> some text </p>
See the examples directory for more details.
Original code produced by Rattle (www.rattlecentral.com) with the help of Ashley Moran (github.com/ashleymoran/)
Gemified by robl (www.monkeyhelper.com)
-
Add some tests
-
Further documentation - description of process, multi-paragraph example
Copyright © 2009 Rattle www.rattlecentral.com. See LICENSE for details.