From: James Gray Date: 2009-02-26T02:55:12+09:00 Subject: Re: require 'diff/lcs/Array' On Feb 25, 2009, at 11:17 AM, Venkat Kumar wrote: > I need compare two text files. I should require 'diff/lcs/Array' > when i > do this iam getting error. I've tried using that library in the past, but its interface just makes it crazy hard to work with. Now I would just do something like: diff = `diff -u #{shell_escape path1} #{shell_escape path2} 2>&1` I would define shell_escape() as something like: def shell_escape(str) String(str).gsub(/(?=[^a-zA-Z0-9_.\/\-\x7F-\xFF\n])/n, '\\'). gsub(/\n/, "'\n'"). sub(/^$/, "''") end Hope that helps. James Edward Gray II