From: jm Date: 2004-08-02T11:10:47+09:00 Subject: Re: a question on diff modules Thanks. Two things. 1) I get the following while attempting to install Diff::LCS Generating HTML... lcs.rb: mmm......mc............ array.rb: c block.rb: c... callbacks.rb: cc...cc...c....c.....cc. change.rb: c......... event.rb: c. hunk.rb: c............ string.rb: c Generating RI... Couldn't build Ri documentation Unhandled special: Special: type=17, text="Computes" install.rb:171:in `install_binfile': undefined local variable or method `opfile' for main:Object (NameError) from install.rb:25:in `do_bins' from install.rb:23:in `each' from install.rb:23:in `do_bins' from install.rb:205 Not a problem. I just copied lib/diff to the correct spot, but thought I should let you know anyway. In case it helps here's uname's output and rthe ruby version I'm runnung $ uname -a Darwin lemure.local 7.4.0 Darwin Kernel Version 7.4.0: Wed May 12 16:58:24 PDT 2004; root:xnu/xnu-517.7.7.obj~7/RELEASE_PPC Power Macintosh powerpc $ ruby -v ruby 1.8.1 (2003-12-25) [powerpc-darwin] oh, almost forget this is version 1.0.2 of Diff::LCS 2) I think I've spotted a bug consider the following, irb(main):031:0> seqw = %w(abcd efgh ijkl mnopqrstuvwxyz) => ["abcd", "efgh", "ijkl", "mnopqrstuvwxyz"] irb(main):032:0> Diff::LCS.diff(seqw,[]) => [[#, #, #]] irb(main):033:0> Diff::LCS.diff([],seqw) => [[#, #, #, #]] irb(main):034:0> note the lack of "abcd" as a change in line 2. I would have expected the only difference to be "-" to be changed to "+" between the two calls. What happened to position 0 in the first call? J. On 29/07/2004, at 1:51 AM, Austin Ziegler wrote: > On Wed, 28 Jul 2004 15:14:02 +0900, jm wrote: > > A notice that there is a few diff modules of raa. Two questions, > > > > 1) Are any of these the "accepted standard"? > > 2) Can any of these take the original array/string/obj/whatever and > the > > diff it generated and produce the second array that was used to > > generate the diff, ie undo the generated diff? > > 1) No. Algorithm::Diff by Lars is good, but it is GPL-only. Make sure > your licence is compatible. It can do some patching, and I did some > work to do some unpatching on it, but it's not in the released > version. > 2) Diff::LCS 1.1 (coming soon) will support full context patching and > unpatching, but you will have to use a particular sort of call to make > it happen. > > -austin > -- > Austin Ziegler * halostatue@gmail.com > �������������� * Alternate: austin@halostatue.ca