Diff tool in Ruby with HTML output


#1

Hello,

Anyone knows of any tool that can generate a diff between two files
and output HTML code that i could use in a page?

Doesn’t need to be a Ruby tool, any Unix compatible tool would do the
trick, I just need it to output HTML.

Maurício Linhares
http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/
(en)


#2

$ irb

echo "testing 123\ntesting" > ./file1.txt
=> “”

echo "testing 123\nhey, something new\ntesting" > ./file2.txt
=> “”

puts “

\n#{diff -cws file1.txt file2.txt}\n
*** file1.txt  2009-02-09 10:25:44.000000000 -0800
--- file2.txt  2009-02-09 10:28:31.000000000 -0800
***************
*** 1,2 ****
--- 1,3 ----
  testing 123
+ hey, something new
  testing


=> nil

Jeff

On Feb 8, 12:08 pm, Maurício Linhares removed_email_address@domain.invalid


#3

I was looking for something that could turn the diff output into nice
HTML, but thanks anyway.

Maurício Linhares
http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/
(en)