Forum: Ruby Diff for 2 Text Files

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Jackster T. (Guest)
on 2008-10-16 03:04
Is there an easy way available in Ruby to compare two text files and
report the differences?

thanks

jack
Alex F. (Guest)
on 2008-10-16 03:45
(Received via mailing list)
jackster the jackle wrote:
> Is there an easy way available in Ruby to compare two text files and
> report the differences?

http://raa.ruby-lang.org/project/diff-lcs/

a
Ryan D. (Guest)
on 2008-10-16 08:47
(Received via mailing list)
On Oct 15, 2008, at 16:44 , Alex F. wrote:

> jackster the jackle wrote:
>> Is there an easy way available in Ruby to compare two text files and
>> report the differences?
>
> http://raa.ruby-lang.org/project/diff-lcs/

he said "easy"
Jackster T. (Guest)
on 2008-10-16 14:15
Ryan D. wrote:
> he said "easy"


DOAH! :-)
Josef 'Jupp' Schugt (Guest)
on 2008-10-16 15:46
(Received via mailing list)
On Thu, 16 Oct 2008 01:04:31 +0200, jackster the jackle
<removed_email_address@domain.invalid> wrote:

> Is there an easy way available in Ruby to compare two text files and
> report the differences?

%x(diff file1 file2) # Unix/Linux

Josef 'Jupp' Schugt
Jackster T. (Guest)
on 2008-10-17 02:23
Josef 'Jupp' Schugt wrote:
> On Thu, 16 Oct 2008 01:04:31 +0200, jackster the jackle
> <removed_email_address@domain.invalid> wrote:
>
>> Is there an easy way available in Ruby to compare two text files and
>> report the differences?
>
> %x(diff file1 file2) # Unix/Linux
>
> Josef 'Jupp' Schugt


now that's what I call "easy" :-)
Mark M. (Guest)
on 2008-11-05 08:18
You can expand on this approach if you're outputting to an html view
too:
http://markmcb.com/2008/11/04/ruby-on-rails-diff-t...
My S. (Guest)
on 2009-06-01 00:23
how about visual diff like the image
http://tiny.cc/fnbiz
Nathan (Guest)
on 2009-08-20 02:30
(Received via mailing list)
On 2008-11-05 01:16:43 -0500, Mark M. <removed_email_address@domain.invalid> 
said:

> You can expand on this approach if you're outputting to an html view
> too:
> http://markmcb.com/2008/11/04/ruby-on-rails-diff-t...

I found a good module for this a long time ago. I keep it on my github,
hoping some day to discover where it actually came from.

http://github.com/myobie/htmldiff/
This topic is locked and can not be replied to.