Takes two pieces of source text/html and creates a neato html diff output
Ruby
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
examples
lib
test
.document
.gitignore
LICENSE
README.rdoc
Rakefile
VERSION
diffrenderer.gemspec

README.rdoc

DiffRenderer

DiffRenderer creates pretty HTML diffs for text and bits of html documents.

Example Usage

#!/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.

Credits

Original code produced by Rattle (www.rattlecentral.com) with the help of Ashley Moran (github.com/ashleymoran/)

Gemified by robl (www.monkeyhelper.com)

Todo

  • Add some tests

  • Further documentation - description of process, multi-paragraph example

Copyright

Copyright © 2009 Rattle www.rattlecentral.com. See LICENSE for details.