docdiff 0.6.1 → 0.6.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/Makefile +27 -49
  3. data/README.md +351 -0
  4. data/README_ja.md +351 -0
  5. data/Rakefile +2 -42
  6. data/bin/docdiff +66 -29
  7. data/{docdiff.conf.example → doc/example/docdiff.conf.example} +4 -3
  8. data/doc/man/docdiff.adoc +146 -0
  9. data/doc/news.md +180 -0
  10. data/doc/shell_completion/_docdiff.zsh +51 -0
  11. data/doc/shell_completion/docdiff.bash +68 -0
  12. data/docdiff.gemspec +2 -1
  13. data/lib/doc_diff.rb +13 -0
  14. data/lib/docdiff/charstring.rb +4 -3
  15. data/lib/docdiff/diff/unidiff.rb +0 -1
  16. data/lib/docdiff/encoding/en_ascii.rb +12 -39
  17. data/lib/docdiff/encoding/ja_eucjp.rb +12 -39
  18. data/lib/docdiff/encoding/ja_sjis.rb +12 -39
  19. data/lib/docdiff/encoding/ja_utf8.rb +12 -39
  20. data/lib/docdiff/version.rb +1 -1
  21. data/lib/docdiff/view.rb +16 -8
  22. data/test/charstring_test.rb +124 -121
  23. data/test/docdiff_test.rb +5 -3
  24. data/test/document_test.rb +112 -109
  25. data/test/fixture/01_ja_utf8_lf.txt +2 -0
  26. data/test/fixture/02_ja_utf8_lf.txt +2 -0
  27. data/test/view_test.rb +135 -111
  28. metadata +41 -43
  29. data/devutil/changelog.sh +0 -40
  30. data/index.html +0 -181
  31. data/langfilter.rb +0 -10
  32. data/lib/viewdiff.rb +0 -379
  33. data/readme.html +0 -733
  34. data/readme.md +0 -184
  35. data/test/viewdiff_test.rb +0 -911
  36. /data/{docdiffwebui.cgi → doc/example/docdiffwebui.cgi} +0 -0
  37. /data/{docdiffwebui.html → doc/example/docdiffwebui.html} +0 -0
  38. /data/{img/docdiff-screenshot-format-html-digest-firefox.png → doc/img/screenshot-format-html-digest-firefox.png} +0 -0
  39. /data/{img/docdiff-screenshot-format-html-firefox.png → doc/img/screenshot-format-html-firefox.png} +0 -0
  40. /data/{img/docdiff-screenshot-format-tty-cmdexe-en.png → doc/img/screenshot-format-tty-cmdexe-en.png} +0 -0
  41. /data/{img/docdiff-screenshot-format-tty-cmdexe-ja.png → doc/img/screenshot-format-tty-cmdexe-ja.png} +0 -0
  42. /data/{img/docdiff-screenshot-format-tty-rxvtunicode-en.png → doc/img/screenshot-format-tty-rxvtunicode-en.png} +0 -0
  43. /data/{img/docdiff-screenshot-format-tty-rxvtunicode-ja.png → doc/img/screenshot-format-tty-rxvtunicode-ja.png} +0 -0
  44. /data/{img/docdiff-screenshot-format-tty-xterm-en.png → doc/img/screenshot-format-tty-xterm-en.png} +0 -0
  45. /data/{img/docdiff-screenshot-format-tty-xterm-ja.png → doc/img/screenshot-format-tty-xterm-ja.png} +0 -0
  46. /data/{img/docdiff-screenshot-resolution-linewordchar-xterm.png → doc/img/screenshot-resolution-linewordchar-xterm.png} +0 -0
  47. /data/{sample/01.en.ascii.cr → test/fixture/01_en_ascii_cr.txt} +0 -0
  48. /data/{sample/01.en.ascii.crlf → test/fixture/01_en_ascii_crlf.txt} +0 -0
  49. /data/{sample/01.en.ascii.lf → test/fixture/01_en_ascii_lf.txt} +0 -0
  50. /data/{sample/01.ja.eucjp.lf → test/fixture/01_ja_eucjp_lf.txt} +0 -0
  51. /data/{sample/01.ja.sjis.cr → test/fixture/01_ja_sjis_cr.txt} +0 -0
  52. /data/{sample/01.ja.sjis.crlf → test/fixture/01_ja_sjis_crlf.txt} +0 -0
  53. /data/{sample/01.ja.utf8.crlf → test/fixture/01_ja_utf8_crlf.txt} +0 -0
  54. /data/{sample/02.en.ascii.cr → test/fixture/02_en_ascii_cr.txt} +0 -0
  55. /data/{sample/02.en.ascii.crlf → test/fixture/02_en_ascii_crlf.txt} +0 -0
  56. /data/{sample/02.en.ascii.lf → test/fixture/02_en_ascii_lf.txt} +0 -0
  57. /data/{sample/02.ja.eucjp.lf → test/fixture/02_ja_eucjp_lf.txt} +0 -0
  58. /data/{sample/02.ja.sjis.cr → test/fixture/02_ja_sjis_cr.txt} +0 -0
  59. /data/{sample/02.ja.sjis.crlf → test/fixture/02_ja_sjis_crlf.txt} +0 -0
  60. /data/{sample/02.ja.utf8.crlf → test/fixture/02_ja_utf8_crlf.txt} +0 -0
  61. /data/{sample/humpty_dumpty01.ascii.lf → test/fixture/humpty_dumpty01_ascii_lf.txt} +0 -0
  62. /data/{sample/humpty_dumpty02.ascii.lf → test/fixture/humpty_dumpty02_ascii_lf.txt} +0 -0
