diff-lcs 1.3 → 1.4.2
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.
- checksums.yaml +5 -5
- data/Contributing.md +1 -0
- data/History.md +196 -153
- data/Manifest.txt +8 -0
- data/README.rdoc +9 -10
- data/Rakefile +4 -21
- data/autotest/discover.rb +3 -1
- data/bin/htmldiff +7 -4
- data/bin/ldiff +4 -1
- data/lib/diff-lcs.rb +1 -1
- data/lib/diff/lcs.rb +177 -170
- data/lib/diff/lcs/array.rb +1 -1
- data/lib/diff/lcs/backports.rb +9 -0
- data/lib/diff/lcs/block.rb +2 -2
- data/lib/diff/lcs/callbacks.rb +15 -12
- data/lib/diff/lcs/change.rb +30 -37
- data/lib/diff/lcs/htmldiff.rb +17 -16
- data/lib/diff/lcs/hunk.rb +67 -52
- data/lib/diff/lcs/internals.rb +36 -39
- data/lib/diff/lcs/ldiff.rb +33 -25
- data/lib/diff/lcs/string.rb +1 -1
- data/spec/change_spec.rb +31 -7
- data/spec/diff_spec.rb +16 -12
- data/spec/fixtures/aX +1 -0
- data/spec/fixtures/bXaX +1 -0
- data/spec/fixtures/ldiff/output.diff +4 -0
- data/spec/fixtures/ldiff/output.diff-c +7 -0
- data/spec/fixtures/ldiff/output.diff-e +3 -0
- data/spec/fixtures/ldiff/output.diff-f +3 -0
- data/spec/fixtures/ldiff/output.diff-u +5 -0
- data/spec/hunk_spec.rb +20 -20
- data/spec/issues_spec.rb +59 -10
- data/spec/lcs_spec.rb +10 -10
- data/spec/ldiff_spec.rb +62 -29
- data/spec/patch_spec.rb +93 -99
- data/spec/sdiff_spec.rb +89 -89
- data/spec/spec_helper.rb +115 -63
- data/spec/traverse_balanced_spec.rb +173 -173
- data/spec/traverse_sequences_spec.rb +28 -28
- metadata +30 -30
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: f8c970551b0fef2c712a6dbdc87453ecbd383a6c5b69f0c1e20e7525a9f4d1ef
|
4
|
+
data.tar.gz: 6a46ef91155a305417163c3e92503b567e47bf69413e697101b613ed8665c016
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9612854483a3dc37cab0f7ec561d23c4ff2c4d190c4d526c18ae45de8c42a2b48f4809fc7da78de524703a7424b7bfd128bb6705424ffa8c139d7a8a59eea10f
|
7
|
+
data.tar.gz: 16586385ffdfd194afd04f1da73ba3b358b7f324f3dfa5c76b8d37e4ffee0eff257ae7c718d85164d02130c9424b04b130521f87dc4d812d9426bbba6806dfd2
|
data/Contributing.md
CHANGED
@@ -77,6 +77,7 @@ Thanks to everyone else who has contributed to Diff::LCS:
|
|
77
77
|
* Josef Strzibny
|
78
78
|
* Josh Bronson
|
79
79
|
* Mark Friedgan
|
80
|
+
* Akinori MUSHA
|
80
81
|
|
81
82
|
[Rspec]: http://rspec.info/documentation/
|
82
83
|
[quality commit messages]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
|
data/History.md
CHANGED
@@ -1,197 +1,228 @@
|
|
1
|
+
# History
|
2
|
+
|
3
|
+
## 1.4.2 / 2020-06-23
|
4
|
+
|
5
|
+
- Camille Drapier fixed a small issue with RuboCop configuration. [#59][]
|
6
|
+
- Applied another fix (and unit test) to fix an issue for the Chef team.
|
7
|
+
[#60][], [#61][]
|
8
|
+
|
9
|
+
## 1.4.1 / 2020-06-23
|
10
|
+
|
11
|
+
- Fix an issue where diff sizes could be negative, and they should be. [#57][],
|
12
|
+
[#58][]
|
13
|
+
|
14
|
+
## 1.4 / 2020-06-23
|
15
|
+
|
16
|
+
- Ruby versions lower than 2.4 are soft-deprecated and will not be run as
|
17
|
+
part of the CI process any longer.
|
18
|
+
- Akinora MUSHA (knu) added the ability for Diff::LCS::Change objects to be
|
19
|
+
implicitly treated arrays. Originally provided as pull request [#47][],
|
20
|
+
but it introduced a number of test failures as documented in [#48][], and
|
21
|
+
remediation of Diff::LCS itself was introduced in [#49][].
|
22
|
+
- Resolved [#5][] with some tests comparing output from `system` calls to
|
23
|
+
`bin/ldiff` with some pre-generated output. Resolved [#6][] with these
|
24
|
+
tests.
|
25
|
+
- Resolved a previously undetected `bin/ldiff` issue with `--context` output
|
26
|
+
not matching `diff --context` output.
|
27
|
+
- Resolved an issue with later versions of Ruby not working with an `OptParse`
|
28
|
+
specification of `Numeric`; this has been changed to `Integer`.
|
29
|
+
- Brandon Fish added truffleruby in [#52][].
|
30
|
+
- Fixed two missing classes as reported in [#53][].
|
31
|
+
|
1
32
|
## 1.3 / 2017-01-18
|
2
33
|
|
3
|
-
|
34
|
+
- Bugs fixed:
|
4
35
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
36
|
+
- Fixed an error for bin/ldiff --version. Fixes issue [#21][].
|
37
|
+
- Force Diff::LCS::Change and Diff::LCS::ContextChange to only perform
|
38
|
+
equality comparisons against themselves. Provided by Kevin Mook in
|
39
|
+
pull request [#29][].
|
40
|
+
- Fix tab expansion in htmldiff, provided by Mark Friedgan in
|
41
|
+
pull request [#25][].
|
42
|
+
- Silence Ruby 2.4 Fixnum deprecation warnings. Fixxues issue [#38][] and
|
43
|
+
[pull request#36][].
|
44
|
+
- Ensure that test dependencies are loaded properly. Fixes issue [#33][]
|
45
|
+
and pull request [#34][].
|
46
|
+
- Fix issue [#1][] with incorrect intuition of patch direction. Tentative
|
47
|
+
fix, but the previous failure cases pass now.
|
17
48
|
|
18
|
-
|
49
|
+
- Tooling changes:
|
19
50
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
51
|
+
- Added SimpleCov and Coveralls support.
|
52
|
+
- Change the homepage (temporarily) to the GitHub repo.
|
53
|
+
- Updated testing and gem infrastructure.
|
54
|
+
- Modernized the specs.
|
24
55
|
|
25
|
-
|
56
|
+
- Cleaned up documentation.
|
26
57
|
|
27
|
-
|
58
|
+
- Added a Code of Conduct.
|
28
59
|
|
29
60
|
## 1.2.5 / 2013-11-08
|
30
61
|
|
31
|
-
|
62
|
+
- Bugs fixed:
|
32
63
|
|
33
|
-
|
34
|
-
|
64
|
+
- Comparing arrays flattened them too far, especially with
|
65
|
+
Diff::LCS.sdiff. Fixed by Josh Bronson in pull request [#23][].
|
35
66
|
|
36
67
|
## 1.2.4 / 2013-04-20
|
37
68
|
|
38
|
-
|
69
|
+
- Bugs fixed:
|
39
70
|
|
40
|
-
|
41
|
-
|
42
|
-
|
71
|
+
- A bug was introduced after 1.1.3 when pruning common sequences at the
|
72
|
+
start of comparison. Paul Kunysch (@pck) fixed this in
|
73
|
+
pull request [#18][]. Thanks!
|
43
74
|
|
44
|
-
|
45
|
-
|
46
|
-
|
75
|
+
- The Rubinius (1.9 mode) bug in [rubinius/rubinius#2268][] has been
|
76
|
+
fixed by the Rubinius team two days after it was filed. Thanks for
|
77
|
+
fixing this so quickly!
|
47
78
|
|
48
|
-
|
79
|
+
- Switching to Raggi's hoe-gemspec2 for gemspec generation.
|
49
80
|
|
50
81
|
## 1.2.3 / 2013-04-11
|
51
82
|
|
52
|
-
|
83
|
+
- Bugs Fixed:
|
53
84
|
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
85
|
+
- The new encoding detection for diff output generation (added in 1.2.2)
|
86
|
+
introduced a bug if the left side of the comparison was the empty set.
|
87
|
+
Originally found in [rspec/rspec-expectations#238][] and
|
88
|
+
[rspec/rspec-expectations#239][]. Jon Rowe developed a reasonable
|
89
|
+
heuristic (left side, right side, empty string literal) to avoid this
|
90
|
+
bug.
|
91
|
+
- There is a known issue with Rubinius in 1.9 mode reported in
|
92
|
+
[rubinius/rubinius#2268][] and demonstrated in the Travis CI builds.
|
93
|
+
For all other tested platforms, diff-lcs is considered stable. As soon
|
94
|
+
as a suitably small test-case can be created for the Rubinius team to
|
95
|
+
examine, this will be added to the Rubinius issue around this.
|
65
96
|
|
66
97
|
## 1.2.2 / 2013-03-30
|
67
98
|
|
68
|
-
|
99
|
+
- Bugs Fixed:
|
69
100
|
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
101
|
+
- Diff::LCS::Hunk could not properly generate a difference for comparison
|
102
|
+
sets that are not US-ASCII-compatible because of the use of literal
|
103
|
+
regular expressions and strings. Jon Rowe found this in
|
104
|
+
[rspec/rspec-expectations#219][] and provided a first pass
|
105
|
+
implementation in pull request [#15][]. I've reworked it because of
|
106
|
+
test failures in Rubinius when running in Ruby 1.9 mode. This coerces
|
107
|
+
the added values to the encoding of the old dataset (as determined by
|
108
|
+
the first piece of the old dataset).
|
109
|
+
- Adding Travis CI testing for Ruby 2.0.
|
79
110
|
|
80
111
|
## 1.2.1 / 2013-02-09
|
81
112
|
|
82
|
-
|
113
|
+
- Bugs Fixed:
|
83
114
|
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
115
|
+
- As seen in [rspec/rspec-expectations#200][], the release of
|
116
|
+
Diff::LCS 1.2 introduced an unnecessary public API change to
|
117
|
+
Diff::LCS::Hunk (see the change at
|
118
|
+
[rspec/rspec-expectations@3d6fc82c][] for details). The new method name
|
119
|
+
(and behaviour) is more correct, but I should not have renamed the
|
120
|
+
function or should have at least provided an alias. This release
|
121
|
+
restores Diff::LCS::Hunk#unshift as an alias to #merge. Note that the
|
122
|
+
old #unshift behaviour was incorrect and will not be restored.
|
92
123
|
|
93
124
|
## 1.2.0 / 2013-01-21
|
94
125
|
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
126
|
+
- Minor Enhancements:
|
127
|
+
|
128
|
+
- Added special case handling for Diff::LCS.patch so that it handles
|
129
|
+
patches that are empty or contain no changes.
|
130
|
+
- Added two new methods (#patch_me and #unpatch_me) to the includable
|
131
|
+
module.
|
132
|
+
|
133
|
+
- Bugs Fixed:
|
134
|
+
|
135
|
+
- Fixed issue [#1][] patch direction detection.
|
136
|
+
- Resolved issue [#2][] by handling `string[string.size, 1]` properly (it
|
137
|
+
returns `""` not `nil`).
|
138
|
+
- Michael Granger (ged) fixed an implementation error in
|
139
|
+
Diff::LCS::Change and added specs in pull request [#8][]. Thanks!
|
140
|
+
- Made the code auto-testable.
|
141
|
+
- Vít Ondruch (voxik) provided the latest version of the GPL2 license
|
142
|
+
file in pull request [#10][]. Thanks!
|
143
|
+
- Fixed a documentation issue with the includable versions of #patch! and
|
144
|
+
#unpatch! where they implied that they would replace the original
|
145
|
+
value. Given that Diff::LCS.patch always returns a copy, the
|
146
|
+
documentation was incorrect and has been corrected. To provide the
|
147
|
+
behaviour that was originally documented, two new methods were added to
|
148
|
+
provide this behaviour. Found by scooter-dangle in issue [#12][].
|
149
|
+
Thanks!
|
150
|
+
|
151
|
+
- Code Style Changes:
|
152
|
+
|
153
|
+
- Removed trailing spaces.
|
154
|
+
- Calling class methods using `.` instead of `::`.
|
155
|
+
- Vít Ondruch (voxik) removed unnecessary shebangs in pull request [#9][].
|
156
|
+
Thanks!
|
157
|
+
- Kenichi Kamiya (kachick) removed some warnings of an unused variable in
|
158
|
+
lucky pull request [#13][]. Thanks!
|
159
|
+
- Embarked on a major refactoring to make the files a little more
|
160
|
+
manageable and understand the code on a deeper level.
|
161
|
+
- Adding to http://travis-ci.org.
|
131
162
|
|
132
163
|
## 1.1.3 / 2011-08-27
|
133
164
|
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
165
|
+
- Converted to 'hoe' for release.
|
166
|
+
- Converted tests to RSpec 2.
|
167
|
+
- Extracted the body of htmldiff into a class available from
|
168
|
+
diff/lcs/htmldiff.
|
169
|
+
- Migrated development and issue tracking to GitHub.
|
170
|
+
- Bugs fixed:
|
140
171
|
|
141
|
-
|
142
|
-
|
143
|
-
|
172
|
+
- Eliminated the explicit use of RubyGems in both bin/htmldiff and
|
173
|
+
bin/ldiff. Resolves issue [#4][].
|
174
|
+
- Eliminated Ruby warnings. Resolves issue [#3][].
|
144
175
|
|
145
176
|
## 1.1.2 / 2004-10-20
|
146
177
|
|
147
|
-
|
178
|
+
- Fixed a problem reported by Mauricio Fernandez in htmldiff.
|
148
179
|
|
149
180
|
## 1.1.1 / 2004-09-25
|
150
181
|
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
182
|
+
- Fixed bug #891 (Set returned from patch command does not contain last equal
|
183
|
+
part).
|
184
|
+
- Fixed a problem with callback initialisation code (it assumed that all
|
185
|
+
callbacks passed as classes can be initialised; now, it rescues
|
186
|
+
NoMethodError in the event of private :new being called).
|
187
|
+
- Modified the non-initialisable callbacks to have a private #new method.
|
188
|
+
- Moved ldiff core code to Diff::LCS::Ldiff (diff/lcs/ldiff.rb).
|
158
189
|
|
159
190
|
## 1.1.0 / -
|
160
191
|
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
192
|
+
- Eliminated the need for Diff::LCS::Event and removed it.
|
193
|
+
- Added a contextual diff callback, Diff::LCS::ContextDiffCallback.
|
194
|
+
- Implemented patching/unpatching for standard Diff callback output formats
|
195
|
+
with both #diff and #sdiff.
|
196
|
+
- Extensive documentation changes.
|
166
197
|
|
167
198
|
## 1.0.4
|
168
199
|
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
200
|
+
- Fixed a problem with bin/ldiff output, especially for unified format.
|
201
|
+
Newlines that should have been present weren't.
|
202
|
+
- Changed the .tar.gz installer to generate Windows batch files if ones do
|
203
|
+
not exist already. Removed the existing batch files as they didn't work.
|
173
204
|
|
174
205
|
## 1.0.3
|
175
206
|
|
176
|
-
|
177
|
-
|
207
|
+
- Fixed a problem with #traverse_sequences where the first difference from
|
208
|
+
the left sequence might not be appropriately captured.
|
178
209
|
|
179
210
|
## 1.0.2
|
180
211
|
|
181
|
-
|
182
|
-
|
212
|
+
- Fixed an issue with ldiff not working because actions were changed from
|
213
|
+
symbols to strings.
|
183
214
|
|
184
215
|
## 1.0.1
|
185
216
|
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
217
|
+
- Minor modifications to the gemspec, the README.
|
218
|
+
- Renamed the diff program to ldiff (as well as the companion batch file) so
|
219
|
+
as to not collide with the standard diff program.
|
220
|
+
- Fixed issues with RubyGems. Requires RubyGems > 0.6.1 or >= 0.6.1 with the
|
221
|
+
latest CVS version.
|
191
222
|
|
192
223
|
## 1.0
|
193
224
|
|
194
|
-
|
225
|
+
- Initial release based mostly on Perl's Algorithm::Diff.
|
195
226
|
|
196
227
|
[rubinius/rubinius#2268]: https://github.com/rubinius/rubinius/issues/2268
|
197
228
|
[rspec/rspec-expectations#239]: https://github.com/rspec/rspec-expectations/issues/239
|
@@ -199,22 +230,34 @@
|
|
199
230
|
[rspec/rspec-expectations#219]: https://github.com/rspec/rspec-expectations/issues/219
|
200
231
|
[rspec/rspec-expectations@3d6fc82c]: https://github.com/rspec/rspec-expectations/commit/3d6fc82c
|
201
232
|
[rspec/rspec-expectations#200]: https://github.com/rspec/rspec-expectations/pull/200
|
202
|
-
[
|
203
|
-
[
|
204
|
-
[
|
205
|
-
[
|
206
|
-
[
|
207
|
-
[
|
208
|
-
[
|
209
|
-
[
|
210
|
-
[
|
211
|
-
[
|
212
|
-
[
|
213
|
-
[
|
214
|
-
[
|
215
|
-
[
|
216
|
-
[
|
217
|
-
[
|
218
|
-
[
|
219
|
-
[
|
220
|
-
[
|
233
|
+
[#1]: https://github.com/halostatue/diff-lcs/issues/1
|
234
|
+
[#2]: https://github.com/halostatue/diff-lcs/issues/2
|
235
|
+
[#3]: https://github.com/halostatue/diff-lcs/issues/3
|
236
|
+
[#4]: https://github.com/halostatue/diff-lcs/issues/4
|
237
|
+
[#5]: https://github.com/halostatue/diff-lcs/issues/5
|
238
|
+
[#6]: https://github.com/halostatue/diff-lcs/issues/6
|
239
|
+
[#8]: https://github.com/halostatue/diff-lcs/pull/8
|
240
|
+
[#9]: https://github.com/halostatue/diff-lcs/pull/9
|
241
|
+
[#10]: https://github.com/halostatue/diff-lcs/pull/10
|
242
|
+
[#12]: https://github.com/halostatue/diff-lcs/issues/12
|
243
|
+
[#13]: https://github.com/halostatue/diff-lcs/pull/13
|
244
|
+
[#15]: https://github.com/halostatue/diff-lcs/pull/15
|
245
|
+
[#18]: https://github.com/halostatue/diff-lcs/pull/18
|
246
|
+
[#21]: https://github.com/halostatue/diff-lcs/issues/21
|
247
|
+
[#23]: https://github.com/halostatue/diff-lcs/pull/23
|
248
|
+
[#25]: https://github.com/halostatue/diff-lcs/pull/25
|
249
|
+
[#29]: https://github.com/halostatue/diff-lcs/pull/29
|
250
|
+
[#33]: https://github.com/halostatue/diff-lcs/issues/33
|
251
|
+
[#34]: https://github.com/halostatue/diff-lcs/pull/34
|
252
|
+
[#36]: https://github.com/halostatue/diff-lcs/pull/36
|
253
|
+
[#38]: https://github.com/halostatue/diff-lcs/issues/38
|
254
|
+
[#47]: https://github.com/halostatue/diff-lcs/pull/47
|
255
|
+
[#48]: https://github.com/halostatue/diff-lcs/issues/48
|
256
|
+
[#49]: https://github.com/halostatue/diff-lcs/pull/49
|
257
|
+
[#52]: https://github.com/halostatue/diff-lcs/pull/52
|
258
|
+
[#53]: https://github.com/halostatue/diff-lcs/issues/53
|
259
|
+
[#57]: https://github.com/halostatue/diff-lcs/issues/57
|
260
|
+
[#58]: https://github.com/halostatue/diff-lcs/pull/58
|
261
|
+
[#59]: https://github.com/halostatue/diff-lcs/pull/59
|
262
|
+
[#60]: https://github.com/halostatue/diff-lcs/issues/60
|
263
|
+
[#61]: https://github.com/halostatue/diff-lcs/pull/61
|
data/Manifest.txt
CHANGED
@@ -14,6 +14,7 @@ docs/artistic.txt
|
|
14
14
|
lib/diff-lcs.rb
|
15
15
|
lib/diff/lcs.rb
|
16
16
|
lib/diff/lcs/array.rb
|
17
|
+
lib/diff/lcs/backports.rb
|
17
18
|
lib/diff/lcs/block.rb
|
18
19
|
lib/diff/lcs/callbacks.rb
|
19
20
|
lib/diff/lcs/change.rb
|
@@ -24,8 +25,15 @@ lib/diff/lcs/ldiff.rb
|
|
24
25
|
lib/diff/lcs/string.rb
|
25
26
|
spec/change_spec.rb
|
26
27
|
spec/diff_spec.rb
|
28
|
+
spec/fixtures/aX
|
29
|
+
spec/fixtures/bXaX
|
27
30
|
spec/fixtures/ds1.csv
|
28
31
|
spec/fixtures/ds2.csv
|
32
|
+
spec/fixtures/ldiff/output.diff
|
33
|
+
spec/fixtures/ldiff/output.diff-c
|
34
|
+
spec/fixtures/ldiff/output.diff-e
|
35
|
+
spec/fixtures/ldiff/output.diff-f
|
36
|
+
spec/fixtures/ldiff/output.diff-u
|
29
37
|
spec/hunk_spec.rb
|
30
38
|
spec/issues_spec.rb
|
31
39
|
spec/lcs_spec.rb
|