diff-lcs 1.5.1 → 1.6.1

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 (80) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +506 -0
  3. data/CODE_OF_CONDUCT.md +128 -0
  4. data/CONTRIBUTING.md +71 -0
  5. data/CONTRIBUTORS.md +48 -0
  6. data/{License.md → LICENCE.md} +15 -16
  7. data/Manifest.txt +61 -5
  8. data/README.md +92 -0
  9. data/Rakefile +19 -50
  10. data/SECURITY.md +41 -0
  11. data/docs/artistic.txt +1 -1
  12. data/lib/diff/lcs/change.rb +1 -1
  13. data/lib/diff/lcs/htmldiff.rb +2 -0
  14. data/lib/diff/lcs/hunk.rb +38 -22
  15. data/lib/diff/lcs/ldiff.rb +65 -49
  16. data/lib/diff/lcs/version.rb +7 -0
  17. data/lib/diff/lcs.rb +10 -9
  18. data/mise.toml +5 -0
  19. data/spec/fixtures/123_x +2 -0
  20. data/spec/fixtures/456_x +2 -0
  21. data/spec/fixtures/empty +0 -0
  22. data/spec/fixtures/file1.bin +0 -0
  23. data/spec/fixtures/file2.bin +0 -0
  24. data/spec/fixtures/four_lines +4 -0
  25. data/spec/fixtures/four_lines_with_missing_new_line +4 -0
  26. data/spec/fixtures/ldiff/diff.missing_new_line1-e +1 -0
  27. data/spec/fixtures/ldiff/diff.missing_new_line1-f +1 -0
  28. data/spec/fixtures/ldiff/diff.missing_new_line2-e +1 -0
  29. data/spec/fixtures/ldiff/diff.missing_new_line2-f +1 -0
  30. data/spec/fixtures/ldiff/error.diff.chef-e +2 -0
  31. data/spec/fixtures/ldiff/error.diff.chef-f +2 -0
  32. data/spec/fixtures/ldiff/error.diff.missing_new_line1-e +1 -0
  33. data/spec/fixtures/ldiff/error.diff.missing_new_line1-f +1 -0
  34. data/spec/fixtures/ldiff/error.diff.missing_new_line2-e +1 -0
  35. data/spec/fixtures/ldiff/error.diff.missing_new_line2-f +1 -0
  36. data/spec/fixtures/ldiff/output.diff.bin1 +0 -0
  37. data/spec/fixtures/ldiff/output.diff.bin1-c +0 -0
  38. data/spec/fixtures/ldiff/output.diff.bin1-e +0 -0
  39. data/spec/fixtures/ldiff/output.diff.bin1-f +0 -0
  40. data/spec/fixtures/ldiff/output.diff.bin1-u +0 -0
  41. data/spec/fixtures/ldiff/output.diff.bin2 +1 -0
  42. data/spec/fixtures/ldiff/output.diff.bin2-c +1 -0
  43. data/spec/fixtures/ldiff/output.diff.bin2-e +1 -0
  44. data/spec/fixtures/ldiff/output.diff.bin2-f +1 -0
  45. data/spec/fixtures/ldiff/output.diff.bin2-u +1 -0
  46. data/spec/fixtures/ldiff/output.diff.empty.vs.four_lines +5 -0
  47. data/spec/fixtures/ldiff/output.diff.empty.vs.four_lines-c +9 -0
  48. data/spec/fixtures/ldiff/output.diff.empty.vs.four_lines-e +6 -0
  49. data/spec/fixtures/ldiff/output.diff.empty.vs.four_lines-f +6 -0
  50. data/spec/fixtures/ldiff/output.diff.empty.vs.four_lines-u +7 -0
  51. data/spec/fixtures/ldiff/output.diff.four_lines.vs.empty +5 -0
  52. data/spec/fixtures/ldiff/output.diff.four_lines.vs.empty-c +9 -0
  53. data/spec/fixtures/ldiff/output.diff.four_lines.vs.empty-e +1 -0
  54. data/spec/fixtures/ldiff/output.diff.four_lines.vs.empty-f +1 -0
  55. data/spec/fixtures/ldiff/output.diff.four_lines.vs.empty-u +7 -0
  56. data/spec/fixtures/ldiff/output.diff.issue95_trailing_context +4 -0
  57. data/spec/fixtures/ldiff/output.diff.issue95_trailing_context-c +9 -0
  58. data/spec/fixtures/ldiff/output.diff.issue95_trailing_context-e +3 -0
  59. data/spec/fixtures/ldiff/output.diff.issue95_trailing_context-f +3 -0
  60. data/spec/fixtures/ldiff/output.diff.issue95_trailing_context-u +6 -0
  61. data/spec/fixtures/ldiff/output.diff.missing_new_line1 +5 -0
  62. data/spec/fixtures/ldiff/output.diff.missing_new_line1-c +14 -0
  63. data/spec/fixtures/ldiff/output.diff.missing_new_line1-e +0 -0
  64. data/spec/fixtures/ldiff/output.diff.missing_new_line1-f +0 -0
  65. data/spec/fixtures/ldiff/output.diff.missing_new_line1-u +9 -0
  66. data/spec/fixtures/ldiff/output.diff.missing_new_line2 +5 -0
  67. data/spec/fixtures/ldiff/output.diff.missing_new_line2-c +14 -0
  68. data/spec/fixtures/ldiff/output.diff.missing_new_line2-e +0 -0
  69. data/spec/fixtures/ldiff/output.diff.missing_new_line2-f +0 -0
  70. data/spec/fixtures/ldiff/output.diff.missing_new_line2-u +9 -0
  71. data/spec/hunk_spec.rb +1 -1
  72. data/spec/issues_spec.rb +32 -32
  73. data/spec/ldiff_spec.rb +21 -10
  74. data/spec/patch_spec.rb +1 -1
  75. data/spec/spec_helper.rb +93 -93
  76. metadata +86 -64
  77. data/Code-of-Conduct.md +0 -74
  78. data/Contributing.md +0 -121
  79. data/History.md +0 -431
  80. data/README.rdoc +0 -84
