diff-lcs 1.6.2 → 2.0.0.beta.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 +4 -4
- data/CHANGELOG.md +65 -4
- data/CONTRIBUTING.md +91 -35
- data/CONTRIBUTORS.md +19 -9
- data/LICENCE.md +39 -11
- data/Manifest.txt +91 -83
- data/README.md +13 -9
- data/Rakefile +99 -73
- data/SECURITY.md +22 -27
- data/integration/compare/array_diff_spec.rb +10 -0
- data/integration/compare/hash_diff_spec.rb +25 -0
- data/integration/compare/string_diff_spec.rb +10 -0
- data/integration/rspec_differ_spec.rb +26 -0
- data/integration/rspec_expectations_spec.rb +32 -0
- data/integration/runner +20 -0
- data/lib/diff/lcs/block.rb +29 -24
- data/lib/diff/lcs/callbacks.rb +240 -242
- data/lib/diff/lcs/change.rb +102 -104
- data/lib/diff/lcs/hunk.rb +92 -155
- data/lib/diff/lcs/internals.rb +92 -96
- data/lib/diff/lcs/ldiff.rb +30 -38
- data/lib/diff/lcs/version.rb +1 -1
- data/lib/diff/lcs.rb +439 -466
- data/licenses/dco.txt +34 -0
- data/spec/hunk_spec.rb +32 -45
- data/spec/lcs_spec.rb +6 -6
- data/spec/ldiff_spec.rb +8 -8
- data/spec/spec_helper.rb +17 -27
- data/test/fixtures/ldiff/output.diff-c +7 -0
- data/test/fixtures/ldiff/output.diff-u +5 -0
- data/test/fixtures/ldiff/output.diff.bin2 +1 -0
- data/test/fixtures/ldiff/output.diff.bin2-c +1 -0
- data/test/fixtures/ldiff/output.diff.bin2-e +1 -0
- data/test/fixtures/ldiff/output.diff.bin2-f +1 -0
- data/test/fixtures/ldiff/output.diff.bin2-u +1 -0
- data/{spec → test}/fixtures/ldiff/output.diff.chef-c +2 -2
- data/test/fixtures/ldiff/output.diff.chef-u +9 -0
- data/{spec → test}/fixtures/ldiff/output.diff.chef2-c +2 -2
- data/{spec → test}/fixtures/ldiff/output.diff.chef2-u +2 -2
- data/test/fixtures/ldiff/output.diff.empty.vs.four_lines-c +9 -0
- data/test/fixtures/ldiff/output.diff.empty.vs.four_lines-u +7 -0
- data/test/fixtures/ldiff/output.diff.four_lines.vs.empty-c +9 -0
- data/test/fixtures/ldiff/output.diff.four_lines.vs.empty-u +7 -0
- data/test/fixtures/ldiff/output.diff.issue95_trailing_context-c +9 -0
- data/test/fixtures/ldiff/output.diff.issue95_trailing_context-u +6 -0
- data/{spec → test}/fixtures/ldiff/output.diff.missing_new_line1-c +2 -2
- data/test/fixtures/ldiff/output.diff.missing_new_line1-u +9 -0
- data/{spec → test}/fixtures/ldiff/output.diff.missing_new_line2-c +2 -2
- data/test/fixtures/ldiff/output.diff.missing_new_line2-u +9 -0
- data/test/test_block.rb +34 -0
- data/test/test_change.rb +234 -0
- data/test/test_diff.rb +53 -0
- data/test/test_helper.rb +225 -0
- data/test/test_hunk.rb +72 -0
- data/test/test_issues.rb +168 -0
- data/test/test_lcs.rb +47 -0
- data/test/test_ldiff.rb +89 -0
- data/test/test_patch.rb +362 -0
- data/test/test_sdiff.rb +167 -0
- data/test/test_traverse_balanced.rb +322 -0
- data/test/test_traverse_sequences.rb +187 -0
- metadata +199 -110
- data/.rspec +0 -1
- data/bin/htmldiff +0 -35
- data/lib/diff/lcs/backports.rb +0 -13
- data/lib/diff/lcs/htmldiff.rb +0 -160
- data/mise.toml +0 -5
- data/spec/fixtures/ldiff/output.diff-c +0 -7
- data/spec/fixtures/ldiff/output.diff-e +0 -3
- data/spec/fixtures/ldiff/output.diff-f +0 -3
- data/spec/fixtures/ldiff/output.diff-u +0 -5
- data/spec/fixtures/ldiff/output.diff.bin2 +0 -1
- data/spec/fixtures/ldiff/output.diff.bin2-c +0 -1
- data/spec/fixtures/ldiff/output.diff.bin2-e +0 -1
- data/spec/fixtures/ldiff/output.diff.bin2-f +0 -1
- data/spec/fixtures/ldiff/output.diff.bin2-u +0 -1
- data/spec/fixtures/ldiff/output.diff.chef-e +0 -3
- data/spec/fixtures/ldiff/output.diff.chef-f +0 -3
- data/spec/fixtures/ldiff/output.diff.chef-u +0 -9
- data/spec/fixtures/ldiff/output.diff.chef2-e +0 -7
- data/spec/fixtures/ldiff/output.diff.chef2-f +0 -7
- data/spec/fixtures/ldiff/output.diff.empty.vs.four_lines-c +0 -9
- data/spec/fixtures/ldiff/output.diff.empty.vs.four_lines-u +0 -7
- data/spec/fixtures/ldiff/output.diff.four_lines.vs.empty-c +0 -9
- data/spec/fixtures/ldiff/output.diff.four_lines.vs.empty-u +0 -7
- data/spec/fixtures/ldiff/output.diff.issue95_trailing_context-c +0 -9
- data/spec/fixtures/ldiff/output.diff.issue95_trailing_context-u +0 -6
- data/spec/fixtures/ldiff/output.diff.missing_new_line1-u +0 -9
- data/spec/fixtures/ldiff/output.diff.missing_new_line2-u +0 -9
- /data/{docs → licenses}/COPYING.txt +0 -0
- /data/{docs → licenses}/artistic.txt +0 -0
- /data/{spec → test}/fixtures/123_x +0 -0
- /data/{spec → test}/fixtures/456_x +0 -0
- /data/{spec → test}/fixtures/aX +0 -0
- /data/{spec → test}/fixtures/bXaX +0 -0
- /data/{spec → test}/fixtures/ds1.csv +0 -0
- /data/{spec → test}/fixtures/ds2.csv +0 -0
- /data/{spec → test}/fixtures/empty +0 -0
- /data/{spec → test}/fixtures/file1.bin +0 -0
- /data/{spec → test}/fixtures/file2.bin +0 -0
- /data/{spec → test}/fixtures/four_lines +0 -0
- /data/{spec → test}/fixtures/four_lines_with_missing_new_line +0 -0
- /data/{spec → test}/fixtures/ldiff/diff.missing_new_line1-e +0 -0
- /data/{spec → test}/fixtures/ldiff/diff.missing_new_line1-f +0 -0
- /data/{spec → test}/fixtures/ldiff/diff.missing_new_line2-e +0 -0
- /data/{spec → test}/fixtures/ldiff/diff.missing_new_line2-f +0 -0
- /data/{spec → test}/fixtures/ldiff/error.diff.chef-e +0 -0
- /data/{spec → test}/fixtures/ldiff/error.diff.chef-f +0 -0
- /data/{spec → test}/fixtures/ldiff/error.diff.missing_new_line1-e +0 -0
- /data/{spec → test}/fixtures/ldiff/error.diff.missing_new_line1-f +0 -0
- /data/{spec → test}/fixtures/ldiff/error.diff.missing_new_line2-e +0 -0
- /data/{spec → test}/fixtures/ldiff/error.diff.missing_new_line2-f +0 -0
- /data/{spec → test}/fixtures/ldiff/output.diff +0 -0
- /data/{spec → test}/fixtures/ldiff/output.diff.bin1 +0 -0
- /data/{spec → test}/fixtures/ldiff/output.diff.bin1-c +0 -0
- /data/{spec → test}/fixtures/ldiff/output.diff.bin1-e +0 -0
- /data/{spec → test}/fixtures/ldiff/output.diff.bin1-f +0 -0
- /data/{spec → test}/fixtures/ldiff/output.diff.bin1-u +0 -0
- /data/{spec → test}/fixtures/ldiff/output.diff.chef +0 -0
- /data/{spec → test}/fixtures/ldiff/output.diff.chef2 +0 -0
- /data/{spec → test}/fixtures/ldiff/output.diff.chef2-d +0 -0
- /data/{spec → test}/fixtures/ldiff/output.diff.empty.vs.four_lines +0 -0
- /data/{spec → test}/fixtures/ldiff/output.diff.empty.vs.four_lines-e +0 -0
- /data/{spec → test}/fixtures/ldiff/output.diff.empty.vs.four_lines-f +0 -0
- /data/{spec → test}/fixtures/ldiff/output.diff.four_lines.vs.empty +0 -0
- /data/{spec → test}/fixtures/ldiff/output.diff.four_lines.vs.empty-e +0 -0
- /data/{spec → test}/fixtures/ldiff/output.diff.four_lines.vs.empty-f +0 -0
- /data/{spec → test}/fixtures/ldiff/output.diff.issue95_trailing_context +0 -0
- /data/{spec → test}/fixtures/ldiff/output.diff.issue95_trailing_context-e +0 -0
- /data/{spec → test}/fixtures/ldiff/output.diff.issue95_trailing_context-f +0 -0
- /data/{spec → test}/fixtures/ldiff/output.diff.missing_new_line1 +0 -0
- /data/{spec → test}/fixtures/ldiff/output.diff.missing_new_line1-e +0 -0
- /data/{spec → test}/fixtures/ldiff/output.diff.missing_new_line1-f +0 -0
- /data/{spec → test}/fixtures/ldiff/output.diff.missing_new_line2 +0 -0
- /data/{spec → test}/fixtures/ldiff/output.diff.missing_new_line2-e +0 -0
- /data/{spec → test}/fixtures/ldiff/output.diff.missing_new_line2-f +0 -0
- /data/{spec → test}/fixtures/new-chef +0 -0
- /data/{spec → test}/fixtures/new-chef2 +0 -0
- /data/{spec → test}/fixtures/old-chef +0 -0
- /data/{spec → test}/fixtures/old-chef2 +0 -0
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: diff-lcs
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 2.0.0.beta.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Austin Ziegler
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date:
|
|
10
|
+
date: 1970-01-01 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: hoe
|
|
@@ -29,16 +29,30 @@ dependencies:
|
|
|
29
29
|
requirements:
|
|
30
30
|
- - "~>"
|
|
31
31
|
- !ruby/object:Gem::Version
|
|
32
|
-
version: '
|
|
32
|
+
version: '3.0'
|
|
33
33
|
type: :development
|
|
34
34
|
prerelease: false
|
|
35
35
|
version_requirements: !ruby/object:Gem::Requirement
|
|
36
36
|
requirements:
|
|
37
37
|
- - "~>"
|
|
38
38
|
- !ruby/object:Gem::Version
|
|
39
|
-
version: '
|
|
39
|
+
version: '3.0'
|
|
40
40
|
- !ruby/object:Gem::Dependency
|
|
41
|
-
name:
|
|
41
|
+
name: minitest
|
|
42
|
+
requirement: !ruby/object:Gem::Requirement
|
|
43
|
+
requirements:
|
|
44
|
+
- - "~>"
|
|
45
|
+
- !ruby/object:Gem::Version
|
|
46
|
+
version: '6.0'
|
|
47
|
+
type: :development
|
|
48
|
+
prerelease: false
|
|
49
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
50
|
+
requirements:
|
|
51
|
+
- - "~>"
|
|
52
|
+
- !ruby/object:Gem::Version
|
|
53
|
+
version: '6.0'
|
|
54
|
+
- !ruby/object:Gem::Dependency
|
|
55
|
+
name: minitest-autotest
|
|
42
56
|
requirement: !ruby/object:Gem::Requirement
|
|
43
57
|
requirements:
|
|
44
58
|
- - "~>"
|
|
@@ -52,25 +66,19 @@ dependencies:
|
|
|
52
66
|
- !ruby/object:Gem::Version
|
|
53
67
|
version: '1.0'
|
|
54
68
|
- !ruby/object:Gem::Dependency
|
|
55
|
-
name:
|
|
69
|
+
name: minitest-focus
|
|
56
70
|
requirement: !ruby/object:Gem::Requirement
|
|
57
71
|
requirements:
|
|
58
|
-
- - "
|
|
59
|
-
- !ruby/object:Gem::Version
|
|
60
|
-
version: '2.0'
|
|
61
|
-
- - "<"
|
|
72
|
+
- - "~>"
|
|
62
73
|
- !ruby/object:Gem::Version
|
|
63
|
-
version: '
|
|
74
|
+
version: '1.1'
|
|
64
75
|
type: :development
|
|
65
76
|
prerelease: false
|
|
66
77
|
version_requirements: !ruby/object:Gem::Requirement
|
|
67
78
|
requirements:
|
|
68
|
-
- - "
|
|
69
|
-
- !ruby/object:Gem::Version
|
|
70
|
-
version: '2.0'
|
|
71
|
-
- - "<"
|
|
79
|
+
- - "~>"
|
|
72
80
|
- !ruby/object:Gem::Version
|
|
73
|
-
version: '
|
|
81
|
+
version: '1.1'
|
|
74
82
|
- !ruby/object:Gem::Dependency
|
|
75
83
|
name: rake
|
|
76
84
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -97,20 +105,90 @@ dependencies:
|
|
|
97
105
|
requirements:
|
|
98
106
|
- - ">="
|
|
99
107
|
- !ruby/object:Gem::Version
|
|
100
|
-
version: 6.
|
|
108
|
+
version: '6.0'
|
|
101
109
|
- - "<"
|
|
102
110
|
- !ruby/object:Gem::Version
|
|
103
|
-
version: '
|
|
111
|
+
version: '8'
|
|
104
112
|
type: :development
|
|
105
113
|
prerelease: false
|
|
106
114
|
version_requirements: !ruby/object:Gem::Requirement
|
|
107
115
|
requirements:
|
|
108
116
|
- - ">="
|
|
109
117
|
- !ruby/object:Gem::Version
|
|
110
|
-
version: 6.
|
|
118
|
+
version: '6.0'
|
|
111
119
|
- - "<"
|
|
112
120
|
- !ruby/object:Gem::Version
|
|
113
|
-
version: '
|
|
121
|
+
version: '8'
|
|
122
|
+
- !ruby/object:Gem::Dependency
|
|
123
|
+
name: simplecov
|
|
124
|
+
requirement: !ruby/object:Gem::Requirement
|
|
125
|
+
requirements:
|
|
126
|
+
- - "~>"
|
|
127
|
+
- !ruby/object:Gem::Version
|
|
128
|
+
version: '0.9'
|
|
129
|
+
type: :development
|
|
130
|
+
prerelease: false
|
|
131
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
132
|
+
requirements:
|
|
133
|
+
- - "~>"
|
|
134
|
+
- !ruby/object:Gem::Version
|
|
135
|
+
version: '0.9'
|
|
136
|
+
- !ruby/object:Gem::Dependency
|
|
137
|
+
name: simplecov-lcov
|
|
138
|
+
requirement: !ruby/object:Gem::Requirement
|
|
139
|
+
requirements:
|
|
140
|
+
- - "~>"
|
|
141
|
+
- !ruby/object:Gem::Version
|
|
142
|
+
version: '0.9'
|
|
143
|
+
type: :development
|
|
144
|
+
prerelease: false
|
|
145
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
146
|
+
requirements:
|
|
147
|
+
- - "~>"
|
|
148
|
+
- !ruby/object:Gem::Version
|
|
149
|
+
version: '0.9'
|
|
150
|
+
- !ruby/object:Gem::Dependency
|
|
151
|
+
name: standard
|
|
152
|
+
requirement: !ruby/object:Gem::Requirement
|
|
153
|
+
requirements:
|
|
154
|
+
- - "~>"
|
|
155
|
+
- !ruby/object:Gem::Version
|
|
156
|
+
version: '1.50'
|
|
157
|
+
type: :development
|
|
158
|
+
prerelease: false
|
|
159
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
160
|
+
requirements:
|
|
161
|
+
- - "~>"
|
|
162
|
+
- !ruby/object:Gem::Version
|
|
163
|
+
version: '1.50'
|
|
164
|
+
- !ruby/object:Gem::Dependency
|
|
165
|
+
name: standard-thread_safety
|
|
166
|
+
requirement: !ruby/object:Gem::Requirement
|
|
167
|
+
requirements:
|
|
168
|
+
- - "~>"
|
|
169
|
+
- !ruby/object:Gem::Version
|
|
170
|
+
version: '1.0'
|
|
171
|
+
type: :development
|
|
172
|
+
prerelease: false
|
|
173
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
174
|
+
requirements:
|
|
175
|
+
- - "~>"
|
|
176
|
+
- !ruby/object:Gem::Version
|
|
177
|
+
version: '1.0'
|
|
178
|
+
- !ruby/object:Gem::Dependency
|
|
179
|
+
name: fasterer
|
|
180
|
+
requirement: !ruby/object:Gem::Requirement
|
|
181
|
+
requirements:
|
|
182
|
+
- - "~>"
|
|
183
|
+
- !ruby/object:Gem::Version
|
|
184
|
+
version: '0.11'
|
|
185
|
+
type: :development
|
|
186
|
+
prerelease: false
|
|
187
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
188
|
+
requirements:
|
|
189
|
+
- - "~>"
|
|
190
|
+
- !ruby/object:Gem::Version
|
|
191
|
+
version: '0.11'
|
|
114
192
|
description: |-
|
|
115
193
|
Diff::LCS computes the difference between two Enumerable sequences using the
|
|
116
194
|
McIlroy-Hunt longest common subsequence (LCS) algorithm. It includes utilities
|
|
@@ -128,7 +206,6 @@ description: |-
|
|
|
128
206
|
email:
|
|
129
207
|
- halostatue@gmail.com
|
|
130
208
|
executables:
|
|
131
|
-
- htmldiff
|
|
132
209
|
- ldiff
|
|
133
210
|
extensions: []
|
|
134
211
|
extra_rdoc_files:
|
|
@@ -140,10 +217,10 @@ extra_rdoc_files:
|
|
|
140
217
|
- Manifest.txt
|
|
141
218
|
- README.md
|
|
142
219
|
- SECURITY.md
|
|
143
|
-
-
|
|
144
|
-
-
|
|
220
|
+
- licenses/COPYING.txt
|
|
221
|
+
- licenses/artistic.txt
|
|
222
|
+
- licenses/dco.txt
|
|
145
223
|
files:
|
|
146
|
-
- ".rspec"
|
|
147
224
|
- CHANGELOG.md
|
|
148
225
|
- CODE_OF_CONDUCT.md
|
|
149
226
|
- CONTRIBUTING.md
|
|
@@ -153,102 +230,29 @@ files:
|
|
|
153
230
|
- README.md
|
|
154
231
|
- Rakefile
|
|
155
232
|
- SECURITY.md
|
|
156
|
-
- bin/htmldiff
|
|
157
233
|
- bin/ldiff
|
|
158
|
-
-
|
|
159
|
-
-
|
|
234
|
+
- integration/compare/array_diff_spec.rb
|
|
235
|
+
- integration/compare/hash_diff_spec.rb
|
|
236
|
+
- integration/compare/string_diff_spec.rb
|
|
237
|
+
- integration/rspec_differ_spec.rb
|
|
238
|
+
- integration/rspec_expectations_spec.rb
|
|
239
|
+
- integration/runner
|
|
160
240
|
- lib/diff-lcs.rb
|
|
161
241
|
- lib/diff/lcs.rb
|
|
162
242
|
- lib/diff/lcs/array.rb
|
|
163
|
-
- lib/diff/lcs/backports.rb
|
|
164
243
|
- lib/diff/lcs/block.rb
|
|
165
244
|
- lib/diff/lcs/callbacks.rb
|
|
166
245
|
- lib/diff/lcs/change.rb
|
|
167
|
-
- lib/diff/lcs/htmldiff.rb
|
|
168
246
|
- lib/diff/lcs/hunk.rb
|
|
169
247
|
- lib/diff/lcs/internals.rb
|
|
170
248
|
- lib/diff/lcs/ldiff.rb
|
|
171
249
|
- lib/diff/lcs/string.rb
|
|
172
250
|
- lib/diff/lcs/version.rb
|
|
173
|
-
-
|
|
251
|
+
- licenses/COPYING.txt
|
|
252
|
+
- licenses/artistic.txt
|
|
253
|
+
- licenses/dco.txt
|
|
174
254
|
- spec/change_spec.rb
|
|
175
255
|
- spec/diff_spec.rb
|
|
176
|
-
- spec/fixtures/123_x
|
|
177
|
-
- spec/fixtures/456_x
|
|
178
|
-
- spec/fixtures/aX
|
|
179
|
-
- spec/fixtures/bXaX
|
|
180
|
-
- spec/fixtures/ds1.csv
|
|
181
|
-
- spec/fixtures/ds2.csv
|
|
182
|
-
- spec/fixtures/empty
|
|
183
|
-
- spec/fixtures/file1.bin
|
|
184
|
-
- spec/fixtures/file2.bin
|
|
185
|
-
- spec/fixtures/four_lines
|
|
186
|
-
- spec/fixtures/four_lines_with_missing_new_line
|
|
187
|
-
- spec/fixtures/ldiff/diff.missing_new_line1-e
|
|
188
|
-
- spec/fixtures/ldiff/diff.missing_new_line1-f
|
|
189
|
-
- spec/fixtures/ldiff/diff.missing_new_line2-e
|
|
190
|
-
- spec/fixtures/ldiff/diff.missing_new_line2-f
|
|
191
|
-
- spec/fixtures/ldiff/error.diff.chef-e
|
|
192
|
-
- spec/fixtures/ldiff/error.diff.chef-f
|
|
193
|
-
- spec/fixtures/ldiff/error.diff.missing_new_line1-e
|
|
194
|
-
- spec/fixtures/ldiff/error.diff.missing_new_line1-f
|
|
195
|
-
- spec/fixtures/ldiff/error.diff.missing_new_line2-e
|
|
196
|
-
- spec/fixtures/ldiff/error.diff.missing_new_line2-f
|
|
197
|
-
- spec/fixtures/ldiff/output.diff
|
|
198
|
-
- spec/fixtures/ldiff/output.diff-c
|
|
199
|
-
- spec/fixtures/ldiff/output.diff-e
|
|
200
|
-
- spec/fixtures/ldiff/output.diff-f
|
|
201
|
-
- spec/fixtures/ldiff/output.diff-u
|
|
202
|
-
- spec/fixtures/ldiff/output.diff.bin1
|
|
203
|
-
- spec/fixtures/ldiff/output.diff.bin1-c
|
|
204
|
-
- spec/fixtures/ldiff/output.diff.bin1-e
|
|
205
|
-
- spec/fixtures/ldiff/output.diff.bin1-f
|
|
206
|
-
- spec/fixtures/ldiff/output.diff.bin1-u
|
|
207
|
-
- spec/fixtures/ldiff/output.diff.bin2
|
|
208
|
-
- spec/fixtures/ldiff/output.diff.bin2-c
|
|
209
|
-
- spec/fixtures/ldiff/output.diff.bin2-e
|
|
210
|
-
- spec/fixtures/ldiff/output.diff.bin2-f
|
|
211
|
-
- spec/fixtures/ldiff/output.diff.bin2-u
|
|
212
|
-
- spec/fixtures/ldiff/output.diff.chef
|
|
213
|
-
- spec/fixtures/ldiff/output.diff.chef-c
|
|
214
|
-
- spec/fixtures/ldiff/output.diff.chef-e
|
|
215
|
-
- spec/fixtures/ldiff/output.diff.chef-f
|
|
216
|
-
- spec/fixtures/ldiff/output.diff.chef-u
|
|
217
|
-
- spec/fixtures/ldiff/output.diff.chef2
|
|
218
|
-
- spec/fixtures/ldiff/output.diff.chef2-c
|
|
219
|
-
- spec/fixtures/ldiff/output.diff.chef2-d
|
|
220
|
-
- spec/fixtures/ldiff/output.diff.chef2-e
|
|
221
|
-
- spec/fixtures/ldiff/output.diff.chef2-f
|
|
222
|
-
- spec/fixtures/ldiff/output.diff.chef2-u
|
|
223
|
-
- spec/fixtures/ldiff/output.diff.empty.vs.four_lines
|
|
224
|
-
- spec/fixtures/ldiff/output.diff.empty.vs.four_lines-c
|
|
225
|
-
- spec/fixtures/ldiff/output.diff.empty.vs.four_lines-e
|
|
226
|
-
- spec/fixtures/ldiff/output.diff.empty.vs.four_lines-f
|
|
227
|
-
- spec/fixtures/ldiff/output.diff.empty.vs.four_lines-u
|
|
228
|
-
- spec/fixtures/ldiff/output.diff.four_lines.vs.empty
|
|
229
|
-
- spec/fixtures/ldiff/output.diff.four_lines.vs.empty-c
|
|
230
|
-
- spec/fixtures/ldiff/output.diff.four_lines.vs.empty-e
|
|
231
|
-
- spec/fixtures/ldiff/output.diff.four_lines.vs.empty-f
|
|
232
|
-
- spec/fixtures/ldiff/output.diff.four_lines.vs.empty-u
|
|
233
|
-
- spec/fixtures/ldiff/output.diff.issue95_trailing_context
|
|
234
|
-
- spec/fixtures/ldiff/output.diff.issue95_trailing_context-c
|
|
235
|
-
- spec/fixtures/ldiff/output.diff.issue95_trailing_context-e
|
|
236
|
-
- spec/fixtures/ldiff/output.diff.issue95_trailing_context-f
|
|
237
|
-
- spec/fixtures/ldiff/output.diff.issue95_trailing_context-u
|
|
238
|
-
- spec/fixtures/ldiff/output.diff.missing_new_line1
|
|
239
|
-
- spec/fixtures/ldiff/output.diff.missing_new_line1-c
|
|
240
|
-
- spec/fixtures/ldiff/output.diff.missing_new_line1-e
|
|
241
|
-
- spec/fixtures/ldiff/output.diff.missing_new_line1-f
|
|
242
|
-
- spec/fixtures/ldiff/output.diff.missing_new_line1-u
|
|
243
|
-
- spec/fixtures/ldiff/output.diff.missing_new_line2
|
|
244
|
-
- spec/fixtures/ldiff/output.diff.missing_new_line2-c
|
|
245
|
-
- spec/fixtures/ldiff/output.diff.missing_new_line2-e
|
|
246
|
-
- spec/fixtures/ldiff/output.diff.missing_new_line2-f
|
|
247
|
-
- spec/fixtures/ldiff/output.diff.missing_new_line2-u
|
|
248
|
-
- spec/fixtures/new-chef
|
|
249
|
-
- spec/fixtures/new-chef2
|
|
250
|
-
- spec/fixtures/old-chef
|
|
251
|
-
- spec/fixtures/old-chef2
|
|
252
256
|
- spec/hunk_spec.rb
|
|
253
257
|
- spec/issues_spec.rb
|
|
254
258
|
- spec/lcs_spec.rb
|
|
@@ -258,16 +262,98 @@ files:
|
|
|
258
262
|
- spec/spec_helper.rb
|
|
259
263
|
- spec/traverse_balanced_spec.rb
|
|
260
264
|
- spec/traverse_sequences_spec.rb
|
|
265
|
+
- test/fixtures/123_x
|
|
266
|
+
- test/fixtures/456_x
|
|
267
|
+
- test/fixtures/aX
|
|
268
|
+
- test/fixtures/bXaX
|
|
269
|
+
- test/fixtures/ds1.csv
|
|
270
|
+
- test/fixtures/ds2.csv
|
|
271
|
+
- test/fixtures/empty
|
|
272
|
+
- test/fixtures/file1.bin
|
|
273
|
+
- test/fixtures/file2.bin
|
|
274
|
+
- test/fixtures/four_lines
|
|
275
|
+
- test/fixtures/four_lines_with_missing_new_line
|
|
276
|
+
- test/fixtures/ldiff/diff.missing_new_line1-e
|
|
277
|
+
- test/fixtures/ldiff/diff.missing_new_line1-f
|
|
278
|
+
- test/fixtures/ldiff/diff.missing_new_line2-e
|
|
279
|
+
- test/fixtures/ldiff/diff.missing_new_line2-f
|
|
280
|
+
- test/fixtures/ldiff/error.diff.chef-e
|
|
281
|
+
- test/fixtures/ldiff/error.diff.chef-f
|
|
282
|
+
- test/fixtures/ldiff/error.diff.missing_new_line1-e
|
|
283
|
+
- test/fixtures/ldiff/error.diff.missing_new_line1-f
|
|
284
|
+
- test/fixtures/ldiff/error.diff.missing_new_line2-e
|
|
285
|
+
- test/fixtures/ldiff/error.diff.missing_new_line2-f
|
|
286
|
+
- test/fixtures/ldiff/output.diff
|
|
287
|
+
- test/fixtures/ldiff/output.diff-c
|
|
288
|
+
- test/fixtures/ldiff/output.diff-u
|
|
289
|
+
- test/fixtures/ldiff/output.diff.bin1
|
|
290
|
+
- test/fixtures/ldiff/output.diff.bin1-c
|
|
291
|
+
- test/fixtures/ldiff/output.diff.bin1-e
|
|
292
|
+
- test/fixtures/ldiff/output.diff.bin1-f
|
|
293
|
+
- test/fixtures/ldiff/output.diff.bin1-u
|
|
294
|
+
- test/fixtures/ldiff/output.diff.bin2
|
|
295
|
+
- test/fixtures/ldiff/output.diff.bin2-c
|
|
296
|
+
- test/fixtures/ldiff/output.diff.bin2-e
|
|
297
|
+
- test/fixtures/ldiff/output.diff.bin2-f
|
|
298
|
+
- test/fixtures/ldiff/output.diff.bin2-u
|
|
299
|
+
- test/fixtures/ldiff/output.diff.chef
|
|
300
|
+
- test/fixtures/ldiff/output.diff.chef-c
|
|
301
|
+
- test/fixtures/ldiff/output.diff.chef-u
|
|
302
|
+
- test/fixtures/ldiff/output.diff.chef2
|
|
303
|
+
- test/fixtures/ldiff/output.diff.chef2-c
|
|
304
|
+
- test/fixtures/ldiff/output.diff.chef2-d
|
|
305
|
+
- test/fixtures/ldiff/output.diff.chef2-u
|
|
306
|
+
- test/fixtures/ldiff/output.diff.empty.vs.four_lines
|
|
307
|
+
- test/fixtures/ldiff/output.diff.empty.vs.four_lines-c
|
|
308
|
+
- test/fixtures/ldiff/output.diff.empty.vs.four_lines-e
|
|
309
|
+
- test/fixtures/ldiff/output.diff.empty.vs.four_lines-f
|
|
310
|
+
- test/fixtures/ldiff/output.diff.empty.vs.four_lines-u
|
|
311
|
+
- test/fixtures/ldiff/output.diff.four_lines.vs.empty
|
|
312
|
+
- test/fixtures/ldiff/output.diff.four_lines.vs.empty-c
|
|
313
|
+
- test/fixtures/ldiff/output.diff.four_lines.vs.empty-e
|
|
314
|
+
- test/fixtures/ldiff/output.diff.four_lines.vs.empty-f
|
|
315
|
+
- test/fixtures/ldiff/output.diff.four_lines.vs.empty-u
|
|
316
|
+
- test/fixtures/ldiff/output.diff.issue95_trailing_context
|
|
317
|
+
- test/fixtures/ldiff/output.diff.issue95_trailing_context-c
|
|
318
|
+
- test/fixtures/ldiff/output.diff.issue95_trailing_context-e
|
|
319
|
+
- test/fixtures/ldiff/output.diff.issue95_trailing_context-f
|
|
320
|
+
- test/fixtures/ldiff/output.diff.issue95_trailing_context-u
|
|
321
|
+
- test/fixtures/ldiff/output.diff.missing_new_line1
|
|
322
|
+
- test/fixtures/ldiff/output.diff.missing_new_line1-c
|
|
323
|
+
- test/fixtures/ldiff/output.diff.missing_new_line1-e
|
|
324
|
+
- test/fixtures/ldiff/output.diff.missing_new_line1-f
|
|
325
|
+
- test/fixtures/ldiff/output.diff.missing_new_line1-u
|
|
326
|
+
- test/fixtures/ldiff/output.diff.missing_new_line2
|
|
327
|
+
- test/fixtures/ldiff/output.diff.missing_new_line2-c
|
|
328
|
+
- test/fixtures/ldiff/output.diff.missing_new_line2-e
|
|
329
|
+
- test/fixtures/ldiff/output.diff.missing_new_line2-f
|
|
330
|
+
- test/fixtures/ldiff/output.diff.missing_new_line2-u
|
|
331
|
+
- test/fixtures/new-chef
|
|
332
|
+
- test/fixtures/new-chef2
|
|
333
|
+
- test/fixtures/old-chef
|
|
334
|
+
- test/fixtures/old-chef2
|
|
335
|
+
- test/test_block.rb
|
|
336
|
+
- test/test_change.rb
|
|
337
|
+
- test/test_diff.rb
|
|
338
|
+
- test/test_helper.rb
|
|
339
|
+
- test/test_hunk.rb
|
|
340
|
+
- test/test_issues.rb
|
|
341
|
+
- test/test_lcs.rb
|
|
342
|
+
- test/test_ldiff.rb
|
|
343
|
+
- test/test_patch.rb
|
|
344
|
+
- test/test_sdiff.rb
|
|
345
|
+
- test/test_traverse_balanced.rb
|
|
346
|
+
- test/test_traverse_sequences.rb
|
|
261
347
|
homepage: https://github.com/halostatue/diff-lcs
|
|
262
348
|
licenses:
|
|
263
349
|
- MIT
|
|
264
350
|
- Artistic-1.0-Perl
|
|
265
351
|
- GPL-2.0-or-later
|
|
266
352
|
metadata:
|
|
267
|
-
homepage_uri: https://github.com/halostatue/diff-lcs
|
|
268
|
-
changelog_uri: https://github.com/halostatue/diff-lcs/blob/main/CHANGELOG.md
|
|
269
353
|
source_code_uri: https://github.com/halostatue/diff-lcs
|
|
270
354
|
bug_tracker_uri: https://github.com/halostatue/diff-lcs/issues
|
|
355
|
+
documentation_uri: https://halostatue.github.io/diff-lcs/
|
|
356
|
+
changelog_uri: https://github.com/halostatue/diff-lcs/blob/main/CHANGELOG.md
|
|
271
357
|
rubygems_mfa_required: 'true'
|
|
272
358
|
rdoc_options:
|
|
273
359
|
- "--main"
|
|
@@ -278,14 +364,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
278
364
|
requirements:
|
|
279
365
|
- - ">="
|
|
280
366
|
- !ruby/object:Gem::Version
|
|
281
|
-
version:
|
|
367
|
+
version: 3.2.0
|
|
368
|
+
- - "<"
|
|
369
|
+
- !ruby/object:Gem::Version
|
|
370
|
+
version: '5'
|
|
282
371
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
283
372
|
requirements:
|
|
284
373
|
- - ">="
|
|
285
374
|
- !ruby/object:Gem::Version
|
|
286
375
|
version: '0'
|
|
287
376
|
requirements: []
|
|
288
|
-
rubygems_version:
|
|
377
|
+
rubygems_version: 4.0.4
|
|
289
378
|
specification_version: 4
|
|
290
379
|
summary: Diff::LCS computes the difference between two Enumerable sequences using
|
|
291
380
|
the McIlroy-Hunt longest common subsequence (LCS) algorithm
|
data/.rspec
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
--colour
|
data/bin/htmldiff
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
#! /usr/bin/env ruby -w
|
|
2
|
-
# frozen_string_literal: true
|
|
3
|
-
|
|
4
|
-
require "diff/lcs"
|
|
5
|
-
require "diff/lcs/htmldiff"
|
|
6
|
-
|
|
7
|
-
begin
|
|
8
|
-
require "text/format"
|
|
9
|
-
rescue LoadError
|
|
10
|
-
Diff::LCS::HTMLDiff.can_expand_tabs = false
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
if ARGV.size < 2 or ARGV.size > 3
|
|
14
|
-
warn "usage: #{File.basename($0)} old new [output.html]"
|
|
15
|
-
warn " #{File.basename($0)} old new > output.html"
|
|
16
|
-
exit 127
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
left = IO.read(ARGV[0]).split($/)
|
|
20
|
-
right = IO.read(ARGV[1]).split($/)
|
|
21
|
-
|
|
22
|
-
options = { :title => "diff #{ARGV[0]} #{ARGV[1]}" }
|
|
23
|
-
|
|
24
|
-
htmldiff = Diff::LCS::HTMLDiff.new(left, right, options)
|
|
25
|
-
|
|
26
|
-
if ARGV[2]
|
|
27
|
-
File.open(ARGV[2], "w") do |f|
|
|
28
|
-
htmldiff.options[:output] = f
|
|
29
|
-
htmldiff.run
|
|
30
|
-
end
|
|
31
|
-
else
|
|
32
|
-
htmldiff.run
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
# vim: ft=ruby
|
data/lib/diff/lcs/backports.rb
DELETED
data/lib/diff/lcs/htmldiff.rb
DELETED
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require "erb"
|
|
4
|
-
|
|
5
|
-
# Produce a simple HTML diff view.
|
|
6
|
-
class Diff::LCS::HTMLDiff
|
|
7
|
-
class << self
|
|
8
|
-
# standard:disable ThreadSafety/ClassAndModuleAttributes
|
|
9
|
-
attr_accessor :can_expand_tabs # :nodoc:
|
|
10
|
-
# standard:enable ThreadSafety/ClassAndModuleAttributes
|
|
11
|
-
end
|
|
12
|
-
self.can_expand_tabs = true
|
|
13
|
-
|
|
14
|
-
class Callbacks # :nodoc:
|
|
15
|
-
attr_accessor :output
|
|
16
|
-
attr_accessor :match_class
|
|
17
|
-
attr_accessor :only_a_class
|
|
18
|
-
attr_accessor :only_b_class
|
|
19
|
-
|
|
20
|
-
def initialize(output, options = {})
|
|
21
|
-
@output = output
|
|
22
|
-
options ||= {}
|
|
23
|
-
|
|
24
|
-
@match_class = options[:match_class] || "match"
|
|
25
|
-
@only_a_class = options[:only_a_class] || "only_a"
|
|
26
|
-
@only_b_class = options[:only_b_class] || "only_b"
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
def htmlize(element, css_class)
|
|
30
|
-
element = " " if element.empty?
|
|
31
|
-
%(<pre class="#{__send__(css_class)}">#{element}</pre>\n)
|
|
32
|
-
end
|
|
33
|
-
private :htmlize
|
|
34
|
-
|
|
35
|
-
# This will be called with both lines are the same
|
|
36
|
-
def match(event)
|
|
37
|
-
@output << htmlize(event.old_element, :match_class)
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
# This will be called when there is a line in A that isn't in B
|
|
41
|
-
def discard_a(event)
|
|
42
|
-
@output << htmlize(event.old_element, :only_a_class)
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
# This will be called when there is a line in B that isn't in A
|
|
46
|
-
def discard_b(event)
|
|
47
|
-
@output << htmlize(event.new_element, :only_b_class)
|
|
48
|
-
end
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
# standard:disable Style/HashSyntax
|
|
52
|
-
DEFAULT_OPTIONS = {
|
|
53
|
-
:expand_tabs => nil,
|
|
54
|
-
:output => nil,
|
|
55
|
-
:css => nil,
|
|
56
|
-
:title => nil
|
|
57
|
-
}.freeze
|
|
58
|
-
# standard:enable Style/HashSyntax
|
|
59
|
-
|
|
60
|
-
# standard:disable Layout/HeredocIndentation
|
|
61
|
-
DEFAULT_CSS = <<-CSS
|
|
62
|
-
body { margin: 0; }
|
|
63
|
-
.diff
|
|
64
|
-
{
|
|
65
|
-
border: 1px solid black;
|
|
66
|
-
margin: 1em 2em;
|
|
67
|
-
}
|
|
68
|
-
p
|
|
69
|
-
{
|
|
70
|
-
margin-left: 2em;
|
|
71
|
-
}
|
|
72
|
-
pre
|
|
73
|
-
{
|
|
74
|
-
padding-left: 1em;
|
|
75
|
-
margin: 0;
|
|
76
|
-
font-family: Inconsolata, Consolas, Lucida, Courier, monospaced;
|
|
77
|
-
white-space: pre;
|
|
78
|
-
}
|
|
79
|
-
.match { }
|
|
80
|
-
.only_a
|
|
81
|
-
{
|
|
82
|
-
background-color: #fdd;
|
|
83
|
-
color: red;
|
|
84
|
-
text-decoration: line-through;
|
|
85
|
-
}
|
|
86
|
-
.only_b
|
|
87
|
-
{
|
|
88
|
-
background-color: #ddf;
|
|
89
|
-
color: blue;
|
|
90
|
-
border-left: 3px solid blue
|
|
91
|
-
}
|
|
92
|
-
h1 { margin-left: 2em; }
|
|
93
|
-
CSS
|
|
94
|
-
# standard:enable Layout/HeredocIndentation
|
|
95
|
-
|
|
96
|
-
def initialize(left, right, options = nil)
|
|
97
|
-
@left = left
|
|
98
|
-
@right = right
|
|
99
|
-
@options = options
|
|
100
|
-
|
|
101
|
-
@options = DEFAULT_OPTIONS.dup if @options.nil?
|
|
102
|
-
end
|
|
103
|
-
|
|
104
|
-
def verify_options
|
|
105
|
-
@options[:expand_tabs] ||= 4
|
|
106
|
-
@options[:expand_tabs] = 4 if @options[:expand_tabs].negative?
|
|
107
|
-
|
|
108
|
-
@options[:output] ||= $stdout
|
|
109
|
-
|
|
110
|
-
@options[:css] ||= DEFAULT_CSS.dup
|
|
111
|
-
|
|
112
|
-
@options[:title] ||= "diff"
|
|
113
|
-
end
|
|
114
|
-
private :verify_options
|
|
115
|
-
|
|
116
|
-
attr_reader :options
|
|
117
|
-
|
|
118
|
-
def run
|
|
119
|
-
verify_options
|
|
120
|
-
|
|
121
|
-
if @options[:expand_tabs].positive? && self.class.can_expand_tabs
|
|
122
|
-
formatter = Text::Format.new
|
|
123
|
-
formatter.tabstop = @options[:expand_tabs]
|
|
124
|
-
|
|
125
|
-
@left.map! { |line| formatter.expand(line.chomp) }
|
|
126
|
-
@right.map! { |line| formatter.expand(line.chomp) }
|
|
127
|
-
end
|
|
128
|
-
|
|
129
|
-
@left.map! { |line| ERB::Util.html_escape(line.chomp) }
|
|
130
|
-
@right.map! { |line| ERB::Util.html_escape(line.chomp) }
|
|
131
|
-
|
|
132
|
-
# standard:disable Layout/HeredocIndentation
|
|
133
|
-
@options[:output] << <<-OUTPUT
|
|
134
|
-
<html>
|
|
135
|
-
<head>
|
|
136
|
-
<title>#{@options[:title]}</title>
|
|
137
|
-
<style type="text/css">
|
|
138
|
-
#{@options[:css]}
|
|
139
|
-
</style>
|
|
140
|
-
</head>
|
|
141
|
-
<body>
|
|
142
|
-
<h1>#{@options[:title]}</h1>
|
|
143
|
-
<p>Legend: <span class="only_a">Only in Old</span>
|
|
144
|
-
<span class="only_b">Only in New</span></p>
|
|
145
|
-
<div class="diff">
|
|
146
|
-
OUTPUT
|
|
147
|
-
# standard:enable Layout/HeredocIndentation
|
|
148
|
-
|
|
149
|
-
callbacks = Callbacks.new(@options[:output])
|
|
150
|
-
Diff::LCS.traverse_sequences(@left, @right, callbacks)
|
|
151
|
-
|
|
152
|
-
# standard:disable Layout/HeredocIndentation
|
|
153
|
-
@options[:output] << <<-OUTPUT
|
|
154
|
-
</div>
|
|
155
|
-
</body>
|
|
156
|
-
</html>
|
|
157
|
-
OUTPUT
|
|
158
|
-
# standard:enable Layout/HeredocIndentation
|
|
159
|
-
end
|
|
160
|
-
end
|
data/mise.toml
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Binary files spec/fixtures/file1.bin and spec/fixtures/file2.bin differ
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Binary files spec/fixtures/file1.bin and spec/fixtures/file2.bin differ
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Binary files spec/fixtures/file1.bin and spec/fixtures/file2.bin differ
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Binary files spec/fixtures/file1.bin and spec/fixtures/file2.bin differ
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Binary files spec/fixtures/file1.bin and spec/fixtures/file2.bin differ
|