15

I've looked at diff-lcs ( http://raa.ruby-lang.org/project/diff-lcs ) but it's poorly documented, and appears to be unmaintained.

Are there any good, actively maintained ruby gems for diffing text or html files?

Mike Woodhouse
  • 51,832
  • 12
  • 88
  • 127
samg
  • 3,496
  • 1
  • 25
  • 26
  • What do you not like about diff-lcs? – Bryan Ash Jun 27 '10 at 19:36
  • It's poorly documented, and appears to be unmaintained. It looks like it could be useful for building a convenient diff library on top of, but I haven't been able to find a way to print a diff of two strings. – samg Jun 27 '10 at 20:29

3 Answers3

22

I looked around and couldn't find an existing gem or library that offered a convenient way to generate diff style output from ruby.

I just released diffy which does what I want. It's a lightweight wrapper around diff which lets you generate text or html diffs from two strings, without a lot of fuss. I hope others find it useful. It's in use on wiff.me for anyone wants to preview the html output.

samg
  • 3,496
  • 1
  • 25
  • 26
6

I did some very recent searching and discovered that diff-lcs is an actively supported library again. It is now hosted at halostatue/diff-lcs on GitHub. The recent activity seems to be because one of the authors of Grit, the object-oriented git library for Ruby, added it as a dependency. Grit runs gollom, the GitHub wiki system. If GitHub is a supporter of the library then it's probably safe to say that diff-lcs will remain active for a long time.

Brent Matzelle
  • 4,073
  • 3
  • 28
  • 27