data/readme.md DELETED
@@ -1,184 +0,0 @@
1
- # DocDiff
2
-
3
- (C) 2000 Hisashi MORITA
4
-
5
- ## Todo
6
-
7
- * Incorporate ignore space patch.
8
- * Better auto-recognition of encodings and eols.
9
- * Make CSS and tty escape sequence customizable in config files.
10
- * Better multilingualization using Ruby 1.9 feature.
11
- * Write "DocPatch".
12
-
13
-
14
- ## Description
15
-
16
- Compares two text files by word, by character, or by line
17
-
18
- ## Summary
19
-
20
- 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.
21
-
22
- 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.
23
-
24
-
25
- ## Requirement
26
-
27
- * Ruby (http://www.ruby-lang.org)
28
- (Note that you may need additional ruby library such as iconv, if your OS's Ruby package does not include those.)
29
-
30
- ## Installation
31
-
32
- Note that you need appropriate permission for proper installation (you may have to have a root/administrator privilege).
33
-
34
- * Place `docdiff/` directory and its contents to ruby library directory, so that ruby interpreter can load them.
35
-
36
- ```
37
- # cp -r docdiff /usr/lib/ruby/1.9.1
38
- ```
39
-
40
- * Place `docdiff.rb` in command binary directory.
41
-
42
- ```
43
- # cp docdiff.rb /usr/bin/
44
- ```
45
-
46
- * (Optional) You may want to rename it to `docdiff`.
47
-
48
- ```
49
- # mv /usr/bin/docdiff.rb /usr/bin/docdiff
50
- ```
51
-
52
- * (Optional) When invoked as `chardiff` or `worddiff`, docdiff runs with resolution set to `char` or `word`, respectively.
53
-
54
- ```
55
- # ln -s /usr/bin/docdiff.rb /usr/bin/chardiff.rb
56
- # ln -s /usr/bin/docdiff.rb /usr/bin/worddiff.rb
57
- ```
58
-
59
- * Set appropriate permission.
60
-
61
- ```
62
- # chmod +x /usr/bin/docdiff.rb
63
- ```
64
-
65
- * (Optional) If you want site-wide configuration file, place `docdiff.conf.example` as `/etc/docdiff/docdiff.conf` and edit it.
66
-
67
- ```
68
- # cp docdiff.conf.example /etc/docdiff.conf
69
- # $EDITOR /etc/docdiff.conf
70
- ```
71
-
72
- * (Optional) If you want per-user configuration file, place `docdiff.conf.example` as `~/etc/docdiff/docdiff.conf` and edit it.
73
-
74
- ```
75
- % cp docdiff.conf.example ~/etc/docdiff.conf
76
- % $EDITOR ~/etc/docdiff.conf
77
- ```
78
-
79
- ## Usage
80
-
81
- ### Synopsis
82
-
83
- % docdiff [options] oldfile newfile
84
-
85
- e.g.
86
-
87
- % docdiff old.txt new.txt > diff.html
88
-
89
- See the help message for detail (`docdiff --help`).
90
-
91
- ## License
92
-
93
- 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.
94
-
95
- Copyright and condition of use of main portion of the source:
96
-
97
- ```
98
- Copyright (C) Hisashi MORITA. All rights reserved.
99
-
100
- Redistribution and use in source and binary forms, with or without
101
- modification, are permitted provided that the following conditions
102
- are met:
103
- 1. Redistributions of source code must retain the above copyright
104
- notice, this list of conditions and the following disclaimer.
105
- 2. Redistributions in binary form must reproduce the above copyright
106
- notice, this list of conditions and the following disclaimer in the
107
- documentation and/or other materials provided with the distribution.
108
- 3. Neither the name of the University nor the names of its contributors
109
- may be used to endorse or promote products derived from this software
110
- without specific prior written permission.
111
-
112
- THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
113
- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
114
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
115
- ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
116
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
117
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
118
- OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
119
- HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
120
- LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
121
- OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
122
- SUCH DAMAGE.
123
- ```
124
-
125
- diff library (`docdiff/diff.rb` and `docdiff/diff/*`) was originally a part of Ruby/CVS by Akira TANAKA.
126
- Ruby/CVS is licensed under modified BSD style license.
127
- See the following for detail.
128
-
129
- * http://raa.ruby-lang.org/list.rhtml?name=ruby-cvs
130
- * http://cvs.m17n.org/~akr/ruby-cvs/
131
-
132
- ## Credits
133
-
134
- * Hisashi MORITA (primary author)
135
-
136
- ## Acknowledgments
137
-
138
- * Akira TANAKA (diff library author)
139
- * Shin'ichiro HARA (initial idea and algorithm suggestion)
140
- * Masatoshi SEKI (patch)
141
- * Akira YAMADA (patch, Debian package)
142
- * Kenshi MUTO (testing, bug report, Debian package)
143
- * Kazuhiro NISHIYAMA (bug report)
144
- * Hiroshi OHKUBO (bug report)
145
- * Shugo MAEDA (bug report)
146
- * Kazuhiko (patch)
147
- * Shintaro Kakutani (patches)
148
- * Masayoshi Takahashi (patches)
149
- * Masakazu Takahashi (patch)
150
- * Hibariya (bug report)
151
- * Hiroshi SHIBATA (patch)
152
-
153
- Excuse us this list is far from complete and fails to acknowledge many
154
- more who have helped us somehow. We really appreciate it.
155
-
156
- ## Resources
157
-
158
- ### Format
159
-
160
- * HTML/XHTML http://www.w3.org
161
- * tty (Graphic rendition using VT100 / ANSI escape sequence)
162
- * VT100: http://vt100.net/docs/tp83/appendixb.html
163
- * ANSI: http://www.tldp.org/HOWTO/Bash-Prompt-HOWTO/x329.html
164
- * Manued (Manuscript Editing language: a proofreading method for text)
165
- * http://www.archi.is.tohoku.ac.jp/~yamauchi/otherprojects/manued/index.shtml
166
-
167
- ### Similar Software
168
-
169
- There are several other software that can compare text word by word and/or character by character.
170
-
171
- * GNU wdiff (Seems to support single byte characters only.)
172
- http://www.gnu.org/directory/GNU/wdiff.html
173
- * cdif by Kazumasa UTASHIRO (Supports several Japanese encodings.)
174
- http://srekcah.org/~utashiro/perl/scripts/cdif
175
- * ediff for Emacsen
176
- http://www.xemacs.org/Documentation/packages/html/ediff.html
177
- * diff-detail for xyzzy, by Hiroshi OHKUBO
178
- http://ohkubo.s53.xrea.com/xyzzy/index.html#diff-detail
179
- * Manuediff (Outputs difference in Manued format.)
180
- http://hibiki.miyagi-ct.ac.jp/~suzuki/comp/export/manuediff.html
181
- * YASDiff (Yet Another Scheme powered diff) by Y. Fujisawa
182
- http://nnri.dip.jp/~yf/cgi-bin/yaswiki2.cgi?name=YASDiff&parentid=0
183
- * WinMerge (GUI diff tool for Windows)
184
- http://winmerge.org/