@@ -0,0 +1,9 @@
1
+ --- spec/fixtures/four_lines 2025-01-31 12:17:43.926013315 +0100
2
+ +++ spec/fixtures/four_lines_with_missing_new_line 2025-01-31 12:17:43.926013315 +0100
3
+ @@ -1,4 +1,4 @@
4
+ one
5
+ two
6
+ three
7
+ -four
8
+ +four
9
+
@@ -0,0 +1,5 @@
1
+ 4c4
2
+ < four
3
+
4
+ ---
5
+ > four
@@ -0,0 +1,14 @@
1
+ *** spec/fixtures/four_lines_with_missing_new_line 2025-01-31 12:17:43.926013315 +0100
2
+ --- spec/fixtures/four_lines 2025-01-31 12:17:43.926013315 +0100
3
+ ***************
4
+ *** 1,4 ****
5
+ one
6
+ two
7
+ three
8
+ ! four
9
+
10
+ --- 1,4 ----
11
+ one
12
+ two
13
+ three
14
+ ! four
@@ -0,0 +1,9 @@
1
+ --- spec/fixtures/four_lines_with_missing_new_line 2025-01-31 12:17:43.926013315 +0100
2
+ +++ spec/fixtures/four_lines 2025-01-31 12:17:43.926013315 +0100
3
+ @@ -1,4 +1,4 @@
4
+ one
5
+ two
6
+ three
7
+ -four
8
+
9
+ +four
data/spec/hunk_spec.rb CHANGED
@@ -72,7 +72,7 @@ if String.method_defined?(:encoding)
72
72
 
73
73
  it "produces a unified diff" do
74
74
  expected = <<-EXPECTED.gsub(/^\s+/, "").encode("UTF-16LE").chomp
75
- @@ -1 +1,2 @@
75
+ @@ -0,0 +1 @@
76
76
  +Tu a un carte avec {count} items
77
77
  EXPECTED
78
78
 
data/spec/issues_spec.rb CHANGED
@@ -68,38 +68,6 @@ describe "Diff::LCS Issues" do
68
68
  end
69
69
  end
70
70
 
