diff-lcs 2.0.0 → 2.1.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 (42) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +170 -85
  3. data/CODE_OF_CONDUCT.md +49 -48
  4. data/CONTRIBUTING.md +29 -28
  5. data/CONTRIBUTORS.md +15 -11
  6. data/LICENCE.md +19 -38
  7. data/Manifest.txt +16 -3
  8. data/README.md +24 -22
  9. data/Rakefile +3 -0
  10. data/SECURITY.md +5 -5
  11. data/lib/diff/lcs/array.rb +3 -1
  12. data/lib/diff/lcs/callbacks.rb +1 -1
  13. data/lib/diff/lcs/change.rb +74 -32
  14. data/lib/diff/lcs/frozen_value.rb +74 -0
  15. data/lib/diff/lcs/hunk.rb +146 -58
  16. data/lib/diff/lcs/internals.rb +183 -72
  17. data/lib/diff/lcs/ldiff.rb +23 -45
  18. data/lib/diff/lcs/string.rb +3 -1
  19. data/lib/diff/lcs/version.rb +1 -1
  20. data/lib/diff/lcs.rb +29 -26
  21. data/licences/MIT.txt +19 -0
  22. data/spec/ldiff_spec.rb +9 -7
  23. data/test/fixtures/ldiff/output.diff.bin1-q +0 -0
  24. data/test/fixtures/ldiff/output.diff.bin2-q +1 -0
  25. data/test/fixtures/ldiff/output.diff.hunks +9 -0
  26. data/test/fixtures/ldiff/output.diff.hunks-c +35 -0
  27. data/test/fixtures/ldiff/output.diff.hunks-u +20 -0
  28. data/test/fixtures/ldiff/output.diff.same +0 -0
  29. data/test/fixtures/ldiff/output.diff.same-c +0 -0
  30. data/test/fixtures/ldiff/output.diff.same-u +0 -0
  31. data/test/fixtures/new-hunks +31 -0
  32. data/test/fixtures/old-hunks +30 -0
  33. data/test/test_change.rb +23 -19
  34. data/test/test_frozen_value.rb +155 -0
  35. data/test/test_helper.rb +5 -0
  36. data/test/test_hunk.rb +238 -0
  37. data/test/test_lcs.rb +147 -0
  38. data/test/test_ldiff.rb +64 -7
  39. metadata +24 -11
  40. /data/{licenses → licences}/COPYING.txt +0 -0
  41. /data/{licenses → licences}/artistic.txt +0 -0
  42. /data/{licenses → licences}/dco.txt +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b8edc3b3383f33e30269bdef56fd21d58ac8efe471bb202f129d659a4f1a5ead
4
- data.tar.gz: 681426cabb34022d55a8335b4dcf095dc5b97faeddc4bbe82793a2cba36c6729
3
+ metadata.gz: c0a6edbd5abc90197f8ad70ee9f9121b40d865081710ed86b24230e3b74d8674
4
+ data.tar.gz: 79a00e25b159809b78ad726c6fa1fb3f23d50ef2705a86b27f21d9784faeec2c
5
5
  SHA512:
