diff-lcs 1.5.1 → 2.0.0

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 (132) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +581 -0
  3. data/CODE_OF_CONDUCT.md +166 -0
  4. data/CONTRIBUTING.md +127 -0
  5. data/CONTRIBUTORS.md +59 -0
  6. data/LICENCE.md +68 -0
  7. data/Manifest.txt +99 -35
  8. data/README.md +105 -0
  9. data/Rakefile +107 -96
  10. data/SECURITY.md +36 -0
  11. data/integration/compare/array_diff_spec.rb +10 -0
  12. data/integration/compare/hash_diff_spec.rb +25 -0
  13. data/integration/compare/string_diff_spec.rb +10 -0
  14. data/integration/rspec_differ_spec.rb +26 -0
  15. data/integration/rspec_expectations_spec.rb +32 -0
  16. data/integration/runner +20 -0
  17. data/lib/diff/lcs/block.rb +29 -24
  18. data/lib/diff/lcs/callbacks.rb +240 -242
  19. data/lib/diff/lcs/change.rb +102 -104
  20. data/lib/diff/lcs/hunk.rb +110 -157
  21. data/lib/diff/lcs/internals.rb +92 -96
  22. data/lib/diff/lcs/ldiff.rb +81 -73
  23. data/lib/diff/lcs/version.rb +7 -0
  24. data/lib/diff/lcs.rb +440 -466
  25. data/{docs → licenses}/artistic.txt +1 -1
  26. data/licenses/dco.txt +34 -0
  27. data/spec/hunk_spec.rb +33 -46
  28. data/spec/issues_spec.rb +32 -32
  29. data/spec/lcs_spec.rb +6 -6
  30. data/spec/ldiff_spec.rb +27 -16
  31. data/spec/patch_spec.rb +1 -1
  32. data/spec/spec_helper.rb +98 -108
  33. data/test/fixtures/123_x +2 -0
  34. data/test/fixtures/456_x +2 -0
  35. data/test/fixtures/empty +0 -0
  36. data/test/fixtures/file1.bin +0 -0
  37. data/test/fixtures/file2.bin +0 -0
  38. data/test/fixtures/four_lines +4 -0
  39. data/test/fixtures/four_lines_with_missing_new_line +4 -0
  40. data/test/fixtures/ldiff/diff.missing_new_line1-e +1 -0
  41. data/test/fixtures/ldiff/diff.missing_new_line1-f +1 -0
  42. data/test/fixtures/ldiff/diff.missing_new_line2-e +1 -0
  43. data/test/fixtures/ldiff/diff.missing_new_line2-f +1 -0
  44. data/test/fixtures/ldiff/error.diff.chef-e +2 -0
  45. data/test/fixtures/ldiff/error.diff.chef-f +2 -0
  46. data/test/fixtures/ldiff/error.diff.missing_new_line1-e +1 -0
  47. data/test/fixtures/ldiff/error.diff.missing_new_line1-f +1 -0
  48. data/test/fixtures/ldiff/error.diff.missing_new_line2-e +1 -0
  49. data/test/fixtures/ldiff/error.diff.missing_new_line2-f +1 -0
  50. data/test/fixtures/ldiff/output.diff-c +7 -0
  51. data/test/fixtures/ldiff/output.diff-u +5 -0
  52. data/test/fixtures/ldiff/output.diff.bin1 +0 -0
  53. data/test/fixtures/ldiff/output.diff.bin1-c +0 -0
  54. data/test/fixtures/ldiff/output.diff.bin1-e +0 -0
  55. data/test/fixtures/ldiff/output.diff.bin1-f +0 -0
  56. data/test/fixtures/ldiff/output.diff.bin1-u +0 -0
  57. data/test/fixtures/ldiff/output.diff.bin2 +1 -0
  58. data/test/fixtures/ldiff/output.diff.bin2-c +1 -0
  59. data/test/fixtures/ldiff/output.diff.bin2-e +1 -0
  60. data/test/fixtures/ldiff/output.diff.bin2-f +1 -0
  61. data/test/fixtures/ldiff/output.diff.bin2-u +1 -0
  62. data/{spec → test}/fixtures/ldiff/output.diff.chef-c +2 -2
  63. data/test/fixtures/ldiff/output.diff.chef-u +9 -0
  64. data/{spec → test}/fixtures/ldiff/output.diff.chef2-c +2 -2
  65. data/{spec → test}/fixtures/ldiff/output.diff.chef2-u +2 -2
  66. data/test/fixtures/ldiff/output.diff.empty.vs.four_lines +5 -0
  67. data/test/fixtures/ldiff/output.diff.empty.vs.four_lines-c +9 -0
  68. data/test/fixtures/ldiff/output.diff.empty.vs.four_lines-e +6 -0
  69. data/test/fixtures/ldiff/output.diff.empty.vs.four_lines-f +6 -0
  70. data/test/fixtures/ldiff/output.diff.empty.vs.four_lines-u +7 -0
  71. data/test/fixtures/ldiff/output.diff.four_lines.vs.empty +5 -0
  72. data/test/fixtures/ldiff/output.diff.four_lines.vs.empty-c +9 -0
  73. data/test/fixtures/ldiff/output.diff.four_lines.vs.empty-e +1 -0
  74. data/test/fixtures/ldiff/output.diff.four_lines.vs.empty-f +1 -0
  75. data/test/fixtures/ldiff/output.diff.four_lines.vs.empty-u +7 -0
  76. data/test/fixtures/ldiff/output.diff.issue95_trailing_context +4 -0
  77. data/test/fixtures/ldiff/output.diff.issue95_trailing_context-c +9 -0
  78. data/{spec/fixtures/ldiff/output.diff-e → test/fixtures/ldiff/output.diff.issue95_trailing_context-e} +1 -1
  79. data/{spec/fixtures/ldiff/output.diff-f → test/fixtures/ldiff/output.diff.issue95_trailing_context-f} +1 -1
  80. data/test/fixtures/ldiff/output.diff.issue95_trailing_context-u +6 -0
  81. data/test/fixtures/ldiff/output.diff.missing_new_line1 +5 -0
  82. data/test/fixtures/ldiff/output.diff.missing_new_line1-c +14 -0
  83. data/test/fixtures/ldiff/output.diff.missing_new_line1-e +0 -0
  84. data/test/fixtures/ldiff/output.diff.missing_new_line1-f +0 -0
  85. data/test/fixtures/ldiff/output.diff.missing_new_line1-u +9 -0
  86. data/test/fixtures/ldiff/output.diff.missing_new_line2 +5 -0
  87. data/test/fixtures/ldiff/output.diff.missing_new_line2-c +14 -0
  88. data/test/fixtures/ldiff/output.diff.missing_new_line2-e +0 -0
  89. data/test/fixtures/ldiff/output.diff.missing_new_line2-f +0 -0
  90. data/test/fixtures/ldiff/output.diff.missing_new_line2-u +9 -0
  91. data/test/test_block.rb +34 -0
  92. data/test/test_change.rb +234 -0
  93. data/test/test_diff.rb +53 -0
  94. data/test/test_helper.rb +225 -0
  95. data/test/test_hunk.rb +72 -0
  96. data/test/test_issues.rb +168 -0
  97. data/test/test_lcs.rb +47 -0
  98. data/test/test_ldiff.rb +89 -0
  99. data/test/test_patch.rb +362 -0
  100. data/test/test_sdiff.rb +167 -0
  101. data/test/test_traverse_balanced.rb +322 -0
  102. data/test/test_traverse_sequences.rb +187 -0
  103. metadata +211 -103
  104. data/.rspec +0 -1
  105. data/Code-of-Conduct.md +0 -74
  106. data/Contributing.md +0 -121
  107. data/History.md +0 -431
  108. data/License.md +0 -41
  109. data/README.rdoc +0 -84
  110. data/bin/htmldiff +0 -35
  111. data/lib/diff/lcs/backports.rb +0 -9
  112. data/lib/diff/lcs/htmldiff.rb +0 -158
  113. data/spec/fixtures/ldiff/output.diff-c +0 -7
  114. data/spec/fixtures/ldiff/output.diff-u +0 -5
  115. data/spec/fixtures/ldiff/output.diff.chef-e +0 -3
  116. data/spec/fixtures/ldiff/output.diff.chef-f +0 -3
  117. data/spec/fixtures/ldiff/output.diff.chef-u +0 -9
  118. data/spec/fixtures/ldiff/output.diff.chef2-e +0 -7
  119. data/spec/fixtures/ldiff/output.diff.chef2-f +0 -7
  120. /data/{docs → licenses}/COPYING.txt +0 -0
  121. /data/{spec → test}/fixtures/aX +0 -0
  122. /data/{spec → test}/fixtures/bXaX +0 -0
  123. /data/{spec → test}/fixtures/ds1.csv +0 -0
  124. /data/{spec → test}/fixtures/ds2.csv +0 -0
  125. /data/{spec → test}/fixtures/ldiff/output.diff +0 -0
  126. /data/{spec → test}/fixtures/ldiff/output.diff.chef +0 -0
  127. /data/{spec → test}/fixtures/ldiff/output.diff.chef2 +0 -0
  128. /data/{spec → test}/fixtures/ldiff/output.diff.chef2-d +0 -0
  129. /data/{spec → test}/fixtures/new-chef +0 -0
  130. /data/{spec → test}/fixtures/new-chef2 +0 -0
  131. /data/{spec → test}/fixtures/old-chef +0 -0
  132. /data/{spec → test}/fixtures/old-chef2 +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3538bd306feb87c5a2d957b3956a9b8ede2a2782db387f9f253115053c2066a1