71
- describe "issue #60" do
72
- it "should produce unified output with correct context" do
73
- # standard:disable Layout/HeredocIndentation
74
- old_data = <<-DATA_OLD.strip.split("\n").map(&:chomp)
75
- {
76
- "name": "x",
77
- "description": "hi"
78
- }
79
- DATA_OLD
80
-
81
- new_data = <<-DATA_NEW.strip.split("\n").map(&:chomp)
82
- {
83
- "name": "x",
84
- "description": "lo"
85
- }
86
- DATA_NEW
87
-
88
- diff = ::Diff::LCS.diff(old_data, new_data)
89
- hunk = ::Diff::LCS::Hunk.new(old_data, new_data, diff.first, 3, 0)
90
-
91
- expect(hunk.diff(:unified)).to eq(<<-EXPECTED.chomp)
92
- @@ -1,5 +1,5 @@
93
- {
94
- "name": "x",
95
- - "description": "hi"
96
- + "description": "lo"
97
- }
98
- EXPECTED
99
- # standard:enable Layout/HeredocIndentation
100
- end
101
- end
102
-
103
71
  describe "issue #65" do
104
72
  def diff_lines(old_lines, new_lines)
105
73
  file_length_difference = 0
@@ -157,4 +125,36 @@ describe "Diff::LCS Issues" do
157
125
  # standard:enable Layout/HeredocIndentation
158
126
  end
159
127
  end
128
+
129
+ describe "issue #107 (replaces issue #60)" do
130
+ it "should produce unified output with correct context" do
131
+ # standard:disable Layout/HeredocIndentation
132
+ old_data = <<-DATA_OLD.strip.split("\n").map(&:chomp)
133
+ {
134
+ "name": "x",
135
+ "description": "hi"
136
+ }
137
+ DATA_OLD
138
+
139
+ new_data = <<-DATA_NEW.strip.split("\n").map(&:chomp)
140
+ {
141
+ "name": "x",
142
+ "description": "lo"
143
+ }
144
+ DATA_NEW
145
+
146
+ diff = ::Diff::LCS.diff(old_data, new_data)
147
+ hunk = ::Diff::LCS::Hunk.new(old_data, new_data, diff.first, 3, 0)
148
+
149
+ expect(hunk.diff(:unified)).to eq(<<-EXPECTED.chomp)
150
+ @@ -1,4 +1,4 @@
151
+ {
152
+ "name": "x",
153
+ - "description": "hi"
154
+ + "description": "lo"
155
+ }
156
+ EXPECTED
157
+ # standard:enable Layout/HeredocIndentation
158
+ end
159
+ end
160
160
  end
data/spec/ldiff_spec.rb CHANGED
@@ -7,9 +7,16 @@ RSpec.describe "bin/ldiff" do
7
7
 
8
8
  # standard:disable Style/HashSyntax
9
9
  fixtures = [
10
- {:name => "output.diff", :left => "aX", :right => "bXaX"},
11
- {:name => "output.diff.chef", :left => "old-chef", :right => "new-chef"},
12
- {:name => "output.diff.chef2", :left => "old-chef2", :right => "new-chef2"}
10
+ {:name => "diff", :left => "aX", :right => "bXaX", :diff => 1},
11
+ {:name => "diff.missing_new_line1", :left => "four_lines", :right => "four_lines_with_missing_new_line", :diff => 1},
12
+ {:name => "diff.missing_new_line2", :left => "four_lines_with_missing_new_line", :right => "four_lines", :diff => 1},
13
+ {:name => "diff.issue95_trailing_context", :left => "123_x", :right => "456_x", :diff => 1},
14
+ {:name => "diff.four_lines.vs.empty", :left => "four_lines", :right => "empty", :diff => 1},
15
+ {:name => "diff.empty.vs.four_lines", :left => "empty", :right => "four_lines", :diff => 1},
16
+ {:name => "diff.bin1", :left => "file1.bin", :right => "file1.bin", :diff => 0},
17
+ {:name => "diff.bin2", :left => "file1.bin", :right => "file2.bin", :diff => 1},
18
+ {:name => "diff.chef", :left => "old-chef", :right => "new-chef", :diff => 1},
19
+ {:name => "diff.chef2", :left => "old-chef2", :right => "new-chef2", :diff => 1}
13
20
  ].product([nil, "-e", "-f", "-c", "-u"]).map { |(fixture, flag)|
14
21
  fixture = fixture.dup
15
22
  fixture[:flag] = flag
@@ -24,11 +31,14 @@ RSpec.describe "bin/ldiff" do
24
31
  "spec/fixtures/#{fixture[:right]}",
25
32
  "#",
26
33
  "=>",
27
- "spec/fixtures/ldiff/#{fixture[:name]}#{fixture[:flag]}"
34
+ "spec/fixtures/ldiff/output.#{fixture[:name]}#{fixture[:flag]}"
28
35
  ].join(" ")