6
- metadata.gz: db895eb27c2215803f6da307375044c456fe7a09250d86d3be8fd176e22cc6aef71d3767fd6901c62c3a9a5c1035e282570a535fe365bff8af9ce1459d937687
7
- data.tar.gz: 948fd71bb838124c75c594921a5225358785b40d36d4b3bae60bd0d17914f1b3aa9ab71715e25c488028a67fb660a41808036ffa955b3802505dc9dce83d13fc
6
+ metadata.gz: c7ac0c6d07f1e997c45f3e75b2d32050db6fdf4d1784707b6d0359241b70feb2c10425b4921307dadebc30b62510ee269bf651d108ec3471578bf4155196ed9e
7
+ data.tar.gz: '093d896631b77ce6e58b2f44d5f9b6edb060054a7c3cedf2454b081ee6f05364aa5d0173042e911b327f13b061d8602fe9b40e4675d46c230526c8c2b40fceb5'
data/CHANGELOG.md CHANGED
@@ -1,5 +1,75 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.1.0 / 2026-11-29
4
+
5
+ There are minor **breaking change** in this release, but they are considered
6
+ to be unlikely to be encountered and nothing in RSpec appears to encounter
7
+ these issues. Because `Diff::LCS::Change` and `Diff::LCS::ContextChange` were
8
+ made plain frozen classes instead of `Data` instances:
9
+
10
+ - `to_s`, `pp` and `ContextChange#inspect` drop the `data` prefix;
11
+ - keyword names must be Symbols;
12
+ - a subclass overriding `initialize` with keyword parameters can no longer be
13
+ built positionally; and
14
+ - a `Marshal` or YAML dump made with 2.0.x no longer loads.
15
+
16
+ Clément Joubert contributed a number of amazing changes to this release. It
17
+ would not have happened without his contributions!
18
+
19
+ ### Deprecations
20
+
21
+ - Deprecate the extension of Array and String by requiring `diff/lcs/array` or
22
+ `diff/lcs/string`. These files will go away with the next major version. As
23
+ of this version, a warning will be emitted. (This should have happened for
24
+ 2.0, but I forgot.)
25
+
26
+ ### Correctness
27
+
28
+ - Added a guard test suite showing that Unicode NFC and NFD forms compare
29
+ differently. [#234][pull-234]
30
+
31
+ - Clarified the licence for diff-lcs, based on [#221][pull-221] by James
32
+ Thompson. [#231][pull-231]
33
+
34
+ ### `ldiff` Improvements
35
+
36
+ All of these changes were made by Clément Joubert.
37
+
38
+ - The hunk merging and output of `Diff::LCS::Ldiff` was moved to
39
+ `Diff::LCS::Hunk`, so that it can be used without `bin/ldiff`.
40
+ `Diff::LCS::Hunk.from_diff` returns the merged hunks for two sequences of
41
+ lines and `Diff::LCS::Hunk.diff` returns the diff in the old, unified, or
42
+ context format, with 3 lines of context by default.
43
+ `Diff::LCS::Hunk#diff(:old)` now writes each change of a hunk on its own, so
44
+ it is also correct for hunks with context. `ldiff` output is unchanged.
45
+ [#46][issue-46], [#242][pull-242]
46
+
47
+ - The `ldiff -c` output was fixed when there is more than one hunk. When a
48
+ hunk ended with lines from the new file, the separator of the next hunk was
49
+ written on the same line as the last line. [#241][pull-241]
50
+
51
+ - `Diff::LCS::Ldiff.run` read the filenames the file names from `ARGV` instead
52
+ of its `args`, and `-` from `$stdin` instead of its `input`. This is fixed,
53
+ so it can be called with any array and input. [#236][issue-236]
54
+
55
+ - `ldiff -q` incorrectly reported two identical binary files as different.
56
+ [#237][issue-237]
57
+
58
+ ### Performance Improvements
59
+
60
+ All of these changes were made by Clément Joubert.
61
+
62
+ - Sped up and reduced allocations in `diff`, `sdiff` and `lcs` without
63
+ affecting output. The LCS core skips redundant threshold updates and the
64
+ links they allocated, and strings are split into code points once instead of
65
+ allocating on every access. `diff` and `sdiff` build their default results
66
+ without traversal events. [#230][pull-230]
67
+
68
+ - `Diff::LCS::Change` and `Diff::LCS::ContextChange` were made plain frozen
69
+ classes with the API they had as `Data` classes, so building one allocates a
70
+ single object: on line diffs with YJIT, `sdiff` runs more than twice as fast
71
+ and `traverse_balanced` 1.7 times as fast. [#235][pull-235]
72
+
3
73
  ## 2.0.0 / 2026-02-01
4
74
 
5
75
  This release has significant **breaking changes**.
@@ -8,8 +78,8 @@ This release has significant **breaking changes**.
8
78
 
9
79
  - readability improvements (endless methods, pattern matching);
10
80
 
11
- - support for immutable Data classes (`Diff::LCS::Block`, `Diff::LCS::Change`,
12
- and `Diff::LCS::ContextChange`);
81
+ - support for immutable Data classes (`Diff::LCS::Block`,
82
+ `Diff::LCS::Change`, and `Diff::LCS::ContextChange`);
13
83
 
14
84
  - removal of compatibility shims;
15
85
 
@@ -27,9 +97,9 @@ This release has significant **breaking changes**.
27
97
  - The `htmldiff` binary and supporting code have been removed without
28
98
  replacement.
29
99
 
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."
100
+ - `ldiff` no longer supports `ed`-script output (`ed` and `reverse_ed`
101
+ formats). As Baptiste Courtois says in [#108][pull-108], the "implementation
102
+ was broken for a while and no-one reported it."
33
103
 
34
104
  - The method `Diff::LCS.LCS` has been removed as an alias for `Diff::LCS.lcs`.
35
105
  Most callers are using `Diff::LCS.lcs` and modern Ruby did-you-mean support
@@ -38,8 +108,8 @@ This release has significant **breaking changes**.
38
108
  - `Diff::LCS::Change` objects implemented the comparison operator (`<=>`)
39
109
  incorrectly. Comparisons are now done so that the `position` is compared
40
110
  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.
111
+ element. `Diff::LCS::ContextChange` works similarly, comparing the old and
112
+ new positions prior to comparing the actions by index.
43
113
 
44
114
  The order of `VALID_ACTIONS` was changed for the index order to make sense.
45
115
 
@@ -91,14 +161,14 @@ This release has significant **breaking changes**.
91
161
  code extraction making it easier to use separately from the `bin/ldiff`
92
162
  command in [#103][pull-103]. This partially resolves [#46][issue-46].
93
163
 
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].
164
+ - Improvement of binary and empty file detection and tests in
165
+ [#104][pull-104] and [#105][pull-105]. This resolves issues
166
+ [#100][issue-100], [#102][issue-102].
97
167
 
98
168
  - 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].
169
+ [#106][issue-106] (ldiff ed scripts are inverted), [#107][issue-107]
170
+ (ldiff hunk ranges are incorrect; regression or incorrect fix for
171
+ [#60][issue-60]), and [#95][issue-95].
102
172
 
103
173
  - Patrick Linnane fixed various minor typos. [#93][pull-93]
104
174
 
@@ -112,13 +182,14 @@ This release has significant **breaking changes**.
112
182
 
113
183
  Changes described here are effective 2024-12-31.
114
184
 
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.
185
+ - Update gem management details to use markdown files for everything,
186
+ enabled in part by [flavorjones/hoe-markdown][hoe-markdown]. Several files
187
+ were renamed to be more consistent with standard practices.
118
188
 
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.
189
+ - Updated security notes with an [age][age] public key rather than pointing
190
+ to Keybase.io and a PGP public key which I no longer use. The use of the
191
+ [Tidelift security contact][tidelift] is recommended over direct
192
+ disclosure.
122
193
 
123
194
  ## 1.5.1 / 2024-01-31
124
195
 
@@ -129,8 +200,8 @@ This release has significant **breaking changes**.
129
200
 
130
201
  - Justin Steele converted the licence file to Markdown. [#84][pull-84]
131
202
 
132
- - Updated the gem SPDX identifier for GPL 2.0 or later, resolving [#86][pull-86]
133
- by Vit Ondruch.
203
+ - Updated the gem SPDX identifier for GPL 2.0 or later, resolving
204
+ [#86][pull-86] by Vít Ondruch.
134
205
 
135
206
  - Resolve a potential security issue with `ldiff` in its use of `IO.read`
136
207
  instead of `File.read`. [#91][issue-91]
@@ -158,11 +229,11 @@ This release has significant **breaking changes**.
158
229
  results would result in equivalent changes that could be played forward or
159
230
  backward as appropriate. [#71][pull-71], [#75][pull-75]
160
231
 
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]
232
+ - The above fix resulted in a changed order of the longest common
233
+ subsequence when callbacks were applied. After analysis, it was determined
234
+ that the computed subsequence was _equivalent_ to the prior version, so
235
+ the test was updated. This also resulted in the clarification of
236
+ documentation when traversing the sub-sequences. [#79][pull-79]
166
237
 
167
238
  - An infinite loop case in the case where `Diff::LCS` would be included into
168
239
  an enumerable class has been fixed. [#73][pull-73]
@@ -170,15 +241,15 @@ This release has significant **breaking changes**.
170
241
  - Clarified the purpose of a threshold test in calculation of LCS.
171
242
  [#72][pull-72], [#80][pull-80]
172
243
 
173
- - Removed autotest directory
244
+ - Removed `autotest` directory
174
245
 
175
246
  ## 1.4.4 / 2020-07-01
176
247
 
177
248
  - Fixed an issue reported by Jun Aruga in the `Diff::LCS::Ldiff` binary text
178
249
  detection. [#44][issue-44]
179
250
 
180
- - Fixed a theoretical issue reported by Jun Aruga in `Diff::LCS::Hunk` to raise
181
- a more useful exception. [#43][issue-43]
251
+ - Fixed a theoretical issue reported by Jun Aruga in `Diff::LCS::Hunk` to
252
+ raise a more useful exception. [#43][issue-43]
182
253
 
183
254
  - Added documentation that should address custom object issues as reported in
184
255
  [#35][issue-35].
@@ -201,16 +272,16 @@ This release has significant **breaking changes**.
201
272
  - `old`, `ed`, and `reverse_ed` formats have no differences.
202
273
 
203
274
  - `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.
275
+ correct conditions, at most once. Unified range reporting also differs
276
+ for the last hunk such that the `length` of the range is reduced by one.
206
277
 
207
278
  - `context` format will report `\No newline at end of file` given the
208
279
  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.
280
+ differs for the last hunk such that the `end` part of the range is
281
+ reduced by one to a minimum of one.
211
282
 
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.
283
+ - Added a bunch more tests for the cases above, and fixed `hunk_spec.rb` so
284
+ that the phrase being compared isn't nonsense French.
214
285
 
215
286
  - Updated formatting.
216
287
 
@@ -219,15 +290,15 @@ This release has significant **breaking changes**.
219
290
  ## 1.4.3 / 2020-06-29
220
291
 
221
292
  - 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:
293
+ providing useful shim functions to Hoe 3.x (which dropped these older Rubies
294
+ a while ago). Specifically:
224
295
 
225
296
  - Removed Array#lazy from a method in `Diff::LCS::Hunk`.
226
297
 
227
298
  - Changed some unit tests to use old-style Symbol-keyed hashes.
228
299
 
229
- - Changed some unit test helper functions to no longer use keyword parameters,
230
- but only a trailing options hash.
300
+ - Changed some unit test helper functions to no longer use keyword
301
+ parameters, but only a trailing options hash.
231
302
 
232
303
  - Made the use of `psych` dependent on `RUBY_VERSION >= 1.9`.
233
304
 
@@ -235,7 +306,8 @@ This release has significant **breaking changes**.
235
306
 
236
307
  ## 1.4.2 / 2020-06-23
237
308
 
238
- - Camille Drapier fixed a small issue with RuboCop configuration. [#59][pull-59]
309
+ - Camille Drapier fixed a small issue with RuboCop configuration.
310
+ [#59][pull-59]
239
311
 
240
312
  - Applied another fix (and unit test) to fix an issue for the Chef team.
241
313
  [#60][issue-60], [#61][pull-61]
@@ -250,17 +322,18 @@ This release has significant **breaking changes**.
250
322
  - Ruby versions lower than 2.4 are soft-deprecated and will not be run as part
251
323
  of the CI process any longer.
252
324
 
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].
325
+ - Akinora Musha (@knu) added the ability for `Diff::LCS::Change` objects to be
326
+ implicitly treated arrays. Originally provided as pull request
327
+ [#47][pull-47], but it introduced a number of test failures as documented in
328
+ [#48][issue-48], and remediation of `Diff::LCS` itself was introduced in
329
+ [#49][pull-49].
257
330
 
258
331
  - Resolved [#5][issue-05] with some tests comparing output from `system` calls
259
332
  to `bin/ldiff` with some pre-generated output. Resolved [#6][issue-06] with
260
333
  these tests.
261
334
 
262
- - Resolved a previously undetected `bin/ldiff` issue with `--context` output not
263
- matching `diff --context` output.
335
+ - Resolved a previously undetected `bin/ldiff` issue with `--context` output
336
+ not matching `diff --context` output.
264
337
 
265
338
  - Resolved an issue with later versions of Ruby not working with an `OptParse`
266
339
  specification of `Numeric`; this has been changed to `Integer`.
@@ -282,8 +355,8 @@ This release has significant **breaking changes**.
282
355
  - Fix tab expansion in `htmldiff`, provided by Mark Friedgan in pull request
283
356
  [#25][pull-25].
284
357
 
285
- - Silence Ruby 2.4 `Fixnum` deprecation warnings. Fixes issue [#38][issue-38]
286
- and pull request [#36][pull-36].
358
+ - Silence Ruby 2.4 `Fixnum` deprecation warnings. Fixes issue
359
+ [#38][issue-38] and pull request [#36][pull-36].
287
360
 
288
361
  - Ensure that test dependencies are loaded properly. Fixes issue
289
362
  [#33][issue-33] and pull request [#34][pull-34].
@@ -309,15 +382,15 @@ This release has significant **breaking changes**.
309
382
 
310
383
  - Bugs fixed:
311
384
 
312
- - Comparing arrays flattened them too far, especially with `Diff::LCS.sdiff`.
313
- Fixed by Josh Bronson in pull request [#23][pull-23].
385
+ - Comparing arrays flattened them too far, especially with
386
+ `Diff::LCS.sdiff`. Fixed by Josh Bronson in pull request [#23][pull-23].
314
387
 
315
388
  ## 1.2.4 / 2013-04-20
316
389
 
317
390
  - Bugs fixed:
318
391
 
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
392
+ - A bug was introduced after 1.1.3 when pruning common sequences at the
393
+ start of comparison. Paul Kunysch (@pck) fixed this in pull request
321
394
  [#18][pull-18]. Thanks!
322
395
 
323
396
  - The Rubinius (1.9 mode) bug in [rubinius/rubinius#2268][rubinius#2268] has
@@ -348,13 +421,13 @@ This release has significant **breaking changes**.
348
421
  - Bugs Fixed:
349
422
 
350
423
  - `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).
424
+ sets that are not US-ASCII-compatible because of the use of literal
425
+ regular expressions and strings. Jon Rowe found this in
426
+ [rspec/rspec-expectations#219][rspec-expectations#219] and provided a
427
+ first pass implementation in pull request [#15][pull-15]. I've reworked it
428
+ because of test failures in Rubinius when running in Ruby 1.9 mode. This
429
+ coerces the added values to the encoding of the old dataset (as determined
430
+ by the first piece of the old dataset).
358
431
 
359
432
  - Adding Travis CI testing for Ruby 2.0.
360
433
 
@@ -366,17 +439,18 @@ This release has significant **breaking changes**.
366
439
  release of `Diff::LCS` 1.2 introduced an unnecessary public API change to
367
440
  `Diff::LCS::Hunk` (see the change at
368
441
  [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.
442
+ details). The new method name (and behaviour) is more correct, but I
443
+ should not have renamed the function or should have at least provided an
444
+ alias. This release restores `Diff::LCS::Hunk#unshift` as an alias to
445
+ #merge. Note that the old `#unshift` behaviour was incorrect and will not
446
+ be restored.
373
447
 
374
448
  ## 1.2.0 / 2013-01-21
375
449
 
376
450
  - Minor Enhancements:
377
451
 
378
- - Added special case handling for `Diff::LCS.patch` so that it handles patches
379
- that are empty or contain no changes.
452
+ - Added special case handling for `Diff::LCS.patch` so that it handles
453
+ patches that are empty or contain no changes.
380
454
 
381
455
  - Added two new methods (`#patch_me` and `#unpatch_me`) to the include-able
382
456
  module.
@@ -385,23 +459,24 @@ This release has significant **breaking changes**.
385
459
 
386
460
  - Fixed issue [#1][issue-01] patch direction detection.
387
461
 
388
- - Resolved issue [#2][issue-02] by handling `string[string.size, 1]` properly
389
- (it returns `""` not `nil`).
462
+ - Resolved issue [#2][issue-02] by handling `string[string.size, 1]`
463
+ properly (it returns `""` not `nil`).
390
464
 
391
- - Michael Granger (ged) fixed an implementation error in `Diff::LCS::Change`
392
- and added specs in pull request [#8][pull-08]. Thanks!
465
+ - Michael Granger (@ged) fixed an implementation error in
466
+ `Diff::LCS::Change` and added specs in pull request [#8][pull-08]. Thanks!
393
467
 
394
468
  - Made the code auto-testable.
395
469
 
396
- - Vít Ondruch (voxik) provided the latest version of the GPL2 license file in
397
- pull request [#10][pull-10]. Thanks!
470
+ - Vít Ondruch (@voxik) provided the latest version of the GPL2 license file
471
+ in pull request [#10][pull-10]. Thanks!
398
472
 
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!
473
+ - Fixed a documentation issue with the include-able versions of `#patch!`
474
+ and `#unpatch!` where they implied that they would replace the original
475
+ value. Given that `Diff::LCS.patch` always returns a copy, the
476
+ documentation was incorrect and has been corrected. To provide the
477
+ behaviour that was originally documented, two new methods were added to
478
+ provide this behaviour. Found by scooter-dangle in issue [#12][issue-12].
479
+ Thanks!
405
480
 
406
481
  - Code Style Changes:
407
482
 
@@ -448,8 +523,8 @@ This release has significant **breaking changes**.
448
523
  contain last equal part).
449
524
 
450
525
  - 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).
526
+ callbacks passed as classes can be initialised; now, it rescues
527
+ NoMethodError in the event of private :new being called).
453
528
 
454
529
  - Modified the non-initialisable callbacks to have a private `#new` method.
455
530
 
@@ -461,8 +536,8 @@ This release has significant **breaking changes**.
461
536
 
462
537
  - Added a contextual diff callback, `Diff::LCS::ContextDiffCallback`.
463
538
 
464
- - Implemented (un-)patching for standard diff callback output formats with both
465
- `#diff` and `#sdiff`.
539
+ - Implemented (un-)patching for standard diff callback output formats with
540
+ both `#diff` and `#sdiff`.
466
541
 
467
542
  - Extensive documentation changes.
468
543
 
@@ -471,13 +546,13 @@ This release has significant **breaking changes**.
471
546
  - Fixed a problem with `bin/ldiff` output, especially for unified format.
472
547
  Newlines that should have been present weren't.
473
548
 
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.
549
+ - Changed the `.tar.gz` installer to generate Windows batch files if ones do
550
+ not exist already. Removed the existing batch files as they didn't work.
476
551
 
477
552
  ## 1.0.3
478
553
 
479
- - Fixed a problem with `#traverse_sequences` where the first difference from the
480
- left sequence might not be appropriately captured.
554
+ - Fixed a problem with `#traverse_sequences` where the first difference from
555
+ the left sequence might not be appropriately captured.
481
556
 
482
557
  ## 1.0.2
483
558
 
@@ -528,6 +603,8 @@ This release has significant **breaking changes**.
528
603
  [issue-102]: https://github.com/halostatue/diff-lcs/issues/102
529
604
  [issue-106]: https://github.com/halostatue/diff-lcs/issues/106
530
605
  [issue-107]: https://github.com/halostatue/diff-lcs/issues/107
606
+ [issue-236]: https://github.com/halostatue/diff-lcs/issues/236
607
+ [issue-237]: https://github.com/halostatue/diff-lcs/issues/237
531
608
  [pull-08]: https://github.com/halostatue/diff-lcs/pull/8
532
609
  [pull-09]: https://github.com/halostatue/diff-lcs/pull/9
533
610
  [pull-10]: https://github.com/halostatue/diff-lcs/pull/10
@@ -567,6 +644,13 @@ This release has significant **breaking changes**.
567
644
  [pull-129]: https://github.com/halostatue/diff-lcs/pull/129
568
645
  [pull-147]: https://github.com/halostatue/diff-lcs/pull/147
569
646
  [pull-148]: https://github.com/halostatue/diff-lcs/pull/148
647
+ [pull-221]: https://github.com/halostatue/diff-lcs/pull/221
648
+ [pull-230]: https://github.com/halostatue/diff-lcs/pull/230
649
+ [pull-231]: https://github.com/halostatue/diff-lcs/pull/231
650
+ [pull-234]: https://github.com/halostatue/diff-lcs/pull/234
651
+ [pull-235]: https://github.com/halostatue/diff-lcs/pull/235
652
+ [pull-241]: https://github.com/halostatue/diff-lcs/pull/241
653
+ [pull-242]: https://github.com/halostatue/diff-lcs/pull/242
570
654
  [rspec-expectations#200]: https://github.com/rspec/rspec-expectations/pull/200
571
655
  [rspec-expectations#219]: https://github.com/rspec/rspec-expectations/issues/219
572
656
  [rspec-expectations#238]: https://github.com/rspec/rspec-expectations/issues/238
@@ -578,4 +662,5 @@ This release has significant **breaking changes**.
578
662
  [tp]: https://guides.rubygems.org/trusted-publishing/
579
663
  [kiro]: https://kiro.dev
580
664
  [gh-user-annih]: https://github.com/annih
665
+ [gh-user-czj]: https://github.com/czj
581
666
  [gh-issue-891]: https://github.com/halostatue/diff-lcs/issues/891
data/CODE_OF_CONDUCT.md CHANGED
@@ -9,9 +9,9 @@ dignity, rights, and contributions of all individuals, regardless of
9
9
  characteristics including race, ethnicity, caste, color, age, physical
10
10
  characteristics, neurodiversity, disability, sex or gender, gender identity or
11
11
  expression, sexual orientation, language, philosophy or religion, national or
12
- social origin, socio-economic position, level of education, or other status. The
13
- same privileges of participation are extended to everyone who participates in
14
- good faith and in accordance with this Covenant.
12
+ social origin, socio-economic position, level of education, or other status.
13
+ The same privileges of participation are extended to everyone who participates
14
+ in good faith and in accordance with this Covenant.
15
15
 
16
16
  ## Encouraged Behaviors
17
17
 
@@ -23,8 +23,8 @@ culture, background, or native language.
23
23
  With these considerations in mind, we agree to behave mindfully toward each
24
24
  other and act in ways that center our shared values, including:
25
25
 
26
- 1. Respecting the **purpose of our community**, our activities, and our ways of
27
- gathering.
26
+ 1. Respecting the **purpose of our community**, our activities, and our ways
27
+ of gathering.
28
28
  2. Engaging **kindly and honestly** with others.
29
29
  3. Respecting **different viewpoints** and experiences.
30
30
  4. **Taking responsibility** for our actions and contributions.
@@ -43,54 +43,55 @@ Conduct.
43
43
  unnecessary personal attention after any clear request to stop.
44
44
  2. **Character attacks.** Making insulting, demeaning, or pejorative comments
45
45
  directed at a community member or group of people.
46
- 3. **Stereotyping or discrimination.** Characterizing anyone’s personality or
46
+ 3. **Stereotyping or discrimination.** Characterizing anyone's personality or
47
47
  behavior on the basis of immutable identities or traits.
48
48
  4. **Sexualization.** Behaving in a way that would generally be considered
49
49
  inappropriately intimate in the context or purpose of the community.
50
50
  5. **Violating confidentiality**. Sharing or acting on someone's personal or
51
51
  private information without their permission.
52
- 6. **Endangerment.** Causing, encouraging, or threatening violence or other harm
53
- toward any person or group.
52
+ 6. **Endangerment.** Causing, encouraging, or threatening violence or other
53
+ harm toward any person or group.
54
54
  7. Behaving in other ways that **threaten the well-being** of our community.
55
55
 
56
56
  ### Other Restrictions
57
57
 
58
58
  1. **Misleading identity.** Impersonating someone else for any reason, or
59
59
  pretending to be someone else to evade enforcement actions.
60
- 2. **Failing to credit sources.** Not properly crediting the sources of content
61
- you contribute.
62
- 3. **Promotional materials**. Sharing marketing or other commercial content in a
63
- way that is outside the norms of the community.
64
- 4. **Irresponsible communication.** Failing to responsibly present content which
65
- includes, links or describes any other restricted behaviors.
60
+ 2. **Failing to credit sources.** Not properly crediting the sources of
61
+ content you contribute.
62
+ 3. **Promotional materials**. Sharing marketing or other commercial content in
63
+ a way that is outside the norms of the community.
64
+ 4. **Irresponsible communication.** Failing to responsibly present content
65
+ which includes, links or describes any other restricted behaviors.
66
66
 
67
67
  ## Reporting an Issue
68
68
 
69
69
  Tensions can occur between community members even when they are trying their
70
- best to collaborate. Not every conflict represents a code of conduct violation,
71
- and this Code of Conduct reinforces encouraged behaviors and norms that can help
72
- avoid conflicts and minimize harm.
70
+ best to collaborate. Not every conflict represents a code of conduct
71
+ violation, and this Code of Conduct reinforces encouraged behaviors and norms
72
+ that can help avoid conflicts and minimize harm.
73
73
 
74
- When an incident does occur, it is important to report it promptly. To report a
75
- possible violation, create a [private security advisory][advisory] — violations
76
- of this code of conduct are considered security vulnerabilities.
74
+ When an incident does occur, it is important to report it promptly. To report
75
+ a possible violation, create a [private security advisory][advisory] —
76
+ violations of this code of conduct are considered security vulnerabilities.
77
77
 
78
78
  Community Moderators take reports of violations seriously and will make every
79
- effort to respond in a timely manner. They will investigate all reports of code
80
- of conduct violations, reviewing messages, logs, and recordings, or interviewing
81
- witnesses and other participants. Community Moderators will keep investigation
82
- and enforcement actions as transparent as possible while prioritizing safety and
83
- confidentiality. In order to honor these values, enforcement actions are carried
84
- out in private with the involved parties, but communicating to the whole
85
- community may be part of a mutually agreed upon resolution.
79
+ effort to respond in a timely manner. They will investigate all reports of
80
+ code of conduct violations, reviewing messages, logs, and recordings, or
81
+ interviewing witnesses and other participants. Community Moderators will keep
82
+ investigation and enforcement actions as transparent as possible while
83
+ prioritizing safety and confidentiality. In order to honor these values,
84
+ enforcement actions are carried out in private with the involved parties, but
85
+ communicating to the whole community may be part of a mutually agreed upon
86
+ resolution.
86
87
 
87
88
  ## Addressing and Repairing Harm
88
89
 
89
- If an investigation by the Community Moderators finds that this Code of Conduct
90
- has been violated, the following enforcement ladder may be used to determine how
91
- best to repair harm, based on the incident's impact on the individuals involved
92
- and the community as a whole. Depending on the severity of a violation, lower
93
- rungs on the ladder may be skipped.
90
+ If an investigation by the Community Moderators finds that this Code of
91
+ Conduct has been violated, the following enforcement ladder may be used to
92
+ determine how best to repair harm, based on the incident's impact on the
93
+ individuals involved and the community as a whole. Depending on the severity
94
+ of a violation, lower rungs on the ladder may be skipped.
94
95
 
95
96
  1. Warning
96
97
  1. Event: A violation involving a single incident or series of incidents.
@@ -104,30 +105,30 @@ rungs on the ladder may be skipped.
104
105
  warning, or the first incidence of a more serious violation.
105
106
  2. Consequence: A private, written warning with a time-limited cooldown
106
107
  period designed to underscore the seriousness of the situation and give
107
- the community members involved time to process the incident. The cooldown
108
- period may be limited to particular communication channels or interactions
109
- with particular community members.
108
+ the community members involved time to process the incident. The
109
+ cooldown period may be limited to particular communication channels or
110
+ interactions with particular community members.
110
111
  3. Repair: Examples of repair may include making an apology, using the
111
112
  cooldown period to reflect on actions and impact, and being thoughtful
112
113
  about re-entering community spaces after the period is over.
113
114
 
114
115
  3. Temporary Suspension
115
- 1. Event: A pattern of repeated violation which the Community Moderators have
116
- tried to address with warnings, or a single serious violation.
116
+ 1. Event: A pattern of repeated violation which the Community Moderators
117
+ have tried to address with warnings, or a single serious violation.
117
118
  2. Consequence: A private written warning with conditions for return from
118
119
  suspension. In general, temporary suspensions give the person being
119
120
  suspended time to reflect upon their behavior and possible corrective
120
121
  actions.
121
122
  3. Repair: Examples of repair include respecting the spirit of the
122
123
  suspension, meeting the specified conditions for return, and being
123
- thoughtful about how to reintegrate with the community when the suspension
124
- is lifted.
124
+ thoughtful about how to reintegrate with the community when the
125
+ suspension is lifted.
125
126
 
126
127
  4. Permanent Ban
127
128
  1. Event: A pattern of repeated code of conduct violations that other steps
128
129
  on the ladder have failed to resolve, or a violation so serious that the
129
- Community Moderators determine there is no way to keep the community safe
130
- with this person as a member.
130
+ Community Moderators determine there is no way to keep the community
131
+ safe with this person as a member.
131
132
  2. Consequence: Access to all community spaces, tools, and communication
132
133
  channels is removed. In general, permanent bans should be rarely used,
133
134
  should have strong reasoning behind them, and should only be resorted to
@@ -140,11 +141,11 @@ with the best interests of our community.
140
141
 
141
142
  ## Scope
142
143
 
143
- This Code of Conduct applies within all community spaces, and also applies when
144
- an individual is officially representing the community in public or other
144
+ This Code of Conduct applies within all community spaces, and also applies
145
+ when an individual is officially representing the community in public or other
145
146
  spaces. Examples of representing our community include using an official email
146
- address, posting via an official social media account, or acting as an appointed
147
- representative at an online or offline event.
147
+ address, posting via an official social media account, or acting as an
148
+ appointed representative at an online or offline event.
148
149
 
149
150
  ## Attribution
150
151
 
@@ -157,10 +158,10 @@ licensed under CC BY-SA 4.0. To view a copy of this license, visit
157
158
 
158
159
  For answers to common questions about Contributor Covenant, see the FAQ at
159
160
  <https://www.contributor-covenant.org/faq>. Translations are provided at
160
- <https://www.contributor-covenant.org/translations>. Additional enforcement and
161
- community guideline resources can be found at
161
+ <https://www.contributor-covenant.org/translations>. Additional enforcement
162
+ and community guideline resources can be found at
162
163
  <https://www.contributor-covenant.org/resources>. The enforcement ladder was
163
- inspired by the work of [Mozilla’s code of conduct team][inclusion].
164
+ inspired by the work of [Mozilla's code of conduct team][inclusion].
164
165
 
165
166
  [advisory]: https://github.com/halostatue/diff-lcs/security/advisories/new
166
167
  [inclusion]: https://github.com/mozilla/inclusion