4
- data.tar.gz: af8dd06512d39de79534212726c6ed9beba9560e110a1026666181a21dbb5dcb
3
+ metadata.gz: b8edc3b3383f33e30269bdef56fd21d58ac8efe471bb202f129d659a4f1a5ead
4
+ data.tar.gz: 681426cabb34022d55a8335b4dcf095dc5b97faeddc4bbe82793a2cba36c6729
5
5
  SHA512:
6
- metadata.gz: 3598cd0dc37b22112495d82949a3d846751ca2dc3717dffe313acf6740761df98ed6d9f158ebc1fc7be6739bb3ac774ee3d8a0c4ccb4f2f651aaa5c45b49e9d9
7
- data.tar.gz: 77f4c9705752143e88953395b991d4105de3e744f524421ff9a3933aa18febf82854462835ede955b72c62884143f27b9278f968f4629f40bbce2192ca44aa5b
6
+ metadata.gz: db895eb27c2215803f6da307375044c456fe7a09250d86d3be8fd176e22cc6aef71d3767fd6901c62c3a9a5c1035e282570a535fe365bff8af9ce1459d937687
7
+ data.tar.gz: 948fd71bb838124c75c594921a5225358785b40d36d4b3bae60bd0d17914f1b3aa9ab71715e25c488028a67fb660a41808036ffa955b3802505dc9dce83d13fc
data/CHANGELOG.md ADDED
@@ -0,0 +1,581 @@
1
+ # Changelog
2
+
3
+ ## 2.0.0 / 2026-02-01
4
+
5
+ This release has significant **breaking changes**.
6
+
7
+ - diff-lcs 2 supports Ruby 3.2 or higher. This allowed:
8
+
9
+ - readability improvements (endless methods, pattern matching);
10
+
11
+ - support for immutable Data classes (`Diff::LCS::Block`, `Diff::LCS::Change`,
12
+ and `Diff::LCS::ContextChange`);
13
+
14
+ - removal of compatibility shims;
15
+
16
+ - reduction in conditional tests in loops, especially for String character
17
+ extraction (compare `string ? seq[i, 1] : seq[i]` to `seq[i]`); and
18
+
19
+ - optimizations to string and relying on standard encoding support present
20
+ since Ruby 2.1.
21
+
22
+ The primary API (methods and class methods on `Diff::LCS`) has not changed,
23
+ with one exception noted below. Internal APIs (including `Diff::LCS::Block`,
24
+ `Diff::LCS::Change`, `Diff::LCS::ContextChange`, and `Diff::LCS::Hunk`) have
25
+ changed for compatibility.
26
+
27
+ - The `htmldiff` binary and supporting code have been removed without
28
+ replacement.
29
+
30
+ - `ldiff` no longer supports `ed`-script output (`ed` and `reverse_ed` formats).
31
+ As Baptiste Courtois says in [#108][pull-108], the "implementation was broken
32
+ for a while and no-one reported it."
33
+
34
+ - The method `Diff::LCS.LCS` has been removed as an alias for `Diff::LCS.lcs`.
35
+ Most callers are using `Diff::LCS.lcs` and modern Ruby did-you-mean support
36
+ should assist with this update.
37
+
38
+ - `Diff::LCS::Change` objects implemented the comparison operator (`<=>`)
39
+ incorrectly. Comparisons are now done so that the `position` is compared
40
+ first, then the `action` (by index of `VALID_ACTIONS`), and finally the
41
+ element. `Diff::LCS::ContextChange` works similarly, comparing the old and new
42
+ positions prior to comparing the actions by index.
43
+
44
+ The order of `VALID_ACTIONS` was changed for the index order to make sense.
45
+
46
+ - `ldiff` now implements `-` as a filename option for standard input. This is
47
+ used for integration testing with RSpec like this:
48
+
49
+ ```console
50
+ rspec -Ilib -rdiff/lcs integration/failure/array_diff_spec.rb 2>&1 |
51
+ ruby -Ilib bin/ldiff -U integration/golden/array_diff.txt -
52
+ ```
53
+
54
+ - diff-lcs no longer uses RSpec as its test suite, but instead uses Minitest.
55
+ The conversion to Minitest and the new RSpec integration tests
56
+ (`rake integration`) were written with the assistance of [Kiro][kiro] and
57
+ verified manually, with portions changed as required.
58
+
59
+ - The code of conduct was updated to the Contributor Covenant 3.0.
60
+
61
+ ## 1.6.2 / 2025-05-12
62
+
63
+ - Handle upcoming changes to the `cgi` gem in Ruby 3.5 ([#147][pull-147])
64
+
65
+ - Fix issues found with `htmldiff` in Ruby 1.8 (which is used approximately
66
+ never, since the code change which broke Ruby 1.8 was made 6 years ago).
67
+ [#148][pull-148]
68
+
69
+ - Fixed some standardrb formatting and configuration issues.
70
+
71
+ ## 1.6.1 / 2025-03-25
72
+
73
+ - Performed further work on `Diff::LCS::Ldiff` improvements ([#46][issue-46])
74
+ and resolve several thread safety issues cleanly by making it a class.
75
+ [#129][pull-129]
76
+
77
+ - Restructure the project to be more consistent with the rest of the projects
78
+ that I manage.
79
+
80
+ - Increased GitHub action security.
81
+
82
+ - Added [trusted publishing][tp] for fully automated releases.
83
+
84
+ ## 1.6.0 / 2025-02-13
85
+
86
+ - Baptiste Courtois ([@annih][gh-user-annih]) has done significant work on
87
+ making `bin/ldiff` work better, contributing a number of issues and pull
88
+ requests. These include:
89
+
90
+ - Separation of command parsing from diff-generation in `Diff::LCS::Ldiff`
91
+ code extraction making it easier to use separately from the `bin/ldiff`
92
+ command in [#103][pull-103]. This partially resolves [#46][issue-46].
93
+
94
+ - Improvement of binary and empty file detection and tests in [#104][pull-104]
95
+ and [#105][pull-105]. This resolves issues [#100][issue-100],
96
+ [#102][issue-102].
97
+
98
+ - Various ldiff fixes for output [#101][pull-101] resolves issues
99
+ [#106][issue-106] (ldiff ed scripts are inverted), [#107][issue-107] (ldiff
100
+ hunk ranges are incorrect; regression or incorrect fix for [#60][issue-60]),
101
+ and [#95][issue-95].
102
+
103
+ - Patrick Linnane fixed various minor typos. [#93][pull-93]
104
+
105
+ - Mark Young added a Changelog link to the RubyGems metadata. [#92][pull-92]
106
+ This has been modified to incorporate it into the README.
107
+
108
+ - Updated the documentation on `Diff::LCS#lcs` to be clearer about the
109
+ requirements for object equality comparison. This resolves [#70][issue-70].
110
+
111
+ - Governance:
112
+
113
+ Changes described here are effective 2024-12-31.
114
+
115
+ - Update gem management details to use markdown files for everything, enabled
116
+ in part by [flavorjones/hoe-markdown][hoe-markdown]. Several files were
117
+ renamed to be more consistent with standard practices.
118
+
119
+ - Updated security notes with an [age][age] public key rather than pointing to
120
+ Keybase.io and a PGP public key which I no longer use. The use of the
121
+ [Tidelift security contact][tidelift] is recommended over direct disclosure.
122
+
123
+ ## 1.5.1 / 2024-01-31
124
+
125
+ - Peter Goldstein updated CI configuration to add Ruby 3.1 and Masato Nakamura
126
+ added Ruby 3.2 and 3.3. [#82][pull-82], [#89][pull-89]
127
+
128
+ - Switched to [standard ruby][standard ruby] formatting.
129
+
130
+ - Justin Steele converted the licence file to Markdown. [#84][pull-84]
131
+
132
+ - Updated the gem SPDX identifier for GPL 2.0 or later, resolving [#86][pull-86]
133
+ by Vit Ondruch.
134
+
135
+ - Resolve a potential security issue with `ldiff` in its use of `IO.read`
136
+ instead of `File.read`. [#91][issue-91]
137
+
138
+ - Added MFA authentication requirement for release to RubyGems. [#90][pull-90]
139
+
140
+ - Added Dependabot management for actions and gems. [#90][pull-90]
141
+
142
+ - Updated CodeQL configuration. [#90][pull-90]
143
+
144
+ ## 1.5.0 / 2021-12-23
145
+
146
+ - Updated the CI configuration and monkey-patch Hoe.
147
+
148
+ - Kenichi Kamiya fixed a test configuration deprecation in SimpleCov.
149
+ [#69][pull-69]
150
+
151
+ - Tien introduced several corrections and code improvements:
152
+
153
+ - Removed an off-by-one error when calculating an index value by embracing
154
+ Ruby iteration properly. This had a side-effect of fixing a long-standing
155
+ bug in `#traverse_sequences` where the traversal would not be transitive.
156
+ That is, `LCS(s2, s1)` should produce a sequence that is transitive with
157
+ `LCS(s1, s2)` on traversal, and applying the diff computed from those
158
+ results would result in equivalent changes that could be played forward or
159
+ backward as appropriate. [#71][pull-71], [#75][pull-75]
160
+
161
+ - The above fix resulted in a changed order of the longest common subsequence
162
+ when callbacks were applied. After analysis, it was determined that the
163
+ computed subsequence was _equivalent_ to the prior version, so the test was
164
+ updated. This also resulted in the clarification of documentation when
165
+ traversing the sub-sequences. [#79][pull-79]
166
+
167
+ - An infinite loop case in the case where `Diff::LCS` would be included into
168
+ an enumerable class has been fixed. [#73][pull-73]
169
+
170
+ - Clarified the purpose of a threshold test in calculation of LCS.
171
+ [#72][pull-72], [#80][pull-80]
172
+
173
+ - Removed autotest directory
174
+
175
+ ## 1.4.4 / 2020-07-01
176
+
177
+ - Fixed an issue reported by Jun Aruga in the `Diff::LCS::Ldiff` binary text
178
+ detection. [#44][issue-44]
179
+
180
+ - Fixed a theoretical issue reported by Jun Aruga in `Diff::LCS::Hunk` to raise
181
+ a more useful exception. [#43][issue-43]
182
+
183
+ - Added documentation that should address custom object issues as reported in
184
+ [#35][issue-35].
185
+
186
+ - Fixed more diff errors, in part reported in [#65][issue-65].
187
+
188
+ - The use of `Numeric#abs` is incorrect in `Diff::LCS::Block#diff_size`. The
189
+ diff size _must_ be accurate for correct change placement.
190
+
191
+ - When selecting `@max_diff_size` in `Diff::LCS::Hunk`, choose it based on
192
+ `block.diff_size.abs`.
193
+
194
+ - Made a number of changes that will, unfortunately, increase allocations at
195
+ the cost of being safe with frozen strings.
196
+
197
+ - Add some knowledge that when `Diff::LCS::Hunk#diff` is called, that we are
198
+ processing the _last_ hunk, so some changes will be made to how the output
199
+ is generated.
200
+
201
+ - `old`, `ed`, and `reverse_ed` formats have no differences.
202
+
203
+ - `unified` format will report `` given the
204
+ correct conditions, at most once. Unified range reporting also differs for
205
+ the last hunk such that the `length` of the range is reduced by one.
206
+
207
+ - `context` format will report `\No newline at end of file` given the
208
+ correct conditions, up to once per "file". Context range reporting also
209
+ differs for the last hunk such that the `end` part of the range is reduced
210
+ by one to a minimum of one.
211
+
212
+ - Added a bunch more tests for the cases above, and fixed `hunk_spec.rb` so that
213
+ the phrase being compared isn't nonsense French.
214
+
215
+ - Updated formatting.
216
+
217
+ - Added a Rake task to assist with manual testing on Ruby 1.8.
218
+
219
+ ## 1.4.3 / 2020-06-29
220
+
221
+ - Fixed several issues with 1.4 on Rubies older than 2.0. Some of this was
222
+ providing useful shim functions to Hoe 3.x (which dropped these older Rubies a
223
+ while ago). Specifically:
224
+
225
+ - Removed Array#lazy from a method in `Diff::LCS::Hunk`.
226
+
227
+ - Changed some unit tests to use old-style Symbol-keyed hashes.
228
+
229
+ - Changed some unit test helper functions to no longer use keyword parameters,
230
+ but only a trailing options hash.
231
+
232
+ - Made the use of `psych` dependent on `RUBY_VERSION >= 1.9`.
233
+
234
+ Resolves [#63][issue-63].
235
+
236
+ ## 1.4.2 / 2020-06-23
237
+
238
+ - Camille Drapier fixed a small issue with RuboCop configuration. [#59][pull-59]
239
+
240
+ - Applied another fix (and unit test) to fix an issue for the Chef team.
241
+ [#60][issue-60], [#61][pull-61]
242
+
243
+ ## 1.4.1 / 2020-06-23
244
+
245
+ - Fix an issue where diff sizes could be negative, and they should be.
246
+ [#57][issue-57], [#58][pull-58]
247
+
248
+ ## 1.4 / 2020-06-23
249
+
250
+ - Ruby versions lower than 2.4 are soft-deprecated and will not be run as part
251
+ of the CI process any longer.
252
+
253
+ - Akinora MUSHA (knu) added the ability for `Diff::LCS::Change` objects to be
254
+ implicitly treated arrays. Originally provided as pull request [#47][pull-47],
255
+ but it introduced a number of test failures as documented in [#48][issue-48],
256
+ and remediation of `Diff::LCS` itself was introduced in [#49][pull-49].
257
+
258
+ - Resolved [#5][issue-05] with some tests comparing output from `system` calls
259
+ to `bin/ldiff` with some pre-generated output. Resolved [#6][issue-06] with
260
+ these tests.
261
+
262
+ - Resolved a previously undetected `bin/ldiff` issue with `--context` output not
263
+ matching `diff --context` output.
264
+
265
+ - Resolved an issue with later versions of Ruby not working with an `OptParse`
266
+ specification of `Numeric`; this has been changed to `Integer`.
267
+
268
+ - Brandon Fish added TruffleRuby in [#52][pull-52].
269
+
270
+ - Fixed two missing classes as reported in [#53][issue-53].
271
+
272
+ ## 1.3 / 2017-01-18
273
+
274
+ - Bugs fixed:
275
+
276
+ - Fixed an error for `bin/ldiff --version`. Fixes issue [#21][issue-21].
277
+
278
+ - Force `Diff::LCS::Change` and `Diff::LCS::ContextChange` to only perform
279
+ equality comparisons against themselves. Provided by Kevin Mook in pull
280
+ request [#29][pull-29].
281
+
282
+ - Fix tab expansion in `htmldiff`, provided by Mark Friedgan in pull request
283
+ [#25][pull-25].
284
+
285
+ - Silence Ruby 2.4 `Fixnum` deprecation warnings. Fixes issue [#38][issue-38]
286
+ and pull request [#36][pull-36].
287
+
288
+ - Ensure that test dependencies are loaded properly. Fixes issue
289
+ [#33][issue-33] and pull request [#34][pull-34].
290
+
291
+ - Fix issue [#1][issue-01] with incorrect intuition of patch direction.
292
+ Tentative fix, but the previous failure cases pass now.
293
+
294
+ - Tooling changes:
295
+
296
+ - Added SimpleCov and Coveralls support.
297
+
298
+ - Change the homepage (temporarily) to the GitHub repo.
299
+
300
+ - Updated testing and gem infrastructure.
301
+
302
+ - Modernized the specs.
303
+
304
+ - Cleaned up documentation.
305
+
306
+ - Added a Code of Conduct.
307
+
308
+ ## 1.2.5 / 2013-11-08
309
+
310
+ - Bugs fixed:
311
+
312
+ - Comparing arrays flattened them too far, especially with `Diff::LCS.sdiff`.
313
+ Fixed by Josh Bronson in pull request [#23][pull-23].
314
+
315
+ ## 1.2.4 / 2013-04-20
316
+
317
+ - Bugs fixed:
318
+
319
+ - A bug was introduced after 1.1.3 when pruning common sequences at the start
320
+ of comparison. Paul Kunysch (@pck) fixed this in pull request
321
+ [#18][pull-18]. Thanks!
322
+
323
+ - The Rubinius (1.9 mode) bug in [rubinius/rubinius#2268][rubinius#2268] has
324
+ been fixed by the Rubinius team two days after it was filed. Thanks for
325
+ fixing this so quickly!
326
+
327
+ - Switching to Raggi's hoe-gemspec2 for gemspec generation.
328
+
329
+ ## 1.2.3 / 2013-04-11
330
+
331
+ - Bugs Fixed:
332
+
333
+ - The new encoding detection for diff output generation (added in 1.2.2)
334
+ introduced a bug if the left side of the comparison was the empty set.
335
+ Originally found in [rspec/rspec-expectations#238][rspec-expectations#238]
336
+ and [rspec/rspec-expectations#239][rspec-expectations#239]. Jon Rowe
337
+ developed a reasonable heuristic (left side, right side, empty string
338
+ literal) to avoid this bug.
339
+
340
+ - There is a known issue with Rubinius in 1.9 mode reported in
341
+ [rubinius/rubinius#2268][rubinius#2268] and demonstrated in the Travis CI
342
+ builds. For all other tested platforms, diff-lcs is considered stable. As
343
+ soon as a suitably small test-case can be created for the Rubinius team to
344
+ examine, this will be added to the Rubinius issue around this.
345
+
346
+ ## 1.2.2 / 2013-03-30
347
+
348
+ - Bugs Fixed:
349
+
350
+ - `Diff::LCS::Hunk` could not properly generate a difference for comparison
351
+ sets that are not US-ASCII-compatible because of the use of literal regular
352
+ expressions and strings. Jon Rowe found this in
353
+ [rspec/rspec-expectations#219][rspec-expectations#219] and provided a first
354
+ pass implementation in pull request [#15][pull-15]. I've reworked it because
355
+ of test failures in Rubinius when running in Ruby 1.9 mode. This coerces the
356
+ added values to the encoding of the old dataset (as determined by the first
357
+ piece of the old dataset).
358
+
359
+ - Adding Travis CI testing for Ruby 2.0.
360
+
361
+ ## 1.2.1 / 2013-02-09
362
+
363
+ - Bugs Fixed:
364
+
365
+ - As seen in [rspec/rspec-expectations#200][rspec-expectations#200], the
366
+ release of `Diff::LCS` 1.2 introduced an unnecessary public API change to
367
+ `Diff::LCS::Hunk` (see the change at
368
+ [rspec/rspec-expectations@3d6fc82c][rspec-expectations@3d6fc82c] for
369
+ details). The new method name (and behaviour) is more correct, but I should
370
+ not have renamed the function or should have at least provided an alias.
371
+ This release restores `Diff::LCS::Hunk#unshift` as an alias to #merge. Note
372
+ that the old `#unshift` behaviour was incorrect and will not be restored.
373
+
374
+ ## 1.2.0 / 2013-01-21
375
+
376
+ - Minor Enhancements:
377
+
378
+ - Added special case handling for `Diff::LCS.patch` so that it handles patches
379
+ that are empty or contain no changes.
380
+
381
+ - Added two new methods (`#patch_me` and `#unpatch_me`) to the include-able
382
+ module.
383
+
384
+ - Bugs Fixed:
385
+
386
+ - Fixed issue [#1][issue-01] patch direction detection.
387
+
388
+ - Resolved issue [#2][issue-02] by handling `string[string.size, 1]` properly
389
+ (it returns `""` not `nil`).
390
+
391
+ - Michael Granger (ged) fixed an implementation error in `Diff::LCS::Change`
392
+ and added specs in pull request [#8][pull-08]. Thanks!
393
+
394
+ - Made the code auto-testable.
395
+
396
+ - Vít Ondruch (voxik) provided the latest version of the GPL2 license file in
397
+ pull request [#10][pull-10]. Thanks!
398
+
399
+ - Fixed a documentation issue with the include-able versions of `#patch!` and
400
+ `#unpatch!` where they implied that they would replace the original value.
401
+ Given that `Diff::LCS.patch` always returns a copy, the documentation was
402
+ incorrect and has been corrected. To provide the behaviour that was
403
+ originally documented, two new methods were added to provide this behaviour.
404
+ Found by scooter-dangle in issue [#12][issue-12]. Thanks!
405
+
406
+ - Code Style Changes:
407
+
408
+ - Removed trailing spaces.
409
+
410
+ - Calling class methods using `.` instead of `::`.
411
+
412
+ - Vít Ondruch (voxik) removed unnecessary shebangs in pull request
413
+ [#9][pull-09]. Thanks!
414
+
415
+ - Kenichi Kamiya (kachick) removed some warnings of an unused variable in
416
+ lucky pull request [#13][pull-13]. Thanks!
417
+
418
+ - Embarked on a major refactoring to make the files a little more manageable
419
+ and understand the code on a deeper level.
420
+
421
+ - Adding CI via Travis CI.
422
+
423
+ ## 1.1.3 / 2011-08-27
424
+
425
+ - Converted to 'hoe' for release.
426
+
427
+ - Converted tests to RSpec 2.
428
+
429
+ - Extracted the body of `htmldiff` into a class available from
430
+ `diff/lcs/htmldiff`.
431
+
432
+ - Migrated development and issue tracking to GitHub.
433
+
434
+ - Bugs fixed:
435
+
436
+ - Eliminated the explicit use of RubyGems in both `bin/htmldiff` and
437
+ `bin/ldiff`. Resolves issue [#4][issue-04].
438
+
439
+ - Eliminated Ruby warnings. Resolves issue [#3][issue-03].
440
+
441
+ ## 1.1.2 / 2004-10-20
442
+
443
+ - Fixed a problem reported by Mauricio Fernandez in `htmldiff`.
444
+
445
+ ## 1.1.1 / 2004-09-25
446
+
447
+ - Fixed bug [#891][gh-issue-891] (Set returned from patch command does not
448
+ contain last equal part).
449
+
450
+ - Fixed a problem with callback initialisation code (it assumed that all
451
+ callbacks passed as classes can be initialised; now, it rescues NoMethodError
452
+ in the event of private :new being called).
453
+
454
+ - Modified the non-initialisable callbacks to have a private `#new` method.
455
+
456
+ - Moved `ldiff` core code to `Diff::LCS::Ldiff` (`diff/lcs/ldiff.rb`).
457
+
458
+ ## 1.1.0
459
+
460
+ - Eliminated the need for `Diff::LCS::Event` and removed it.
461
+
462
+ - Added a contextual diff callback, `Diff::LCS::ContextDiffCallback`.
463
+
464
+ - Implemented (un-)patching for standard diff callback output formats with both
465
+ `#diff` and `#sdiff`.
466
+
467
+ - Extensive documentation changes.
468
+
469
+ ## 1.0.4
470
+
471
+ - Fixed a problem with `bin/ldiff` output, especially for unified format.
472
+ Newlines that should have been present weren't.
473
+
474
+ - Changed the `.tar.gz` installer to generate Windows batch files if ones do not
475
+ exist already. Removed the existing batch files as they didn't work.
476
+
477
+ ## 1.0.3
478
+
479
+ - Fixed a problem with `#traverse_sequences` where the first difference from the
480
+ left sequence might not be appropriately captured.
481
+
482
+ ## 1.0.2
483
+
484
+ - Fixed an issue with `ldiff` not working because actions were changed from
485
+ symbols to strings.
486
+
487
+ ## 1.0.1
488
+
489
+ - Minor modifications to the `gemspec`, the `README`.
490
+
491
+ - Renamed the diff program to `ldiff` (as well as the companion batch file) so
492
+ as to not collide with the standard diff program.
493
+
494
+ - Fixed issues with RubyGems. Requires RubyGems > 0.6.1 or >= 0.6.1 with the
495
+ latest CVS version.
496
+
497
+ ## 1.0
498
+
499
+ - Initial release based mostly on Perl's Algorithm::Diff.
500
+
501
+ [age]: https://github.com/FiloSottile/age
502
+ [hoe-halostatue]: https://github.com/halostatue/hoe-halostatue
503
+ [hoe-markdown]: https://github.com/flavorjones/hoe-markdown
504
+ [issue-01]: https://github.com/halostatue/diff-lcs/issues/1
505
+ [issue-02]: https://github.com/halostatue/diff-lcs/issues/2
506
+ [issue-03]: https://github.com/halostatue/diff-lcs/issues/3
507
+ [issue-04]: https://github.com/halostatue/diff-lcs/issues/4
508
+ [issue-05]: https://github.com/halostatue/diff-lcs/issues/5
509
+ [issue-06]: https://github.com/halostatue/diff-lcs/issues/6
510
+ [issue-12]: https://github.com/halostatue/diff-lcs/issues/12
511
+ [issue-21]: https://github.com/halostatue/diff-lcs/issues/21
512
+ [issue-33]: https://github.com/halostatue/diff-lcs/issues/33
513
+ [issue-35]: https://github.com/halostatue/diff-lcs/issues/35
514
+ [issue-38]: https://github.com/halostatue/diff-lcs/issues/38
515
+ [issue-43]: https://github.com/halostatue/diff-lcs/issues/43
516
+ [issue-44]: https://github.com/halostatue/diff-lcs/issues/44
517
+ [issue-46]: https://github.com/halostatue/diff-lcs/issues/46
518
+ [issue-48]: https://github.com/halostatue/diff-lcs/issues/48
519
+ [issue-53]: https://github.com/halostatue/diff-lcs/issues/53
520
+ [issue-57]: https://github.com/halostatue/diff-lcs/issues/57
521
+ [issue-60]: https://github.com/halostatue/diff-lcs/issues/60
522
+ [issue-63]: https://github.com/halostatue/diff-lcs/issues/63
523
+ [issue-65]: https://github.com/halostatue/diff-lcs/issues/65
524
+ [issue-70]: https://github.com/halostatue/diff-lcs/issues/70
525
+ [issue-91]: https://github.com/halostatue/diff-lcs/issues/91
526
+ [issue-95]: https://github.com/halostatue/diff-lcs/issues/95
527
+ [issue-100]: https://github.com/halostatue/diff-lcs/issues/100
528
+ [issue-102]: https://github.com/halostatue/diff-lcs/issues/102
529
+ [issue-106]: https://github.com/halostatue/diff-lcs/issues/106
530
+ [issue-107]: https://github.com/halostatue/diff-lcs/issues/107
531
+ [pull-08]: https://github.com/halostatue/diff-lcs/pull/8
532
+ [pull-09]: https://github.com/halostatue/diff-lcs/pull/9
533
+ [pull-10]: https://github.com/halostatue/diff-lcs/pull/10
534
+ [pull-13]: https://github.com/halostatue/diff-lcs/pull/13
535
+ [pull-15]: https://github.com/halostatue/diff-lcs/pull/15
536
+ [pull-18]: https://github.com/halostatue/diff-lcs/pull/18
537
+ [pull-23]: https://github.com/halostatue/diff-lcs/pull/23
538
+ [pull-25]: https://github.com/halostatue/diff-lcs/pull/25
539
+ [pull-29]: https://github.com/halostatue/diff-lcs/pull/29
540
+ [pull-34]: https://github.com/halostatue/diff-lcs/pull/34
541
+ [pull-36]: https://github.com/halostatue/diff-lcs/pull/36
542
+ [pull-47]: https://github.com/halostatue/diff-lcs/pull/47
543
+ [pull-49]: https://github.com/halostatue/diff-lcs/pull/49
544
+ [pull-52]: https://github.com/halostatue/diff-lcs/pull/52
545
+ [pull-58]: https://github.com/halostatue/diff-lcs/pull/58
546
+ [pull-59]: https://github.com/halostatue/diff-lcs/pull/59
547
+ [pull-61]: https://github.com/halostatue/diff-lcs/pull/61
548
+ [pull-69]: https://github.com/halostatue/diff-lcs/pull/69
549
+ [pull-71]: https://github.com/halostatue/diff-lcs/pull/71
550
+ [pull-72]: https://github.com/halostatue/diff-lcs/pull/72
551
+ [pull-73]: https://github.com/halostatue/diff-lcs/pull/73
552
+ [pull-75]: https://github.com/halostatue/diff-lcs/pull/75
553
+ [pull-79]: https://github.com/halostatue/diff-lcs/pull/79
554
+ [pull-80]: https://github.com/halostatue/diff-lcs/pull/80
555
+ [pull-82]: https://github.com/halostatue/diff-lcs/pull/82
556
+ [pull-84]: https://github.com/halostatue/diff-lcs/pull/84
557
+ [pull-86]: https://github.com/halostatue/diff-lcs/pull/86
558
+ [pull-89]: https://github.com/halostatue/diff-lcs/pull/89
559
+ [pull-90]: https://github.com/halostatue/diff-lcs/pull/90
560
+ [pull-92]: https://github.com/halostatue/diff-lcs/pull/92
561
+ [pull-93]: https://github.com/halostatue/diff-lcs/pull/93
562
+ [pull-101]: https://github.com/halostatue/diff-lcs/pull/101
563
+ [pull-103]: https://github.com/halostatue/diff-lcs/pull/103
564
+ [pull-104]: https://github.com/halostatue/diff-lcs/pull/104
565
+ [pull-105]: https://github.com/halostatue/diff-lcs/pull/105
566
+ [pull-108]: https://github.com/halostatue/diff-lcs/pull/108
567
+ [pull-129]: https://github.com/halostatue/diff-lcs/pull/129
568
+ [pull-147]: https://github.com/halostatue/diff-lcs/pull/147
569
+ [pull-148]: https://github.com/halostatue/diff-lcs/pull/148
570
+ [rspec-expectations#200]: https://github.com/rspec/rspec-expectations/pull/200
571
+ [rspec-expectations#219]: https://github.com/rspec/rspec-expectations/issues/219
572
+ [rspec-expectations#238]: https://github.com/rspec/rspec-expectations/issues/238
573
+ [rspec-expectations#239]: https://github.com/rspec/rspec-expectations/issues/239
574
+ [rspec-expectations@3d6fc82c]: https://github.com/rspec/rspec-expectations/commit/3d6fc82c
575
+ [rubinius#2268]: https://github.com/rubinius/rubinius/issues/2268
576
+ [standard ruby]: https://github.com/standardrb/standard
577
+ [tidelift]: https://tidelift.com/security
578
+ [tp]: https://guides.rubygems.org/trusted-publishing/
579
+ [kiro]: https://kiro.dev
580
+ [gh-user-annih]: https://github.com/annih
581
+ [gh-issue-891]: https://github.com/halostatue/diff-lcs/issues/891