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.
B28a3426b4a8ae5ad2302fdf1c6674e8?d=identicon&s=25 Jackster The jackle (jackster)
on 2008-10-16 01:04
Is there an easy way available in Ruby to compare two text files and
report the differences?

thanks

jack
669b7046f02e5dfc4bda4421f1069731?d=identicon&s=25 Alex Fenton (Guest)
on 2008-10-16 01: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
5a837592409354297424994e8d62f722?d=identicon&s=25 Ryan Davis (Guest)
on 2008-10-16 06:47
(Received via mailing list)
On Oct 15, 2008, at 16:44 , Alex Fenton 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"
B28a3426b4a8ae5ad2302fdf1c6674e8?d=identicon&s=25 Jackster The jackle (jackster)
on 2008-10-16 12:15
Ryan Davis wrote:
> he said "easy"


DOAH! :-)
3cb4fdcf13aad6a7dcae83876b0e784e?d=identicon&s=25 Josef 'Jupp' Schugt (Guest)
on 2008-10-16 13:46
(Received via mailing list)
On Thu, 16 Oct 2008 01:04:31 +0200, jackster the jackle
<johnsheahan@sflistdb.com> 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
B28a3426b4a8ae5ad2302fdf1c6674e8?d=identicon&s=25 Jackster The jackle (jackster)
on 2008-10-17 00:23
Josef 'Jupp' Schugt wrote:
> On Thu, 16 Oct 2008 01:04:31 +0200, jackster the jackle
> <johnsheahan@sflistdb.com> 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" :-)
C013a2957327e38e5455748982db5d7b?d=identicon&s=25 Mark Mcbride (markmcb)
on 2008-11-05 07: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...
3cfefffa747cab36a4befb41d13d20b2?d=identicon&s=25 My SchizoBuddy (myschizobuddy)
on 2009-05-31 22:23
how about visual diff like the image
http://tiny.cc/fnbiz
0e8ec04b9738c2709e75a1f30718a46e?d=identicon&s=25 Nathan (Guest)
on 2009-08-20 00:30
(Received via mailing list)
On 2008-11-05 01:16:43 -0500, Mark Mcbride <mark@markmcb.com> 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.