Anybody have any suggestions for DIFF?

I searched through the various archives, and also tried nearly all the gems related to diff (I don’t think some of them are Ruby 2.x compatible although they don’t mention that). Anyhow, I have a script that compares two sets of files, finds the matching file (the file names don’t match, so I’m forced to look at the XML and compare a <title> field via nokogiri). Once found, all I really want to do is do something like the unix diff between the two files. I realize I can use %x(diff file1 file2), but that’s not going to work with my windows coworkers. Most of the diff gems I’ve found either make a mess of the output, or are so woefully documented that I couldn’t get the diff to really find the differences between the two files.

Anybody have any luck with any of the gems out there? If so, any hints on getting output that remotely looks like the diff output?

Thanks,
Wayne

diff-lcs requires a bit of digging into the API but it works well. It's even got a command line diff clone built in called "ldiff" -- check out its source code in ldiff.rb (you can find it after install by using "gem which ldiff")

···

On Feb 7, 2014, at 6:05 AM, Wayne Brissette <wbrisett@att.net> wrote:

I searched through the various archives, and also tried nearly all the gems related to diff (I don’t think some of them are Ruby 2.x compatible although they don’t mention that). Anyhow, I have a script that compares two sets of files, finds the matching file (the file names don’t match, so I’m forced to look at the XML and compare a <title> field via nokogiri). Once found, all I really want to do is do something like the unix diff between the two files. I realize I can use %x(diff file1 file2), but that’s not going to work with my windows coworkers. Most of the diff gems I’ve found either make a mess of the output, or are so woefully documented that I couldn’t get the diff to really find the differences between the two files.

Anybody have any luck with any of the gems out there? If so, any hints on getting output that remotely looks like the diff output?

Thanks,
Wayne

There seem to be some XML diff tools out there but I am not aware of any gem.

Kind regards

robert

···

On Fri, Feb 7, 2014 at 12:05 PM, Wayne Brissette <wbrisett@att.net> wrote:

I searched through the various archives, and also tried nearly all the gems related to diff (I don't think some of them are Ruby 2.x compatible although they don't mention that). Anyhow, I have a script that compares two sets of files, finds the matching file (the file names don't match, so I'm forced to look at the XML and compare a <title> field via nokogiri). Once found, all I really want to do is do something like the unix diff between the two files. I realize I can use %x(diff file1 file2), but that's not going to work with my windows coworkers. Most of the diff gems I've found either make a mess of the output, or are so woefully documented that I couldn't get the diff to really find the differences between the two files.

Anybody have any luck with any of the gems out there? If so, any hints on getting output that remotely looks like the diff output?

--
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/

As usual, thanks Robert! I’ll give that a look.

Wayne