29
36
 
30
37
  it desc do
31
- expect(run_ldiff(fixture)).to eq(read_fixture(fixture))
38
+ stdout, stderr, status = run_ldiff(fixture)
39
+ expect(status).to eq(fixture[:diff])
40
+ expect(stderr).to eq(read_fixture(fixture, mode: "error", allow_missing: true))
41
+ expect(stdout).to eq(read_fixture(fixture, mode: "output", allow_missing: false))
32
42
  end
33
43
  end
34
44
 
@@ -36,10 +46,13 @@ RSpec.describe "bin/ldiff" do
36
46
  test_ldiff(fixture)
37
47
  end
38
48
 
39
- def read_fixture(options)
49
+ def read_fixture(options, mode: "output", allow_missing: false)
40
50
  fixture = options.fetch(:name)
41
51
  flag = options.fetch(:flag)
42
- name = "spec/fixtures/ldiff/#{fixture}#{flag}"
52
+ name = "spec/fixtures/ldiff/#{mode}.#{fixture}#{flag}"
53
+
54
+ return "" if !::File.exist?(name) && allow_missing
55
+
43
56
  data = IO.__send__(IO.respond_to?(:binread) ? :binread : :read, name)
44
57
  clean_data(data, flag)
45
58
  end
@@ -82,8 +95,6 @@ RSpec.describe "bin/ldiff" do
82
95
  system("ruby -Ilib bin/ldiff #{flag} spec/fixtures/#{left} spec/fixtures/#{right}")
83
96
  end
84
97
 
85
- expect(stderr).to be_empty if RUBY_VERSION >= "1.9"
86
- expect(stdout).not_to be_empty
87
- clean_data(stdout, flag)
98
+ [clean_data(stdout, flag), stderr, $?.exitstatus]
88
99
  end
89
100
  end
data/spec/patch_spec.rb CHANGED
@@ -181,7 +181,7 @@ describe "Diff::LCS.patch" do
181
181
  # above.
182
182
  describe "fix bug 891: patchsets do not contain the last equal part" do
183
183
  before :each do
184
- @s1 = %w[a b c d e f g h i j k] # rubocop:disable Layout/SpaceInsideArrayPercentLiteral
184
+ @s1 = %w[a b c d e f g h i j k] # standard:disable Layout/SpaceInsideArrayPercentLiteral
185
185
  @s2 = %w[a b c d D e f g h i j k]
186
186
  end
187
187
 
data/spec/spec_helper.rb CHANGED
@@ -7,28 +7,21 @@ require "psych" if RUBY_VERSION >= "1.9"
7
7
 
8
8
  if ENV["COVERAGE"]
9
9
  require "simplecov"
10
+ require "simplecov-lcov"
10
11
 
11
- def require_do(resource)
12
- require resource
13
- yield if block_given?
14
- rescue LoadError
15
- nil
12
+ SimpleCov::Formatter::LcovFormatter.config do |config|
13
+ config.report_with_single_file = true
14
+ config.lcov_file_name = "lcov.info"
16
15
  end
17
16
 
18
- formatters = [SimpleCov::Formatter::HTMLFormatter]
19
-
20
- require_do("simplecov-rcov") {
21
- formatters << SimpleCov::Formatter::RcovFormatter
22
- }
23
- require_do("simplecov-vim/formatter") {
24
- formatters << SimpleCov::Formatter::VimFormatter
25
- }
26
- require_do("simplecov-sublime-ruby-coverage") {
27
- formatters << SimpleCov::Formatter::SublimeRubyCoverageFormatter
28
- }
29
-
30
- SimpleCov.start do
31
- formatter SimpleCov::Formatter::MultiFormatter.new(formatters)
17
+ SimpleCov.start "test_frameworks" do
18
+ enable_coverage :branch
19
+ primary_coverage :branch
20
+ formatter SimpleCov::Formatter::MultiFormatter.new([
21
+ SimpleCov::Formatter::HTMLFormatter,
22
+ SimpleCov::Formatter::LcovFormatter,
23
+ SimpleCov::Formatter::SimpleFormatter
24
+ ])
32
25
  end
