DocDiff primary repository
Clone or download
hisashim Merge pull request #22 from takahashim/ruby2
support only ruby 2.0 or above
Latest commit ab51a34 Jun 21, 2017
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin support only ruby 2.0 or above Jun 20, 2017
devutil Remove devutil/JIS0208.TXT to follow its terms of use; ref #12 Oct 12, 2015
img Added index.html and img/ for the DocDiff website. Oct 14, 2005
lib support only ruby 2.0 or above Jun 20, 2017
sample
test ruby 1.8 is not supported Jun 20, 2017
.gitignore introduce coverage tools, however it works against 1.8 only(as of now). Aug 12, 2011
.travis.yml support only ruby 2.0 or above Jun 20, 2017
Gemfile
Guardfile
Makefile support only ruby 2.0 or above Jun 20, 2017
Rakefile support only ruby 2.0 or above Jun 20, 2017
docdiff.conf.example Added support for ~/.docdiff/docdiff.conf as a user config file. Upda… May 16, 2004
docdiff.gemspec reorganize library file hierarchy Aug 10, 2011
docdiffwebui.cgi support only ruby 2.0 or above Jun 20, 2017
docdiffwebui.html Tweaked the form size. Nov 14, 2005
index.html Update documents for release 0.4.0. Feb 22, 2011
langfilter.rb ruby 1.8 is not supported Jun 20, 2017
readme.html news: 0.5.0 Aug 13, 2011
readme.md add markup Feb 2, 2013

readme.md

DocDiff

2000-12-09..2011-02-23 Hisashi MORITA

Todo

  • Incorporate ignore space patch.
  • Better auto-recognition of encodings and eols.
  • Make CSS and tty escape sequence customizable in config files.
  • Better multilingualization using Ruby 1.9 feature.
  • Write "DocPatch".

Description

Compares two text files by word, by character, or by line

Summary

DocDiff compares two text files and shows the difference. It can compare files word by word, character by character, or line by line. It has several output formats such as HTML, tty, Manued, or user-defined markup.

It supports several encodings and end-of-line characters, including ASCII (and other single byte encodings such as ISO-8859-*), UTF-8, EUC-JP, Shift_JIS, CR, LF, and CRLF.

Requirement

  • Ruby (http://www.ruby-lang.org) (Note that you may need additional ruby library such as iconv, if your OS's Ruby package does not include those.)

Installation

Note that you need appropriate permission for proper installation (you may have to have a root/administrator privilege).

  • Place docdiff/ directory and its contents to ruby library directory, so that ruby interpreter can load them.
# cp -r docdiff /usr/lib/ruby/1.9.1
  • Place docdiff.rb in command binary directory.
# cp docdiff.rb /usr/bin/
  • (Optional) You may want to rename it to docdiff.
# mv /usr/bin/docdiff.rb /usr/bin/docdiff
  • (Optional) When invoked as chardiff or worddiff, docdiff runs with resolution set to char or word, respectively.
# ln -s /usr/bin/docdiff.rb /usr/bin/chardiff.rb
# ln -s /usr/bin/docdiff.rb /usr/bin/worddiff.rb
  • Set appropriate permission.
# chmod +x /usr/bin/docdiff.rb
  • (Optional) If you want site-wide configuration file, place docdiff.conf.example as /etc/docdiff/docdiff.conf and edit it.
# cp docdiff.conf.example /etc/docdiff.conf
# $EDITOR /etc/docdiff.conf
  • (Optional) If you want per-user configuration file, place docdiff.conf.example as ~/etc/docdiff/docdiff.conf and edit it.
% cp docdiff.conf.example ~/etc/docdiff.conf
% $EDITOR ~/etc/docdiff.conf

Usage

Synopsis

% docdiff [options] oldfile newfile

e.g.

% docdiff old.txt new.txt > diff.html

See the help message for detail (docdiff --help).

License

This software is distributed under so-called modified BSD style license (http://www.opensource.org/licenses/bsd-license.php (without advertisement clause)). By contributing to this software, you agree that your contribution may be incorporated under the same license.

Copyright and condition of use of main portion of the source:

Copyright (C) Hisashi MORITA.  All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
   notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
   notice, this list of conditions and the following disclaimer in the
   documentation and/or other materials provided with the distribution.
3. Neither the name of the University nor the names of its contributors
   may be used to endorse or promote products derived from this software
   without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.

diff library (docdiff/diff.rb and docdiff/diff/*) was originally a part of Ruby/CVS by Akira TANAKA. Ruby/CVS is licensed under modified BSD style license. See the following for detail.

Credits

  • Hisashi MORITA (primary author)

Acknowledgments

  • Akira TANAKA (diff library author)
  • Shin'ichiro HARA (initial idea and algorithm suggestion)
  • Masatoshi SEKI (patch)
  • Akira YAMADA (patch, Debian package)
  • Kenshi MUTO (testing, bug report, Debian package)
  • Kazuhiro NISHIYAMA (bug report)
  • Hiroshi OHKUBO (bug report)
  • Shugo MAEDA (bug report)
  • Kazuhiko (patch)

Resources

Format

=== Similar Software

There are several other software that can compare text word by word and/or character by character.