acfs 2.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/README.md +1 -1
- data/acfs.gemspec +2 -0
- data/lib/acfs/global.rb +10 -6
- data/lib/acfs/request.rb +4 -3
- data/lib/acfs/runner.rb +46 -8
- data/lib/acfs/telemetry.rb +19 -0
- data/lib/acfs/version.rb +1 -1
- data/lib/acfs.rb +4 -0
- data/vendor/bundle/ruby/3.4.0/bundler/gems/rubocop-config-67802c9d1826/rubocop-config.gemspec +1 -1
- data/vendor/bundle/ruby/3.4.0/gems/diff-lcs-1.6.0/CHANGELOG.md +491 -0
- data/vendor/bundle/ruby/3.4.0/gems/diff-lcs-1.6.0/README.md +92 -0
- data/vendor/bundle/ruby/3.4.0/gems/{json-2.9.1 → json-2.10.1}/README.md +75 -2
- data/vendor/bundle/ruby/3.4.0/gems/{json-2.9.1 → json-2.10.1}/json.gemspec +3 -4
- data/vendor/bundle/ruby/3.4.0/gems/opentelemetry-api-1.4.0/CHANGELOG.md +188 -0
- data/vendor/bundle/ruby/3.4.0/gems/opentelemetry-api-1.4.0/LICENSE +201 -0
- data/vendor/bundle/ruby/3.4.0/gems/opentelemetry-api-1.4.0/README.md +69 -0
- data/vendor/bundle/ruby/3.4.0/gems/opentelemetry-common-0.21.0/CHANGELOG.md +94 -0
- data/vendor/bundle/ruby/3.4.0/gems/opentelemetry-common-0.21.0/LICENSE +201 -0
- data/vendor/bundle/ruby/3.4.0/gems/opentelemetry-common-0.21.0/README.md +62 -0
- data/vendor/bundle/ruby/3.4.0/gems/{rack-3.1.8 → rack-3.1.10}/CHANGELOG.md +14 -0
- data/vendor/bundle/ruby/3.4.0/gems/{rspec-core-3.13.2 → rspec-core-3.13.3}/Changelog.md +271 -261
- data/vendor/bundle/ruby/3.4.0/gems/{webmock-3.24.0 → webmock-3.25.0}/CHANGELOG.md +6 -0
- data/vendor/bundle/ruby/3.4.0/gems/{webmock-3.24.0 → webmock-3.25.0}/README.md +1 -0
- data/vendor/bundle/ruby/3.4.0/specifications/{diff-lcs-1.5.1.gemspec → diff-lcs-1.6.0.gemspec} +11 -10
- data/vendor/bundle/ruby/3.4.0/specifications/{i18n-1.14.6.gemspec → i18n-1.14.7.gemspec} +4 -5
- data/vendor/bundle/ruby/3.4.0/specifications/{json-2.9.1.gemspec → json-2.10.1.gemspec} +0 -0
- data/vendor/bundle/ruby/3.4.0/specifications/{logger-1.6.5.gemspec → logger-1.6.6.gemspec} +3 -3
- data/vendor/bundle/ruby/3.4.0/specifications/{nokogiri-1.18.1-x86_64-linux-gnu.gemspec → nokogiri-1.18.2-x86_64-linux-gnu.gemspec} +3 -3
- data/vendor/bundle/ruby/3.4.0/specifications/opentelemetry-api-1.4.0.gemspec +35 -0
- data/vendor/bundle/ruby/3.4.0/specifications/opentelemetry-common-0.21.0.gemspec +34 -0
- data/vendor/bundle/ruby/3.4.0/specifications/{rack-3.1.8.gemspec → rack-3.1.10.gemspec} +4 -4
- data/vendor/bundle/ruby/3.4.0/specifications/{rspec-core-3.13.2.gemspec → rspec-core-3.13.3.gemspec} +7 -15
- data/vendor/bundle/ruby/3.4.0/specifications/{webmock-3.24.0.gemspec → webmock-3.25.0.gemspec} +5 -5
- metadata +67 -30
- data/vendor/bundle/ruby/3.4.0/gems/diff-lcs-1.5.1/License.md +0 -41
- data/vendor/bundle/ruby/3.4.0/gems/diff-lcs-1.5.1/README.rdoc +0 -84
- /data/vendor/bundle/ruby/3.4.0/gems/{i18n-1.14.6 → i18n-1.14.7}/MIT-LICENSE +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{i18n-1.14.6 → i18n-1.14.7}/README.md +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{logger-1.6.5 → logger-1.6.6}/README.md +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{logger-1.6.5 → logger-1.6.6}/logger.gemspec +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{nokogiri-1.18.1-x86_64-linux-gnu → nokogiri-1.18.2-x86_64-linux-gnu}/LICENSE-DEPENDENCIES.md +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{nokogiri-1.18.1-x86_64-linux-gnu → nokogiri-1.18.2-x86_64-linux-gnu}/LICENSE.md +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{nokogiri-1.18.1-x86_64-linux-gnu → nokogiri-1.18.2-x86_64-linux-gnu}/README.md +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.1.8 → rack-3.1.10}/MIT-LICENSE +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.1.8 → rack-3.1.10}/README.md +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rspec-core-3.13.2 → rspec-core-3.13.3}/LICENSE.md +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rspec-core-3.13.2 → rspec-core-3.13.3}/README.md +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{webmock-3.24.0 → webmock-3.25.0}/LICENSE +0 -0
@@ -0,0 +1,491 @@
|
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
## 1.6.0 / 2025-02-13
|
4
|
+
|
5
|
+
- Baptiste Courtois (@annih) has done significant work on making `bin/ldiff`
|
6
|
+
work better, contributing a number of issues and pull requests. These include:
|
7
|
+
|
8
|
+
- Separation of command parsing from diff-generation in `Diff::LCS::Ldiff`
|
9
|
+
code extraction making it easier to use separately from the `bin/ldiff`
|
10
|
+
command in [#103][pull-103]. This partially resolves [#46][issue-46].
|
11
|
+
|
12
|
+
- Improvement of binary and empty file detection and tests in [#104][pull-104]
|
13
|
+
and [#105][pull-105]. This resolves issues [#100][issue-100],
|
14
|
+
[#102][issue-102].
|
15
|
+
|
16
|
+
- Various ldiff fixes for output [#101][pull-101] resolves issues
|
17
|
+
[#106][issue-106] (ldiff ed scripts are inverted), [#107][issue-107] (ldiff
|
18
|
+
hunk ranges are incorrect; regression or incorrect fix for [#60][issue-60]),
|
19
|
+
and [#95][issue-95].
|
20
|
+
|
21
|
+
- Patrick Linnane fixed various minor typos. [#93][pull-93]
|
22
|
+
|
23
|
+
- Mark Young added a Changelog link to the RubyGems metadata. [#92][pull-92]
|
24
|
+
This has been modified to incorporate it into the README.
|
25
|
+
|
26
|
+
- Updated the documentation on `Diff::LCS#lcs` to be clearer about the
|
27
|
+
requirements for object equality comparison. This resolves [#70][issue-70].
|
28
|
+
|
29
|
+
- Governance:
|
30
|
+
|
31
|
+
Changes described here are effective 2024-12-31.
|
32
|
+
|
33
|
+
- Update gem management details to use markdown files for everything, enabled
|
34
|
+
in part by [flavorjones/hoe-markdown][hoe-markdown]. Several files were
|
35
|
+
renamed to be more consistent with standard practices.
|
36
|
+
|
37
|
+
- Updated security notes with an [age][age] public key rather than pointing to
|
38
|
+
Keybase.io and a PGP public key which I no longer use. The use of the
|
39
|
+
[Tidelift security contact][tidelift] is recommended over direct disclosure.
|
40
|
+
|
41
|
+
## 1.5.1 / 2024-01-31
|
42
|
+
|
43
|
+
- Peter Goldstein updated CI configuration to add Ruby 3.1 and Masato Nakamura
|
44
|
+
added Ruby 3.2 and 3.3. [#82][pull-82], [#89][pull-89]
|
45
|
+
|
46
|
+
- Switched to [standard ruby][standard ruby] formatting.
|
47
|
+
|
48
|
+
- Justin Steele converted the licence file to Markdown. [#84][pull-84]
|
49
|
+
|
50
|
+
- Updated the gem SPDX identifier for GPL 2.0 or later, resolving [#86][pull-86]
|
51
|
+
by Vit Ondruch.
|
52
|
+
|
53
|
+
- Resolve a potential security issue with `ldiff` in its use of `IO.read`
|
54
|
+
instead of `File.read`. [#91][issue-91]
|
55
|
+
|
56
|
+
- Added MFA authentication requirement for release to RubyGems. [#90][pull-90]
|
57
|
+
|
58
|
+
- Added Dependabot management for actions and gems. [#90][pull-90]
|
59
|
+
|
60
|
+
- Updated CodeQL configuration. [#90][pull-90]
|
61
|
+
|
62
|
+
## 1.5.0 / 2021-12-23
|
63
|
+
|
64
|
+
- Updated the CI configuration and monkey-patch Hoe.
|
65
|
+
|
66
|
+
- Kenichi Kamiya fixed a test configuration deprecation in SimpleCov.
|
67
|
+
[#69][pull-69]
|
68
|
+
|
69
|
+
- Tien introduced several corrections and code improvements:
|
70
|
+
|
71
|
+
- Removed an off-by-one error when calculating an index value by embracing
|
72
|
+
Ruby iteration properly. This had a side-effect of fixing a long-standing
|
73
|
+
bug in `#traverse_sequences` where the traversal would not be transitive.
|
74
|
+
That is, `LCS(s2, s1)` should produce a sequence that is transitive with
|
75
|
+
`LCS(s1, s2)` on traversal, and applying the diff computed from those
|
76
|
+
results would result in equivalent changes that could be played forward or
|
77
|
+
backward as appropriate. [#71][pull-71], [#75][pull-75]
|
78
|
+
|
79
|
+
- The above fix resulted in a changed order of the longest common subsequence
|
80
|
+
when callbacks were applied. After analysis, it was determined that the
|
81
|
+
computed subsequence was _equivalent_ to the prior version, so the test was
|
82
|
+
updated. This also resulted in the clarification of documentation when
|
83
|
+
traversing the sub-sequences. [#79][pull-79]
|
84
|
+
|
85
|
+
- An infinite loop case in the case where `Diff::LCS` would be included into
|
86
|
+
an enumerable class has been fixed. [#73][pull-73]
|
87
|
+
|
88
|
+
- Clarified the purpose of a threshold test in calculation of LCS.
|
89
|
+
[#72][pull-72], [#80][pull-80]
|
90
|
+
|
91
|
+
- Removed autotest directory
|
92
|
+
|
93
|
+
## 1.4.4 / 2020-07-01
|
94
|
+
|
95
|
+
- Fixed an issue reported by Jun Aruga in the `Diff::LCS::Ldiff` binary text
|
96
|
+
detection. [#44][issue-44]
|
97
|
+
|
98
|
+
- Fixed a theoretical issue reported by Jun Aruga in `Diff::LCS::Hunk` to raise
|
99
|
+
a more useful exception. [#43][issue-43]
|
100
|
+
|
101
|
+
- Added documentation that should address custom object issues as reported in
|
102
|
+
[#35][issue-35].
|
103
|
+
|
104
|
+
- Fixed more diff errors, in part reported in [#65][issue-65].
|
105
|
+
|
106
|
+
- The use of `Numeric#abs` is incorrect in `Diff::LCS::Block#diff_size`. The
|
107
|
+
diff size _must_ be accurate for correct change placement.
|
108
|
+
|
109
|
+
- When selecting `@max_diff_size` in `Diff::LCS::Hunk`, choose it based on
|
110
|
+
`block.diff_size.abs`.
|
111
|
+
|
112
|
+
- Made a number of changes that will, unfortunately, increase allocations at
|
113
|
+
the cost of being safe with frozen strings.
|
114
|
+
|
115
|
+
- Add some knowledge that when `Diff::LCS::Hunk#diff` is called, that we are
|
116
|
+
processing the _last_ hunk, so some changes will be made to how the output
|
117
|
+
is generated.
|
118
|
+
|
119
|
+
- `old`, `ed`, and `reverse_ed` formats have no differences.
|
120
|
+
|
121
|
+
- `unified` format will report `` given the
|
122
|
+
correct conditions, at most once. Unified range reporting also differs for
|
123
|
+
the last hunk such that the `length` of the range is reduced by one.
|
124
|
+
|
125
|
+
- `context` format will report `\No newline at end of file` given the
|
126
|
+
correct conditions, up to once per "file". Context range reporting also
|
127
|
+
differs for the last hunk such that the `end` part of the range is reduced
|
128
|
+
by one to a minimum of one.
|
129
|
+
|
130
|
+
- Added a bunch more tests for the cases above, and fixed `hunk_spec.rb` so that
|
131
|
+
the phrase being compared isn't nonsense French.
|
132
|
+
|
133
|
+
- Updated formatting.
|
134
|
+
|
135
|
+
- Added a Rake task to assist with manual testing on Ruby 1.8.
|
136
|
+
|
137
|
+
## 1.4.3 / 2020-06-29
|
138
|
+
|
139
|
+
- Fixed several issues with 1.4 on Rubies older than 2.0. Some of this was
|
140
|
+
providing useful shim functions to Hoe 3.x (which dropped these older Rubies a
|
141
|
+
while ago). Specifically:
|
142
|
+
|
143
|
+
- Removed Array#lazy from a method in `Diff::LCS::Hunk`.
|
144
|
+
|
145
|
+
- Changed some unit tests to use old-style Symbol-keyed hashes.
|
146
|
+
|
147
|
+
- Changed some unit test helper functions to no longer use keyword parameters,
|
148
|
+
but only a trailing options hash.
|
149
|
+
|
150
|
+
- Made the use of `psych` dependent on `RUBY_VERSION >= 1.9`.
|
151
|
+
|
152
|
+
Resolves [#63][issue-63].
|
153
|
+
|
154
|
+
## 1.4.2 / 2020-06-23
|
155
|
+
|
156
|
+
- Camille Drapier fixed a small issue with RuboCop configuration. [#59][pull-59]
|
157
|
+
|
158
|
+
- Applied another fix (and unit test) to fix an issue for the Chef team.
|
159
|
+
[#60][issue-60], [#61][pull-61]
|
160
|
+
|
161
|
+
## 1.4.1 / 2020-06-23
|
162
|
+
|
163
|
+
- Fix an issue where diff sizes could be negative, and they should be.
|
164
|
+
[#57][issue-57], [#58][pull-58]
|
165
|
+
|
166
|
+
## 1.4 / 2020-06-23
|
167
|
+
|
168
|
+
- Ruby versions lower than 2.4 are soft-deprecated and will not be run as part
|
169
|
+
of the CI process any longer.
|
170
|
+
|
171
|
+
- Akinora MUSHA (knu) added the ability for `Diff::LCS::Change` objects to be
|
172
|
+
implicitly treated arrays. Originally provided as pull request [#47][pull-47],
|
173
|
+
but it introduced a number of test failures as documented in [#48][issue-48],
|
174
|
+
and remediation of `Diff::LCS` itself was introduced in [#49][pull-49].
|
175
|
+
|
176
|
+
- Resolved [#5][issue-05] with some tests comparing output from `system` calls
|
177
|
+
to `bin/ldiff` with some pre-generated output. Resolved [#6][issue-06] with
|
178
|
+
these tests.
|
179
|
+
|
180
|
+
- Resolved a previously undetected `bin/ldiff` issue with `--context` output not
|
181
|
+
matching `diff --context` output.
|
182
|
+
|
183
|
+
- Resolved an issue with later versions of Ruby not working with an `OptParse`
|
184
|
+
specification of `Numeric`; this has been changed to `Integer`.
|
185
|
+
|
186
|
+
- Brandon Fish added TruffleRuby in [#52][pull-52].
|
187
|
+
|
188
|
+
- Fixed two missing classes as reported in [#53][issue-53].
|
189
|
+
|
190
|
+
## 1.3 / 2017-01-18
|
191
|
+
|
192
|
+
- Bugs fixed:
|
193
|
+
|
194
|
+
- Fixed an error for `bin/ldiff --version`. Fixes issue [#21][issue-21].
|
195
|
+
|
196
|
+
- Force `Diff::LCS::Change` and `Diff::LCS::ContextChange` to only perform
|
197
|
+
equality comparisons against themselves. Provided by Kevin Mook in pull
|
198
|
+
request [#29][pull-29].
|
199
|
+
|
200
|
+
- Fix tab expansion in `htmldiff`, provided by Mark Friedgan in pull request
|
201
|
+
[#25][pull-25].
|
202
|
+
|
203
|
+
- Silence Ruby 2.4 `Fixnum` deprecation warnings. Fixes issue [#38][issue-38]
|
204
|
+
and pull request [#36][pull-36].
|
205
|
+
|
206
|
+
- Ensure that test dependencies are loaded properly. Fixes issue
|
207
|
+
[#33][issue-33] and pull request [#34][pull-34].
|
208
|
+
|
209
|
+
- Fix issue [#1][issue-01] with incorrect intuition of patch direction.
|
210
|
+
Tentative fix, but the previous failure cases pass now.
|
211
|
+
|
212
|
+
- Tooling changes:
|
213
|
+
|
214
|
+
- Added SimpleCov and Coveralls support.
|
215
|
+
|
216
|
+
- Change the homepage (temporarily) to the GitHub repo.
|
217
|
+
|
218
|
+
- Updated testing and gem infrastructure.
|
219
|
+
|
220
|
+
- Modernized the specs.
|
221
|
+
|
222
|
+
- Cleaned up documentation.
|
223
|
+
|
224
|
+
- Added a Code of Conduct.
|
225
|
+
|
226
|
+
## 1.2.5 / 2013-11-08
|
227
|
+
|
228
|
+
- Bugs fixed:
|
229
|
+
|
230
|
+
- Comparing arrays flattened them too far, especially with `Diff::LCS.sdiff`.
|
231
|
+
Fixed by Josh Bronson in pull request [#23][pull-23].
|
232
|
+
|
233
|
+
## 1.2.4 / 2013-04-20
|
234
|
+
|
235
|
+
- Bugs fixed:
|
236
|
+
|
237
|
+
- A bug was introduced after 1.1.3 when pruning common sequences at the start
|
238
|
+
of comparison. Paul Kunysch (@pck) fixed this in pull request
|
239
|
+
[#18][pull-18]. Thanks!
|
240
|
+
|
241
|
+
- The Rubinius (1.9 mode) bug in [rubinius/rubinius#2268][rubinius#2268] has
|
242
|
+
been fixed by the Rubinius team two days after it was filed. Thanks for
|
243
|
+
fixing this so quickly!
|
244
|
+
|
245
|
+
- Switching to Raggi's hoe-gemspec2 for gemspec generation.
|
246
|
+
|
247
|
+
## 1.2.3 / 2013-04-11
|
248
|
+
|
249
|
+
- Bugs Fixed:
|
250
|
+
|
251
|
+
- The new encoding detection for diff output generation (added in 1.2.2)
|
252
|
+
introduced a bug if the left side of the comparison was the empty set.
|
253
|
+
Originally found in [rspec/rspec-expectations#238][rspec-expectations#238]
|
254
|
+
and [rspec/rspec-expectations#239][rspec-expectations#239]. Jon Rowe
|
255
|
+
developed a reasonable heuristic (left side, right side, empty string
|
256
|
+
literal) to avoid this bug.
|
257
|
+
|
258
|
+
- There is a known issue with Rubinius in 1.9 mode reported in
|
259
|
+
[rubinius/rubinius#2268][rubinius#2268] and demonstrated in the Travis CI
|
260
|
+
builds. For all other tested platforms, diff-lcs is considered stable. As
|
261
|
+
soon as a suitably small test-case can be created for the Rubinius team to
|
262
|
+
examine, this will be added to the Rubinius issue around this.
|
263
|
+
|
264
|
+
## 1.2.2 / 2013-03-30
|
265
|
+
|
266
|
+
- Bugs Fixed:
|
267
|
+
|
268
|
+
- `Diff::LCS::Hunk` could not properly generate a difference for comparison
|
269
|
+
sets that are not US-ASCII-compatible because of the use of literal regular
|
270
|
+
expressions and strings. Jon Rowe found this in
|
271
|
+
[rspec/rspec-expectations#219][rspec-expectations#219] and provided a first
|
272
|
+
pass implementation in pull request [#15][pull-15]. I've reworked it because
|
273
|
+
of test failures in Rubinius when running in Ruby 1.9 mode. This coerces the
|
274
|
+
added values to the encoding of the old dataset (as determined by the first
|
275
|
+
piece of the old dataset).
|
276
|
+
|
277
|
+
- Adding Travis CI testing for Ruby 2.0.
|
278
|
+
|
279
|
+
## 1.2.1 / 2013-02-09
|
280
|
+
|
281
|
+
- Bugs Fixed:
|
282
|
+
|
283
|
+
- As seen in [rspec/rspec-expectations#200][rspec-expectations#200], the
|
284
|
+
release of `Diff::LCS` 1.2 introduced an unnecessary public API change to
|
285
|
+
`Diff::LCS::Hunk` (see the change at
|
286
|
+
[rspec/rspec-expectations@3d6fc82c][rspec-expectations@3d6fc82c] for
|
287
|
+
details). The new method name (and behaviour) is more correct, but I should
|
288
|
+
not have renamed the function or should have at least provided an alias.
|
289
|
+
This release restores `Diff::LCS::Hunk#unshift` as an alias to #merge. Note
|
290
|
+
that the old `#unshift` behaviour was incorrect and will not be restored.
|
291
|
+
|
292
|
+
## 1.2.0 / 2013-01-21
|
293
|
+
|
294
|
+
- Minor Enhancements:
|
295
|
+
|
296
|
+
- Added special case handling for `Diff::LCS.patch` so that it handles patches
|
297
|
+
that are empty or contain no changes.
|
298
|
+
|
299
|
+
- Added two new methods (`#patch_me` and `#unpatch_me`) to the include-able
|
300
|
+
module.
|
301
|
+
|
302
|
+
- Bugs Fixed:
|
303
|
+
|
304
|
+
- Fixed issue [#1][issue-01] patch direction detection.
|
305
|
+
|
306
|
+
- Resolved issue [#2][issue-02] by handling `string[string.size, 1]` properly
|
307
|
+
(it returns `""` not `nil`).
|
308
|
+
|
309
|
+
- Michael Granger (ged) fixed an implementation error in `Diff::LCS::Change`
|
310
|
+
and added specs in pull request [#8][pull-08]. Thanks!
|
311
|
+
|
312
|
+
- Made the code auto-testable.
|
313
|
+
|
314
|
+
- Vít Ondruch (voxik) provided the latest version of the GPL2 license file in
|
315
|
+
pull request [#10][pull-10]. Thanks!
|
316
|
+
|
317
|
+
- Fixed a documentation issue with the include-able versions of `#patch!` and
|
318
|
+
`#unpatch!` where they implied that they would replace the original value.
|
319
|
+
Given that `Diff::LCS.patch` always returns a copy, the documentation was
|
320
|
+
incorrect and has been corrected. To provide the behaviour that was
|
321
|
+
originally documented, two new methods were added to provide this behaviour.
|
322
|
+
Found by scooter-dangle in issue [#12][issue-12]. Thanks!
|
323
|
+
|
324
|
+
- Code Style Changes:
|
325
|
+
|
326
|
+
- Removed trailing spaces.
|
327
|
+
|
328
|
+
- Calling class methods using `.` instead of `::`.
|
329
|
+
|
330
|
+
- Vít Ondruch (voxik) removed unnecessary shebangs in pull request
|
331
|
+
[#9][pull-09]. Thanks!
|
332
|
+
|
333
|
+
- Kenichi Kamiya (kachick) removed some warnings of an unused variable in
|
334
|
+
lucky pull request [#13][pull-13]. Thanks!
|
335
|
+
|
336
|
+
- Embarked on a major refactoring to make the files a little more manageable
|
337
|
+
and understand the code on a deeper level.
|
338
|
+
|
339
|
+
- Adding CI via Travis CI.
|
340
|
+
|
341
|
+
## 1.1.3 / 2011-08-27
|
342
|
+
|
343
|
+
- Converted to 'hoe' for release.
|
344
|
+
|
345
|
+
- Converted tests to RSpec 2.
|
346
|
+
|
347
|
+
- Extracted the body of `htmldiff` into a class available from
|
348
|
+
`diff/lcs/htmldiff`.
|
349
|
+
|
350
|
+
- Migrated development and issue tracking to GitHub.
|
351
|
+
|
352
|
+
- Bugs fixed:
|
353
|
+
|
354
|
+
- Eliminated the explicit use of RubyGems in both `bin/htmldiff` and
|
355
|
+
`bin/ldiff`. Resolves issue [#4][issue-04].
|
356
|
+
|
357
|
+
- Eliminated Ruby warnings. Resolves issue [#3][issue-03].
|
358
|
+
|
359
|
+
## 1.1.2 / 2004-10-20
|
360
|
+
|
361
|
+
- Fixed a problem reported by Mauricio Fernandez in `htmldiff`.
|
362
|
+
|
363
|
+
## 1.1.1 / 2004-09-25
|
364
|
+
|
365
|
+
- Fixed bug #891 (Set returned from patch command does not contain last equal
|
366
|
+
part).
|
367
|
+
|
368
|
+
- Fixed a problem with callback initialisation code (it assumed that all
|
369
|
+
callbacks passed as classes can be initialised; now, it rescues NoMethodError
|
370
|
+
in the event of private :new being called).
|
371
|
+
|
372
|
+
- Modified the non-initialisable callbacks to have a private `#new` method.
|
373
|
+
|
374
|
+
- Moved `ldiff` core code to `Diff::LCS::Ldiff` (`diff/lcs/ldiff.rb`).
|
375
|
+
|
376
|
+
## 1.1.0
|
377
|
+
|
378
|
+
- Eliminated the need for `Diff::LCS::Event` and removed it.
|
379
|
+
|
380
|
+
- Added a contextual diff callback, `Diff::LCS::ContextDiffCallback`.
|
381
|
+
|
382
|
+
- Implemented (un-)patching for standard diff callback output formats with both
|
383
|
+
`#diff` and `#sdiff`.
|
384
|
+
|
385
|
+
- Extensive documentation changes.
|
386
|
+
|
387
|
+
## 1.0.4
|
388
|
+
|
389
|
+
- Fixed a problem with `bin/ldiff` output, especially for unified format.
|
390
|
+
Newlines that should have been present weren't.
|
391
|
+
|
392
|
+
- Changed the `.tar.gz` installer to generate Windows batch files if ones do not
|
393
|
+
exist already. Removed the existing batch files as they didn't work.
|
394
|
+
|
395
|
+
## 1.0.3
|
396
|
+
|
397
|
+
- Fixed a problem with `#traverse_sequences` where the first difference from the
|
398
|
+
left sequence might not be appropriately captured.
|
399
|
+
|
400
|
+
## 1.0.2
|
401
|
+
|
402
|
+
- Fixed an issue with `ldiff` not working because actions were changed from
|
403
|
+
symbols to strings.
|
404
|
+
|
405
|
+
## 1.0.1
|
406
|
+
|
407
|
+
- Minor modifications to the `gemspec`, the `README`.
|
408
|
+
|
409
|
+
- Renamed the diff program to `ldiff` (as well as the companion batch file) so
|
410
|
+
as to not collide with the standard diff program.
|
411
|
+
|
412
|
+
- Fixed issues with RubyGems. Requires RubyGems > 0.6.1 or >= 0.6.1 with the
|
413
|
+
latest CVS version.
|
414
|
+
|
415
|
+
## 1.0
|
416
|
+
|
417
|
+
- Initial release based mostly on Perl's Algorithm::Diff.
|
418
|
+
|
419
|
+
[age]: https://github.com/FiloSottile/age
|
420
|
+
[hoe-halostatue]: https://github.com/halostatue/hoe-halostatue
|
421
|
+
[hoe-markdown]: https://github.com/flavorjones/hoe-markdown
|
422
|
+
[issue-01]: https://github.com/halostatue/diff-lcs/issues/1
|
423
|
+
[issue-02]: https://github.com/halostatue/diff-lcs/issues/2
|
424
|
+
[issue-03]: https://github.com/halostatue/diff-lcs/issues/3
|
425
|
+
[issue-04]: https://github.com/halostatue/diff-lcs/issues/4
|
426
|
+
[issue-05]: https://github.com/halostatue/diff-lcs/issues/5
|
427
|
+
[issue-06]: https://github.com/halostatue/diff-lcs/issues/6
|
428
|
+
[issue-12]: https://github.com/halostatue/diff-lcs/issues/12
|
429
|
+
[issue-21]: https://github.com/halostatue/diff-lcs/issues/21
|
430
|
+
[issue-33]: https://github.com/halostatue/diff-lcs/issues/33
|
431
|
+
[issue-35]: https://github.com/halostatue/diff-lcs/issues/35
|
432
|
+
[issue-38]: https://github.com/halostatue/diff-lcs/issues/38
|
433
|
+
[issue-43]: https://github.com/halostatue/diff-lcs/issues/43
|
434
|
+
[issue-44]: https://github.com/halostatue/diff-lcs/issues/44
|
435
|
+
[issue-46]: https://github.com/halostatue/diff-lcs/issues/46
|
436
|
+
[issue-48]: https://github.com/halostatue/diff-lcs/issues/48
|
437
|
+
[issue-53]: https://github.com/halostatue/diff-lcs/issues/53
|
438
|
+
[issue-57]: https://github.com/halostatue/diff-lcs/issues/57
|
439
|
+
[issue-60]: https://github.com/halostatue/diff-lcs/issues/60
|
440
|
+
[issue-63]: https://github.com/halostatue/diff-lcs/issues/63
|
441
|
+
[issue-65]: https://github.com/halostatue/diff-lcs/issues/65
|
442
|
+
[issue-70]: https://github.com/halostatue/diff-lcs/issues/70
|
443
|
+
[issue-91]: https://github.com/halostatue/diff-lcs/issues/91
|
444
|
+
[issue-95]: https://github.com/halostatue/diff-lcs/issues/95
|
445
|
+
[issue-100]: https://github.com/halostatue/diff-lcs/issues/100
|
446
|
+
[issue-102]: https://github.com/halostatue/diff-lcs/issues/102
|
447
|
+
[issue-106]: https://github.com/halostatue/diff-lcs/issues/106
|
448
|
+
[issue-107]: https://github.com/halostatue/diff-lcs/issues/107
|
449
|
+
[pull-08]: https://github.com/halostatue/diff-lcs/pull/8
|
450
|
+
[pull-09]: https://github.com/halostatue/diff-lcs/pull/9
|
451
|
+
[pull-10]: https://github.com/halostatue/diff-lcs/pull/10
|
452
|
+
[pull-13]: https://github.com/halostatue/diff-lcs/pull/13
|
453
|
+
[pull-15]: https://github.com/halostatue/diff-lcs/pull/15
|
454
|
+
[pull-18]: https://github.com/halostatue/diff-lcs/pull/18
|
455
|
+
[pull-23]: https://github.com/halostatue/diff-lcs/pull/23
|
456
|
+
[pull-25]: https://github.com/halostatue/diff-lcs/pull/25
|
457
|
+
[pull-29]: https://github.com/halostatue/diff-lcs/pull/29
|
458
|
+
[pull-34]: https://github.com/halostatue/diff-lcs/pull/34
|
459
|
+
[pull-36]: https://github.com/halostatue/diff-lcs/pull/36
|
460
|
+
[pull-47]: https://github.com/halostatue/diff-lcs/pull/47
|
461
|
+
[pull-49]: https://github.com/halostatue/diff-lcs/pull/49
|
462
|
+
[pull-52]: https://github.com/halostatue/diff-lcs/pull/52
|
463
|
+
[pull-58]: https://github.com/halostatue/diff-lcs/pull/58
|
464
|
+
[pull-59]: https://github.com/halostatue/diff-lcs/pull/59
|
465
|
+
[pull-61]: https://github.com/halostatue/diff-lcs/pull/61
|
466
|
+
[pull-69]: https://github.com/halostatue/diff-lcs/pull/69
|
467
|
+
[pull-71]: https://github.com/halostatue/diff-lcs/pull/71
|
468
|
+
[pull-72]: https://github.com/halostatue/diff-lcs/pull/72
|
469
|
+
[pull-73]: https://github.com/halostatue/diff-lcs/pull/73
|
470
|
+
[pull-75]: https://github.com/halostatue/diff-lcs/pull/75
|
471
|
+
[pull-79]: https://github.com/halostatue/diff-lcs/pull/79
|
472
|
+
[pull-80]: https://github.com/halostatue/diff-lcs/pull/80
|
473
|
+
[pull-82]: https://github.com/halostatue/diff-lcs/pull/82
|
474
|
+
[pull-84]: https://github.com/halostatue/diff-lcs/pull/84
|
475
|
+
[pull-86]: https://github.com/halostatue/diff-lcs/pull/86
|
476
|
+
[pull-89]: https://github.com/halostatue/diff-lcs/pull/89
|
477
|
+
[pull-90]: https://github.com/halostatue/diff-lcs/pull/90
|
478
|
+
[pull-92]: https://github.com/halostatue/diff-lcs/pull/92
|
479
|
+
[pull-93]: https://github.com/halostatue/diff-lcs/pull/93
|
480
|
+
[pull-101]: https://github.com/halostatue/diff-lcs/pull/101
|
481
|
+
[pull-103]: https://github.com/halostatue/diff-lcs/pull/103
|
482
|
+
[pull-104]: https://github.com/halostatue/diff-lcs/pull/104
|
483
|
+
[pull-105]: https://github.com/halostatue/diff-lcs/pull/105
|
484
|
+
[rspec-expectations#200]: https://github.com/rspec/rspec-expectations/pull/200
|
485
|
+
[rspec-expectations#219]: https://github.com/rspec/rspec-expectations/issues/219
|
486
|
+
[rspec-expectations#238]: https://github.com/rspec/rspec-expectations/issues/238
|
487
|
+
[rspec-expectations#239]: https://github.com/rspec/rspec-expectations/issues/239
|
488
|
+
[rspec-expectations@3d6fc82c]: https://github.com/rspec/rspec-expectations/commit/3d6fc82c
|
489
|
+
[rubinius#2268]: https://github.com/rubinius/rubinius/issues/2268
|
490
|
+
[standard ruby]: https://github.com/standardrb/standard
|
491
|
+
[tidelift]: https://tidelift.com/security
|
@@ -0,0 +1,92 @@
|
|
1
|
+
# Diff::LCS
|
2
|
+
|
3
|
+
- home :: https://github.com/halostatue/diff-lcs
|
4
|
+
- changelog :: https://github.com/halostatue/diff-lcs/blob/main/CHANGELOG.md
|
5
|
+
- code :: https://github.com/halostatue/diff-lcs
|
6
|
+
- bugs :: https://github.com/halostatue/diff-lcs/issues
|
7
|
+
- rdoc :: http://rubydoc.info/github/halostatue/diff-lcs
|
8
|
+
|
9
|
+
<a href="https://github.com/halostatue/diff-lcs/actions">
|
10
|
+
<img src="https://github.com/halostatue/diff-lcs/workflows/CI/badge.svg" />
|
11
|
+
</a>
|
12
|
+
|
13
|
+
## Description
|
14
|
+
|
15
|
+
Diff::LCS computes the difference between two Enumerable sequences using the
|
16
|
+
McIlroy-Hunt longest common subsequence (LCS) algorithm. It includes utilities
|
17
|
+
to create a simple HTML diff output format and a standard diff-like tool.
|
18
|
+
|
19
|
+
This is release 1.4.3, providing a simple extension that allows for
|
20
|
+
Diff::LCS::Change objects to be treated implicitly as arrays and fixes a number
|
21
|
+
of formatting issues.
|
22
|
+
|
23
|
+
Ruby versions below 2.5 are soft-deprecated, which means that older versions are
|
24
|
+
no longer part of the CI test suite. If any changes have been introduced that
|
25
|
+
break those versions, bug reports and patches will be accepted, but it will be
|
26
|
+
up to the reporter to verify any fixes prior to release. The next major release
|
27
|
+
will completely break compatibility.
|
28
|
+
|
29
|
+
## Synopsis
|
30
|
+
|
31
|
+
Using this module is quite simple. By default, Diff::LCS does not extend objects
|
32
|
+
with the Diff::LCS interface, but will be called as if it were a function:
|
33
|
+
|
34
|
+
```ruby
|
35
|
+
require 'diff/lcs'
|
36
|
+
|
37
|
+
seq1 = %w(a b c e h j l m n p)
|
38
|
+
seq2 = %w(b c d e f j k l m r s t)
|
39
|
+
|
40
|
+
lcs = Diff::LCS.LCS(seq1, seq2)
|
41
|
+
diffs = Diff::LCS.diff(seq1, seq2)
|
42
|
+
sdiff = Diff::LCS.sdiff(seq1, seq2)
|
43
|
+
seq = Diff::LCS.traverse_sequences(seq1, seq2, callback_obj)
|
44
|
+
bal = Diff::LCS.traverse_balanced(seq1, seq2, callback_obj)
|
45
|
+
seq2 == Diff::LCS.patch!(seq1, diffs)
|
46
|
+
seq1 == Diff::LCS.unpatch!(seq2, diffs)
|
47
|
+
seq2 == Diff::LCS.patch!(seq1, sdiff)
|
48
|
+
seq1 == Diff::LCS.unpatch!(seq2, sdiff)
|
49
|
+
```
|
50
|
+
|
51
|
+
Objects can be extended with Diff::LCS:
|
52
|
+
|
53
|
+
```ruby
|
54
|
+
seq1.extend(Diff::LCS)
|
55
|
+
lcs = seq1.lcs(seq2)
|
56
|
+
diffs = seq1.diff(seq2)
|
57
|
+
sdiff = seq1.sdiff(seq2)
|
58
|
+
seq = seq1.traverse_sequences(seq2, callback_obj)
|
59
|
+
bal = seq1.traverse_balanced(seq2, callback_obj)
|
60
|
+
seq2 == seq1.patch!(diffs)
|
61
|
+
seq1 == seq2.unpatch!(diffs)
|
62
|
+
seq2 == seq1.patch!(sdiff)
|
63
|
+
seq1 == seq2.unpatch!(sdiff)
|
64
|
+
```
|
65
|
+
|
66
|
+
By requiring 'diff/lcs/array' or 'diff/lcs/string', Array or String will be
|
67
|
+
extended for use this way.
|
68
|
+
|
69
|
+
Note that Diff::LCS requires a sequenced enumerable container, which means that
|
70
|
+
the order of enumeration is both predictable and consistent for the same set of
|
71
|
+
data. While it is theoretically possible to generate a diff for an unordered
|
72
|
+
hash, it will only be meaningful if the enumeration of the hashes is consistent.
|
73
|
+
In general, this will mean that containers that behave like String or Array will
|
74
|
+
perform best.
|
75
|
+
|
76
|
+
## History
|
77
|
+
|
78
|
+
Diff::LCS is a port of Perl's Algorithm::Diff that uses the McIlroy-Hunt longest
|
79
|
+
common subsequence (LCS) algorithm to compute intelligent differences between
|
80
|
+
two sequenced enumerable containers. The implementation is based on Mario I.
|
81
|
+
Wolczko's [Smalltalk version 1.2][smalltalk] (1993) and Ned Konz's Perl version
|
82
|
+
[Algorithm::Diff 1.15][perl]. `Diff::LCS#sdiff` and
|
83
|
+
`Diff::LCS#traverse_balanced` were originally written for the Perl version by
|
84
|
+
Mike Schilli.
|
85
|
+
|
86
|
+
The algorithm is described in <em>A Fast Algorithm for Computing Longest Common
|
87
|
+
Subsequences</em>, CACM, vol.20, no.5, pp.350-353, May 1977, with a few minor
|
88
|
+
improvements to improve the speed. A simplified description of the algorithm,
|
89
|
+
originally written for the Perl version, was written by Mark-Jason Dominus.
|
90
|
+
|
91
|
+
[smalltalk]: ftp://st.cs.uiuc.edu/pub/Smalltalk/MANCHESTER/manchester/4.0/diff.st
|
92
|
+
[perl]: http://search.cpan.org/~nedkonz/Algorithm-Diff-1.15/
|
@@ -29,7 +29,7 @@ If bundler is not being used to manage dependencies, install the gem by executin
|
|
29
29
|
|
30
30
|
$ gem install json
|
31
31
|
|
32
|
-
## Usage
|
32
|
+
## Basic Usage
|
33
33
|
|
34
34
|
To use JSON you can
|
35
35
|
|
@@ -52,7 +52,80 @@ You can also use the `pretty_generate` method (which formats the output more
|
|
52
52
|
verbosely and nicely) or `fast_generate` (which doesn't do any of the security
|
53
53
|
checks generate performs, e. g. nesting deepness checks).
|
54
54
|
|
55
|
-
##
|
55
|
+
## Casting non native types
|
56
|
+
|
57
|
+
JSON documents can only support Hashes, Arrays, Strings, Integers and Floats.
|
58
|
+
|
59
|
+
By default if you attempt to serialize something else, `JSON.generate` will
|
60
|
+
search for a `#to_json` method on that object:
|
61
|
+
|
62
|
+
```ruby
|
63
|
+
Position = Struct.new(:latitude, :longitude) do
|
64
|
+
def to_json(state = nil, *)
|
65
|
+
JSON::State.from_state(state).generate({
|
66
|
+
latitude: latitude,
|
67
|
+
longitude: longitude,
|
68
|
+
})
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
JSON.generate([
|
73
|
+
Position.new(12323.234, 435345.233),
|
74
|
+
Position.new(23434.676, 159435.324),
|
75
|
+
]) # => [{"latitude":12323.234,"longitude":435345.233},{"latitude":23434.676,"longitude":159435.324}]
|
76
|
+
```
|
77
|
+
|
78
|
+
If a `#to_json` method isn't defined on the object, `JSON.generate` will fallback to call `#to_s`:
|
79
|
+
|
80
|
+
```ruby
|
81
|
+
JSON.generate(Object.new) # => "#<Object:0x000000011e768b98>"
|
82
|
+
```
|
83
|
+
|
84
|
+
Both of these behavior can be disabled using the `strict: true` option:
|
85
|
+
|
86
|
+
```ruby
|
87
|
+
JSON.generate(Object.new, strict: true) # => Object not allowed in JSON (JSON::GeneratorError)
|
88
|
+
JSON.generate(Position.new(1, 2)) # => Position not allowed in JSON (JSON::GeneratorError)
|
89
|
+
```
|
90
|
+
|
91
|
+
## JSON::Coder
|
92
|
+
|
93
|
+
Since `#to_json` methods are global, it can sometimes be problematic if you need a given type to be
|
94
|
+
serialized in different ways in different locations.
|
95
|
+
|
96
|
+
Instead it is recommended to use the newer `JSON::Coder` API:
|
97
|
+
|
98
|
+
```ruby
|
99
|
+
module MyApp
|
100
|
+
API_JSON_CODER = JSON::Coder.new do |object|
|
101
|
+
case object
|
102
|
+
when Time
|
103
|
+
object.iso8601(3)
|
104
|
+
else
|
105
|
+
object
|
106
|
+
end
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
110
|
+
puts MyApp::API_JSON_CODER.dump(Time.now.utc) # => "2025-01-21T08:41:44.286Z"
|
111
|
+
```
|
112
|
+
|
113
|
+
The provided block is called for all objects that don't have a native JSON equivalent, and
|
114
|
+
must return a Ruby object that has a native JSON equivalent.
|
115
|
+
|
116
|
+
## Combining JSON fragments
|
117
|
+
|
118
|
+
To combine JSON fragments into a bigger JSON document, you can use `JSON::Fragment`:
|
119
|
+
|
120
|
+
```ruby
|
121
|
+
posts_json = cache.fetch_multi(post_ids) do |post_id|
|
122
|
+
JSON.generate(Post.find(post_id))
|
123
|
+
end
|
124
|
+
posts_json.map! { |post_json| JSON::Fragment.new(post_json) }
|
125
|
+
JSON.generate({ posts: posts_json, count: posts_json.count })
|
126
|
+
```
|
127
|
+
|
128
|
+
## Round-tripping arbitrary types
|
56
129
|
|
57
130
|
> [!CAUTION]
|
58
131
|
> You should never use `JSON.unsafe_load` nor `JSON.parse(str, create_additions: true)` to parse untrusted user input,
|