33
26
  end
34
27
 
@@ -250,100 +243,107 @@ module Diff::LCS::SpecHelper
250
243
  new_result
251
244
  end
252
245
 
253
- def simple_callback
254
- callbacks = Object.new
255
- class << callbacks
256
- attr_reader :matched_a
257
- attr_reader :matched_b
258
- attr_reader :discards_a
259
- attr_reader :discards_b
260
- attr_reader :done_a
261
- attr_reader :done_b
262
-
263
- def reset
264
- @matched_a = []
265
- @matched_b = []
266
- @discards_a = []
267
- @discards_b = []
268
- @done_a = []
269
- @done_b = []
270
- end
246
+ class SimpleCallback
247
+ def initialize
248
+ reset
249
+ end
271
250
 
272
- def match(event)
273
- @matched_a << event.old_element
274
- @matched_b << event.new_element
275
- end
251
+ attr_reader :matched_a
252
+ attr_reader :matched_b
253
+ attr_reader :discards_a
254
+ attr_reader :discards_b
255
+ attr_reader :done_a
256
+ attr_reader :done_b
257
+
258
+ def reset
259
+ @matched_a = []
260
+ @matched_b = []
261
+ @discards_a = []
262
+ @discards_b = []
263
+ @done_a = []
264
+ @done_b = []
265
+ self
266
+ end
276
267
 
277
- def discard_b(event)
278
- @discards_b << event.new_element
279
- end
268
+ def match(event)
269
+ @matched_a << event.old_element
270
+ @matched_b << event.new_element
271
+ end
280
272
 
281
- def discard_a(event)
282
- @discards_a << event.old_element
283
- end
273
+ def discard_b(event)
274
+ @discards_b << event.new_element
275
+ end
284
276
 
285
- def finished_a(event)
286
- @done_a << [
287
- event.old_element, event.old_position,
288
- event.new_element, event.new_position
289
- ]
290
- end
277
+ def discard_a(event)
278
+ @discards_a << event.old_element
279
+ end
291
280
 
292
- def finished_b(event)
293
- @done_b << [
294
- event.old_element, event.old_position,
295
- event.new_element, event.new_position
296
- ]
297
- end
281
+ def finished_a(event)
282
+ @done_a << [
283
+ event.old_element, event.old_position,
284
+ event.new_element, event.new_position
285
+ ]
286
+ end
287
+
288
+ def finished_b(event)
289
+ @done_b << [
290
+ event.old_element, event.old_position,
291
+ event.new_element, event.new_position
292
+ ]
298
293
  end
299
- callbacks.reset
300
- callbacks
294
+ end
295
+
296
+ def simple_callback
297
+ SimpleCallback.new
298
+ end
299
+
300
+ class SimpleCallbackNoFinishers < SimpleCallback
301
+ undef :finished_a
302
+ undef :finished_b
301
303
  end
302
304
 
303
305
  def simple_callback_no_finishers
304
- simple = simple_callback
305
- class << simple
306
- undef :finished_a
307
- undef :finished_b
308
- end
309
- simple
306
+ SimpleCallbackNoFinishers.new
310
307
  end
311
308
 
312
- def balanced_callback
313
- cb = Object.new
314
- class << cb
315
- attr_reader :result
309
+ class BalancedCallback
310
+ def initialize
311
+ reset
312
+ end
316
313
 
317
- def reset
318
- @result = []
319
- end
314
+ attr_reader :result
320
315
 
321
- def match(event)
322
- @result << ["=", event.old_position, event.new_position]
323
- end
316
+ def reset
317
+ @result = []
318
+ end
324
319
 
325
- def discard_a(event)
326
- @result << ["<", event.old_position, event.new_position]
327
- end
320
+ def match(event)
321
+ @result << ["=", event.old_position, event.new_position]
322
+ end
328
323
 
329
- def discard_b(event)
330
- @result << [">", event.old_position, event.new_position]
331
- end
324
+ def discard_a(event)
325
+ @result << ["<", event.old_position, event.new_position]
326
+ end
332
327
 
