diff-lcs 1.4.2 → 1.4.3
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/History.md +15 -0
- data/README.rdoc +9 -8
- data/Rakefile +19 -2
- data/lib/diff/lcs.rb +1 -1
- data/lib/diff/lcs/hunk.rb +1 -1
- data/spec/ldiff_spec.rb +12 -6
- data/spec/spec_helper.rb +3 -1
- metadata +10 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3aa8c326a9b00349dc45116d256c9424b59dfcc86209c2104c8e37fe3f4f2b7e
|
4
|
+
data.tar.gz: c322b671558bfa75c6dd01c000d433b87021bbd8fc66047042f0386366600533
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e4411d9509d05782ae5bd1a0ec75d684de3060a7722858b08075502b1719c52e7bc65931fb913d650b804bc5b0927a894514edeff907b173c1f66464e5a76454
|
7
|
+
data.tar.gz: 1a73c4dff58592cbf20a4bbf42493bc9dec4a02b728e6d07f6315cbdb25f1ce43fd39defff7d2799da31c759b4f7f2411e9d0c9be4a72adc4c84a38d28a7d909
|
data/History.md
CHANGED
@@ -1,5 +1,19 @@
|
|
1
1
|
# History
|
2
2
|
|
3
|
+
## 1.4.3 / 2020-06-29
|
4
|
+
|
5
|
+
- Fixed several issues with the 1.4 on Rubies older than 2.0. Some of this was
|
6
|
+
providing useful shim functions to Hoe 3.x (which dropped these older
|
7
|
+
Rubies a while ago). Specifically:
|
8
|
+
|
9
|
+
- Removed Array#lazy from a method in Diff::LCS::Hunk.
|
10
|
+
- Changed some unit tests to use old-style Symbol-keyed hashes.
|
11
|
+
- Changed some unit test helper functions to no longer use keyword
|
12
|
+
parameters, but only a trailing options hash.
|
13
|
+
- Made the use of `psych` dependent on `RUBY_VERSION >= 1.9`.
|
14
|
+
|
15
|
+
Resolves [#63][].
|
16
|
+
|
3
17
|
## 1.4.2 / 2020-06-23
|
4
18
|
|
5
19
|
- Camille Drapier fixed a small issue with RuboCop configuration. [#59][]
|
@@ -261,3 +275,4 @@
|
|
261
275
|
[#59]: https://github.com/halostatue/diff-lcs/pull/59
|
262
276
|
[#60]: https://github.com/halostatue/diff-lcs/issues/60
|
263
277
|
[#61]: https://github.com/halostatue/diff-lcs/pull/61
|
278
|
+
[#63]: https://github.com/halostatue/diff-lcs/issues/63
|
data/README.rdoc
CHANGED
@@ -12,14 +12,15 @@ Diff::LCS computes the difference between two Enumerable sequences using the
|
|
12
12
|
McIlroy-Hunt longest common subsequence (LCS) algorithm. It includes utilities
|
13
13
|
to create a simple HTML diff output format and a standard diff-like tool.
|
14
14
|
|
15
|
-
This is release 1.4, providing a simple extension that allows for
|
16
|
-
Diff::LCS::Change objects to be treated implicitly as arrays
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
to
|
15
|
+
This is release 1.4.3, providing a simple extension that allows for
|
16
|
+
Diff::LCS::Change objects to be treated implicitly as arrays and fixes a
|
17
|
+
number of formatting issues.
|
18
|
+
|
19
|
+
Ruby versions below 2.5 are soft-deprecated, which means that older versions
|
20
|
+
are no longer part of the CI test suite. If any changes have been introduced
|
21
|
+
that break those versions, bug reports and patches will be accepted, but it
|
22
|
+
will be up to the reporter to verify any fixes prior to release. The next
|
23
|
+
major release will completely break compatibility.
|
23
24
|
|
24
25
|
== Synopsis
|
25
26
|
|
data/Rakefile
CHANGED
@@ -6,10 +6,27 @@ require 'hoe'
|
|
6
6
|
|
7
7
|
Hoe.plugin :bundler
|
8
8
|
Hoe.plugin :doofus
|
9
|
-
Hoe.plugin :email unless ENV['CI'] or ENV['TRAVIS']
|
10
9
|
Hoe.plugin :gemspec2
|
11
10
|
Hoe.plugin :git
|
12
|
-
|
11
|
+
|
12
|
+
if RUBY_VERSION < '1.9'
|
13
|
+
class Array
|
14
|
+
def to_h
|
15
|
+
Hash[*self.flatten(1)]
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
class Gem::Specification
|
20
|
+
def metadata=(*)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
class Object
|
25
|
+
def caller_locations(*)
|
26
|
+
[]
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
13
30
|
|
14
31
|
_spec = Hoe.spec 'diff-lcs' do
|
15
32
|
developer('Austin Ziegler', 'halostatue@gmail.com')
|
data/lib/diff/lcs.rb
CHANGED
data/lib/diff/lcs/hunk.rb
CHANGED
@@ -20,7 +20,7 @@ class Diff::LCS::Hunk
|
|
20
20
|
before = after = file_length_difference
|
21
21
|
after += @blocks[0].diff_size
|
22
22
|
@file_length_difference = after # The caller must get this manually
|
23
|
-
@max_diff_size = @blocks.
|
23
|
+
@max_diff_size = @blocks.map { |e| e.diff_size }.max
|
24
24
|
|
25
25
|
# Save the start & end of each array. If the array doesn't exist (e.g.,
|
26
26
|
# we're only adding items in this block), then figure out the line
|
data/spec/ldiff_spec.rb
CHANGED
@@ -10,10 +10,10 @@ RSpec.describe 'bin/ldiff' do
|
|
10
10
|
let(:output_diff_e) { read_fixture('-e') }
|
11
11
|
let(:output_diff_f) { read_fixture('-f') }
|
12
12
|
let(:output_diff_u) { read_fixture('-u') }
|
13
|
-
let(:output_diff_chef) { read_fixture('-u', base
|
13
|
+
let(:output_diff_chef) { read_fixture('-u', :base => 'output.diff.chef') }
|
14
14
|
|
15
15
|
specify do
|
16
|
-
expect(run_ldiff('-u', left
|
16
|
+
expect(run_ldiff('-u', :left => 'old-chef', :right => 'new-chef')).to eq(output_diff_chef)
|
17
17
|
end
|
18
18
|
|
19
19
|
specify do
|
@@ -36,8 +36,11 @@ RSpec.describe 'bin/ldiff' do
|
|
36
36
|
expect(run_ldiff('-u')).to eq(output_diff_u)
|
37
37
|
end
|
38
38
|
|
39
|
-
def read_fixture(flag = nil,
|
40
|
-
|
39
|
+
def read_fixture(flag = nil, options = {})
|
40
|
+
base = options.fetch(:base, 'output.diff')
|
41
|
+
name = "spec/fixtures/ldiff/#{base}#{flag}"
|
42
|
+
data = IO.__send__(IO.respond_to?(:binread) ? :binread : :read, name)
|
43
|
+
clean_data(data, flag)
|
41
44
|
end
|
42
45
|
|
43
46
|
def clean_data(data, flag)
|
@@ -69,11 +72,14 @@ RSpec.describe 'bin/ldiff' do
|
|
69
72
|
)
|
70
73
|
end
|
71
74
|
|
72
|
-
def run_ldiff(flag = nil,
|
75
|
+
def run_ldiff(flag = nil, options = {})
|
76
|
+
left = options.fetch(:left, 'aX')
|
77
|
+
right = options.fetch(:right, 'bXaX')
|
73
78
|
stdout, stderr = capture_subprocess_io do
|
74
79
|
system("ruby -Ilib bin/ldiff #{flag} spec/fixtures/#{left} spec/fixtures/#{right}")
|
75
80
|
end
|
76
|
-
|
81
|
+
|
82
|
+
expect(stderr).to be_empty if RUBY_VERSION >= '1.9'
|
77
83
|
expect(stdout).not_to be_empty
|
78
84
|
clean_data(stdout, flag)
|
79
85
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: diff-lcs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Austin Ziegler
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-06-
|
11
|
+
date: 2020-06-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hoe-doofus
|
@@ -139,14 +139,15 @@ description: |-
|
|
139
139
|
McIlroy-Hunt longest common subsequence (LCS) algorithm. It includes utilities
|
140
140
|
to create a simple HTML diff output format and a standard diff-like tool.
|
141
141
|
|
142
|
-
This is release 1.4, providing a simple extension that allows for
|
143
|
-
Diff::LCS::Change objects to be treated implicitly as arrays
|
144
|
-
|
142
|
+
This is release 1.4.3, providing a simple extension that allows for
|
143
|
+
Diff::LCS::Change objects to be treated implicitly as arrays and fixes a
|
144
|
+
number of formatting issues.
|
145
145
|
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
to
|
146
|
+
Ruby versions below 2.5 are soft-deprecated, which means that older versions
|
147
|
+
are no longer part of the CI test suite. If any changes have been introduced
|
148
|
+
that break those versions, bug reports and patches will be accepted, but it
|
149
|
+
will be up to the reporter to verify any fixes prior to release. The next
|
150
|
+
major release will completely break compatibility.
|
150
151
|
email:
|
151
152
|
- halostatue@gmail.com
|
152
153
|
executables:
|