333
- def change(event)
334
- @result << ["!", event.old_position, event.new_position]
335
- end
328
+ def discard_b(event)
329
+ @result << [">", event.old_position, event.new_position]
336
330
  end
337
- cb.reset
338
- cb
331
+
332
+ def change(event)
333
+ @result << ["!", event.old_position, event.new_position]
334
+ end
335
+ end
336
+
337
+ def balanced_callback
338
+ BalancedCallback.new
339
+ end
340
+
341
+ class BalancedCallbackNoChange < BalancedCallback
342
+ undef :change
339
343
  end
340
344
 
341
345
  def balanced_callback_no_change
342
- balanced = balanced_callback
343
- class << balanced
344
- undef :change
345
- end
346
- balanced
346
+ BalancedCallbackNoChange.new
347
347
  end
348
348
 
349
349
  module Matchers
metadata CHANGED
@@ -1,77 +1,42 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: diff-lcs
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.1
4
+ version: 1.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Austin Ziegler
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-01-31 00:00:00.000000000 Z
10
+ date: 2025-03-25 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: hoe
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: '3.0'
20
- - - "<"
21
- - !ruby/object:Gem::Version
22
- version: '5'
23
- type: :development
24
- prerelease: false
25
- version_requirements: !ruby/object:Gem::Requirement
26
- requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- version: '3.0'
30
- - - "<"
31
- - !ruby/object:Gem::Version
32
- version: '5'
33
- - !ruby/object:Gem::Dependency
34
- name: hoe-doofus
35
14
  requirement: !ruby/object:Gem::Requirement
36
15
  requirements:
37
16
  - - "~>"
38
17
  - !ruby/object:Gem::Version
39
- version: '1.0'
18
+ version: '4.0'
40
19
  type: :development
41
20
  prerelease: false
42
21
  version_requirements: !ruby/object:Gem::Requirement
43
22
  requirements:
44
23
  - - "~>"
45
24
  - !ruby/object:Gem::Version
46
- version: '1.0'
25
+ version: '4.0'
47
26
  - !ruby/object:Gem::Dependency
48
- name: hoe-gemspec2
27
+ name: hoe-halostatue
49
28
  requirement: !ruby/object:Gem::Requirement
50
29
  requirements:
51
30
  - - "~>"
52
31
  - !ruby/object:Gem::Version
53
- version: '1.1'
54
- type: :development
55
- prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
57
- requirements:
58
- - - "~>"
59
- - !ruby/object:Gem::Version
60
- version: '1.1'
61
- - !ruby/object:Gem::Dependency
62
- name: hoe-git2
63
- requirement: !ruby/object:Gem::Requirement
64
- requirements:
65
- - - "~>"
66
- - !ruby/object:Gem::Version
67
- version: '1.7'
32
+ version: '2.0'
68
33
  type: :development
69
34
  prerelease: false
70
35
  version_requirements: !ruby/object:Gem::Requirement
71
36
  requirements:
72
37
  - - "~>"
73
38
  - !ruby/object:Gem::Version
74
- version: '1.7'
39
+ version: '2.0'
75
40
  - !ruby/object:Gem::Dependency
76
41
  name: hoe-rubygems
77
42
  requirement: !ruby/object:Gem::Requirement
@@ -152,14 +117,14 @@ description: |-
152
117
  to create a simple HTML diff output format and a standard diff-like tool.
153
118
 
154
119
  This is release 1.4.3, providing a simple extension that allows for
155
- Diff::LCS::Change objects to be treated implicitly as arrays and fixes a
156
- number of formatting issues.
120
+ Diff::LCS::Change objects to be treated implicitly as arrays and fixes a number
121
+ of formatting issues.
157
122
 
158
- Ruby versions below 2.5 are soft-deprecated, which means that older versions
159
- are no longer part of the CI test suite. If any changes have been introduced
160
- that break those versions, bug reports and patches will be accepted, but it
161
- will be up to the reporter to verify any fixes prior to release. The next
162
- major release will completely break compatibility.
123
+ Ruby versions below 2.5 are soft-deprecated, which means that older versions are
124
+ no longer part of the CI test suite. If any changes have been introduced that
125
+ break those versions, bug reports and patches will be accepted, but it will be
126
+ up to the reporter to verify any fixes prior to release. The next major release
127
+ will completely break compatibility.
163
128
  email:
164
129
  - halostatue@gmail.com
165
130
  executables:
@@ -167,23 +132,27 @@ executables:
167
132
  - ldiff
168
133
  extensions: []
169
134
  extra_rdoc_files:
170
- - Code-of-Conduct.md
171
- - Contributing.md
172
- - History.md
173
- - License.md
135
+ - CHANGELOG.md
136
+ - CODE_OF_CONDUCT.md
137
+ - CONTRIBUTING.md
138
+ - CONTRIBUTORS.md
139
+ - LICENCE.md
174
140
  - Manifest.txt
175
- - README.rdoc
141
+ - README.md
142
+ - SECURITY.md
176
143
  - docs/COPYING.txt
177
144
  - docs/artistic.txt
178
145
  files:
179
146
  - ".rspec"
180
- - Code-of-Conduct.md
181
- - Contributing.md
182
- - History.md
183
- - License.md
147
+ - CHANGELOG.md
148
+ - CODE_OF_CONDUCT.md
149
+ - CONTRIBUTING.md
150
+ - CONTRIBUTORS.md
151
+ - LICENCE.md
184
152
  - Manifest.txt
185
- - README.rdoc
153
+ - README.md
186
154
  - Rakefile
155
+ - SECURITY.md
187
156
  - bin/htmldiff
188
157
  - bin/ldiff
189
158
  - docs/COPYING.txt
@@ -200,17 +169,46 @@ files:
200
169
  - lib/diff/lcs/internals.rb
201
170
  - lib/diff/lcs/ldiff.rb
202
171
  - lib/diff/lcs/string.rb
172
+ - lib/diff/lcs/version.rb
173
+ - mise.toml
203
174
  - spec/change_spec.rb
204
175
  - spec/diff_spec.rb
176
+ - spec/fixtures/123_x
177
+ - spec/fixtures/456_x
205
178
  - spec/fixtures/aX
206
179
  - spec/fixtures/bXaX
207
180
  - spec/fixtures/ds1.csv
208
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
209
197
  - spec/fixtures/ldiff/output.diff
210
198
  - spec/fixtures/ldiff/output.diff-c
211
199
  - spec/fixtures/ldiff/output.diff-e
212
200
  - spec/fixtures/ldiff/output.diff-f
213
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
214
212
  - spec/fixtures/ldiff/output.diff.chef
215
213
  - spec/fixtures/ldiff/output.diff.chef-c
216
214
  - spec/fixtures/ldiff/output.diff.chef-e
@@ -222,6 +220,31 @@ files:
222
220
  - spec/fixtures/ldiff/output.diff.chef2-e
223
221
  - spec/fixtures/ldiff/output.diff.chef2-f
224
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
225
248
  - spec/fixtures/new-chef
226
249
  - spec/fixtures/new-chef2
227
250
  - spec/fixtures/old-chef
@@ -238,17 +261,17 @@ files:
238
261
  homepage: https://github.com/halostatue/diff-lcs
239
262
  licenses:
240
263
  - MIT
241
- - Artistic-2.0
264
+ - Artistic-1.0-Perl
242
265
  - GPL-2.0-or-later
243
266
  metadata:
244
267
  homepage_uri: https://github.com/halostatue/diff-lcs
268
+ changelog_uri: https://github.com/halostatue/diff-lcs/blob/main/CHANGELOG.md
245
269
  source_code_uri: https://github.com/halostatue/diff-lcs
246
270
  bug_tracker_uri: https://github.com/halostatue/diff-lcs/issues
247
271
  rubygems_mfa_required: 'true'
248
- post_install_message:
249
272
  rdoc_options:
250
273
  - "--main"
251
- - README.rdoc
274
+ - README.md
252
275
  require_paths:
253
276
  - lib
254
277
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -262,8 +285,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
262
285
  - !ruby/object:Gem::Version
263
286
  version: '0'
264
287
  requirements: []
265
- rubygems_version: 3.5.3
266
- signing_key:
288
+ rubygems_version: 3.6.6
267
289
  specification_version: 4
268
290
  summary: Diff::LCS computes the difference between two Enumerable sequences using
269
291
  the McIlroy-Hunt longest common subsequence (LCS) algorithm