diff-lcs 1.5.1 → 1.6.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 +491 -0
- data/CODE_OF_CONDUCT.md +128 -0
- data/CONTRIBUTING.md +74 -0
- data/CONTRIBUTORS.md +48 -0
- data/Contributing.md +45 -92
- data/Manifest.txt +7 -4
- data/README.md +92 -0
- data/Rakefile +12 -44
- data/SECURITY.md +41 -0
- data/docs/artistic.txt +1 -1
- data/lib/diff/lcs/change.rb +1 -1
- data/lib/diff/lcs/htmldiff.rb +2 -0
- data/lib/diff/lcs/hunk.rb +38 -22
- data/lib/diff/lcs/ldiff.rb +60 -50
- data/lib/diff/lcs.rb +10 -9
- data/spec/hunk_spec.rb +1 -1
- data/spec/issues_spec.rb +32 -32
- data/spec/ldiff_spec.rb +21 -10
- data/spec/patch_spec.rb +1 -1
- metadata +41 -23
- data/Code-of-Conduct.md +0 -74
- data/History.md +0 -431
- data/README.rdoc +0 -84
- /data/{License.md → LICENCE.md} +0 -0
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributing
|
2
|
+
|
3
|
+
Contribution to diff-lcs is encouraged in any form: a bug report, a feature
|
4
|
+
request, or code contributions. There are a few DOs and DON'Ts for
|
5
|
+
|
6
|
+
- DO:
|
7
|
+
|
8
|
+
- Keep the coding style that already exists for any updated Ruby code (support
|
9
|
+
or otherwise). I use [Standard Ruby][standardrb] for linting and formatting.
|
10
|
+
|
11
|
+
- Use thoughtfully-named topic branches for contributions. Rebase your commits
|
12
|
+
into logical chunks as necessary.
|
13
|
+
|
14
|
+
- Use [quality commit messages][qcm].
|
15
|
+
|
16
|
+
- Add your name or GitHub handle to `CONTRIBUTORS.md` and a record in the
|
17
|
+
`CHANGELOG.md` as a separate commit from your main change. (Follow the style
|
18
|
+
in the `CHANGELOG.md` and provide a link to your PR.)
|
19
|
+
|
20
|
+
- Add or update tests, written in [RSpec][rspec], as appropriate.
|
21
|
+
|
22
|
+
- Add or update documentation, as appropriate.
|
23
|
+
|
24
|
+
- DO NOT:
|
25
|
+
|
26
|
+
- Modify `VERSION` in `lib/diff/lcs.rb`. When your patch is accepted and a
|
27
|
+
release is made, the version will be updated at that point.
|
28
|
+
|
29
|
+
- Modify `diff-lcs.gemspect`; it is a generated file. (You _may_ use
|
30
|
+
`rake gemspec` to regenerate it if your change involves metadata related to
|
31
|
+
gem itself).
|
32
|
+
|
33
|
+
- Modify the `Gemfile`.
|
34
|
+
|
35
|
+
## Test Dependencies
|
36
|
+
|
37
|
+
diff-lcs uses Ryan Davis's [Hoe][Hoe] to manage the release process, and it adds
|
38
|
+
a number of rake tasks. You will mostly be interested in `rake`, which runs
|
39
|
+
tests in the same way that `rake spec` does.
|
40
|
+
|
41
|
+
To assist with the installation of the development dependencies for diff-lcs, I
|
42
|
+
have provided a Gemfile pointing to the (generated) `diff-lcs.gemspec` file.
|
43
|
+
`minitar.gemspec` file. This will permit you to use `bundle install` to install
|
44
|
+
the dependencies.
|
45
|
+
|
46
|
+
You can run tests with code coverage analysis by running `rake spec:coverage`.
|
47
|
+
|
48
|
+
## Workflow
|
49
|
+
|
50
|
+
Here's the most direct way to get your work merged into the project:
|
51
|
+
|
52
|
+
- Fork the project.
|
53
|
+
- Clone your fork (`git clone git://github.com/<username>/diff-lcs.git`).
|
54
|
+
- Create a topic branch to contain your change
|
55
|
+
(`git checkout -b my_awesome_feature`).
|
56
|
+
- Hack away, add tests. Not necessarily in that order.
|
57
|
+
- Make sure everything still passes by running `rake`.
|
58
|
+
- If necessary, rebase your commits into logical chunks, without errors.
|
59
|
+
- Push the branch up (`git push origin my_awesome_feature`).
|
60
|
+
- Create a pull request against halostatue/diff-lcs and describe what your
|
61
|
+
change does and the why you think it should be merged.
|
62
|
+
|
63
|
+
### Help Wanted
|
64
|
+
|
65
|
+
I want to automated the releases. I am **not** switching from Hoe for release
|
66
|
+
management, so the use of [rubygems/release-gem][release-gem] requires some care
|
67
|
+
(perhaps by exporting `VERSION=$(rake version)` to the job), but assistance in
|
68
|
+
getting this action going for an automated release would be greatly appreciated.
|
69
|
+
|
70
|
+
[hoe]: https://github.com/seattlerb/hoe
|
71
|
+
[qcm]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
|
72
|
+
[release-gem]: https://github.com/rubygems/release-gem
|
73
|
+
[rspec]: http://rspec.info/documentation/
|
74
|
+
[standardrb]: https://github.com/standardrb/standard
|
data/CONTRIBUTORS.md
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
# Contributors
|
2
|
+
|
3
|
+
- Austin Ziegler (@halostatue) created diff-lcs.
|
4
|
+
|
5
|
+
Thanks to everyone else who has contributed to diff-lcs over the years:
|
6
|
+
|
7
|
+
- @ginriki
|
8
|
+
- @joshbronson
|
9
|
+
- @kevinmook
|
10
|
+
- @mckaz
|
11
|
+
- Akinori Musha
|
12
|
+
- Artem Ignatyev
|
13
|
+
- Brandon Fish
|
14
|
+
- Baptiste Courtois (@annih)
|
15
|
+
- Camille Drapier
|
16
|
+
- Cédric Boutillier
|
17
|
+
- Gregg Kellogg
|
18
|
+
- Jagdeep Singh
|
19
|
+
- Jason Gladish
|
20
|
+
- Jon Rowe
|
21
|
+
- Josef Strzibny
|
22
|
+
- Josep (@apuratepp)
|
23
|
+
- Josh Bronson
|
24
|
+
- Jun Aruga
|
25
|
+
- Justin Steele
|
26
|
+
- Kenichi Kamiya
|
27
|
+
- Kensuke Nagae
|
28
|
+
- Kevin Ansfield
|
29
|
+
- Koichi Ito
|
30
|
+
- Mark Friedgan
|
31
|
+
- Masato Nakamura
|
32
|
+
- Mark Young
|
33
|
+
- Michael Granger
|
34
|
+
- Myron Marston
|
35
|
+
- Nicolas Leger
|
36
|
+
- Oleg Orlov
|
37
|
+
- Patrick Linnane
|
38
|
+
- Paul Kunysch
|
39
|
+
- Pete Higgins
|
40
|
+
- Peter Goldstein
|
41
|
+
- Peter Wagenet
|
42
|
+
- Philippe Lafoucrière
|
43
|
+
- Ryan Lovelett
|
44
|
+
- Scott Steele
|
45
|
+
- Simon Courtois
|
46
|
+
- Tien (@tiendo1011)
|
47
|
+
- Tomas Jura
|
48
|
+
- Vít Ondruch
|
data/Contributing.md
CHANGED
@@ -1,69 +1,58 @@
|
|
1
|
-
|
1
|
+
# Contributing
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
especially <del>welcome</del>encouraged. Because Diff::LCS is a complex
|
6
|
-
codebase, there are a few guidelines:
|
3
|
+
Contribution to diff-lcs is encouraged in any form: a bug report, a feature
|
4
|
+
request, or code contributions. There are a few DOs and DON'Ts for
|
7
5
|
|
8
|
-
-
|
9
|
-
written with [RSpec][].
|
10
|
-
- Match my coding style.
|
11
|
-
- Use a thoughtfully-named topic branch that contains your change. Rebase
|
12
|
-
your commits into logical chunks as necessary.
|
13
|
-
- Use [quality commit messages][].
|
14
|
-
- Do not change the version number; when your patch is accepted and a release
|
15
|
-
is made, the version will be updated at that point.
|
16
|
-
- Submit a GitHub pull request with your changes.
|
17
|
-
- New or changed behaviours require appropriate documentation.
|
6
|
+
- DO:
|
18
7
|
|
19
|
-
|
8
|
+
- Keep the coding style that already exists for any updated Ruby code (support
|
9
|
+
or otherwise). I use [Standard Ruby][standardrb] for linting and formatting.
|
20
10
|
|
21
|
-
|
22
|
-
|
11
|
+
- Use thoughtfully-named topic branches for contributions. Rebase your commits
|
12
|
+
into logical chunks as necessary.
|
23
13
|
|
24
|
-
|
25
|
-
$ rake
|
26
|
-
```
|
14
|
+
- Use [quality commit messages][qcm].
|
27
15
|
|
28
|
-
|
16
|
+
- Add your name or GitHub handle to `CONTRIBUTORS.md` and a record in the
|
17
|
+
`CHANGELOG.md` as a separate commit from your main change. (Follow the style
|
18
|
+
in the `CHANGELOG.md` and provide a link to your PR.)
|
29
19
|
|
30
|
-
|
31
|
-
$ rake spec
|
32
|
-
```
|
20
|
+
- Add or update tests, written in [RSpec][rspec], as appropriate.
|
33
21
|
|
34
|
-
|
22
|
+
- Add or update documentation, as appropriate.
|
35
23
|
|
36
|
-
|
37
|
-
provided a Gemfile pointing to the (generated) `diff-lcs.gemspec` file. This
|
38
|
-
will permit you to do:
|
24
|
+
- DO NOT:
|
39
25
|
|
40
|
-
|
41
|
-
|
42
|
-
```
|
26
|
+
- Modify `VERSION` in `lib/diff/lcs.rb`. When your patch is accepted and a
|
27
|
+
release is made, the version will be updated at that point.
|
43
28
|
|
44
|
-
|
45
|
-
|
29
|
+
- Modify `diff-lcs.gemspect`; it is a generated file. (You _may_ use
|
30
|
+
`rake gemspec` to regenerate it if your change involves metadata related to
|
31
|
+
gem itself).
|
46
32
|
|
47
|
-
|
48
|
-
$ rake newb
|
49
|
-
```
|
33
|
+
- Modify the `Gemfile`.
|
50
34
|
|
51
|
-
|
52
|
-
generate the RDoc.
|
35
|
+
## Test Dependencies
|
53
36
|
|
54
|
-
|
37
|
+
diff-lcs uses Ryan Davis's [Hoe][Hoe] to manage the release process, and it adds
|
38
|
+
a number of rake tasks. You will mostly be interested in `rake`, which runs
|
39
|
+
tests in the same way that `rake spec` does.
|
55
40
|
|
56
|
-
|
57
|
-
|
58
|
-
|
41
|
+
To assist with the installation of the development dependencies for diff-lcs, I
|
42
|
+
have provided a Gemfile pointing to the (generated) `diff-lcs.gemspec` file.
|
43
|
+
`minitar.gemspec` file. This will permit you to use `bundle install` to install
|
44
|
+
the dependencies.
|
59
45
|
|
60
|
-
|
46
|
+
You can run tests with code coverage analysis by running `rake spec:coverage`.
|
47
|
+
|
48
|
+
## Workflow
|
61
49
|
|
62
50
|
Here's the most direct way to get your work merged into the project:
|
63
51
|
|
64
52
|
- Fork the project.
|
65
|
-
- Clone
|
66
|
-
- Create a topic branch to contain your change
|
53
|
+
- Clone your fork (`git clone git://github.com/<username>/diff-lcs.git`).
|
54
|
+
- Create a topic branch to contain your change
|
55
|
+
(`git checkout -b my_awesome_feature`).
|
67
56
|
- Hack away, add tests. Not necessarily in that order.
|
68
57
|
- Make sure everything still passes by running `rake`.
|
69
58
|
- If necessary, rebase your commits into logical chunks, without errors.
|
@@ -71,51 +60,15 @@ Here's the most direct way to get your work merged into the project:
|
|
71
60
|
- Create a pull request against halostatue/diff-lcs and describe what your
|
72
61
|
change does and the why you think it should be merged.
|
73
62
|
|
74
|
-
###
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
- @ginriki
|
81
|
-
- @joshbronson
|
82
|
-
- @kevinmook
|
83
|
-
- @mckaz
|
84
|
-
- Akinori Musha
|
85
|
-
- Artem Ignatyev
|
86
|
-
- Brandon Fish
|
87
|
-
- Camille Drapier
|
88
|
-
- Cédric Boutillier
|
89
|
-
- Gregg Kellogg
|
90
|
-
- Jagdeep Singh
|
91
|
-
- Jason Gladish
|
92
|
-
- Jon Rowe
|
93
|
-
- Josef Strzibny
|
94
|
-
- Josep (@apuratepp)
|
95
|
-
- Josh Bronson
|
96
|
-
- Jun Aruga
|
97
|
-
- Justin Steele
|
98
|
-
- Kenichi Kamiya
|
99
|
-
- Kensuke Nagae
|
100
|
-
- Kevin Ansfield
|
101
|
-
- Koichi Ito
|
102
|
-
- Mark Friedgan
|
103
|
-
- Michael Granger
|
104
|
-
- Myron Marston
|
105
|
-
- Nicolas Leger
|
106
|
-
- Oleg Orlov
|
107
|
-
- Paul Kunysch
|
108
|
-
- Pete Higgins
|
109
|
-
- Peter Goldstein
|
110
|
-
- Peter Wagenet
|
111
|
-
- Philippe Lafoucrière
|
112
|
-
- Ryan Lovelett
|
113
|
-
- Scott Steele
|
114
|
-
- Simon Courtois
|
115
|
-
- Tien (@tiendo1011)
|
116
|
-
- Tomas Jura
|
117
|
-
- Vít Ondruch
|
63
|
+
### Help Wanted
|
64
|
+
|
65
|
+
I want to automated the releases. I am **not** switching from Hoe for release
|
66
|
+
management, so the use of [rubygems/release-gem][release-gem] requires some care
|
67
|
+
(perhaps by exporting `VERSION=$(rake version)` to the job), but assistance in
|
68
|
+
getting this action going for an automated release would be greatly appreciated.
|
118
69
|
|
119
|
-
[rspec]: http://rspec.info/documentation/
|
120
|
-
[quality commit messages]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
|
121
70
|
[hoe]: https://github.com/seattlerb/hoe
|
71
|
+
[qcm]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
|
72
|
+
[release-gem]: https://github.com/rubygems/release-gem
|
73
|
+
[rspec]: http://rspec.info/documentation/
|
74
|
+
[standardrb]: https://github.com/standardrb/standard
|
data/Manifest.txt
CHANGED
@@ -1,11 +1,14 @@
|
|
1
1
|
.rspec
|
2
|
-
|
2
|
+
CHANGELOG.md
|
3
|
+
CODE_OF_CONDUCT.md
|
4
|
+
CONTRIBUTING.md
|
5
|
+
CONTRIBUTORS.md
|
3
6
|
Contributing.md
|
4
|
-
|
5
|
-
License.md
|
7
|
+
LICENCE.md
|
6
8
|
Manifest.txt
|
7
|
-
README.
|
9
|
+
README.md
|
8
10
|
Rakefile
|
11
|
+
SECURITY.md
|
9
12
|
bin/htmldiff
|
10
13
|
bin/ldiff
|
11
14
|
docs/COPYING.txt
|
data/README.md
ADDED
@@ -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/
|
data/Rakefile
CHANGED
@@ -1,49 +1,14 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
1
|
require "rubygems"
|
4
2
|
require "rspec"
|
5
3
|
require "rspec/core/rake_task"
|
6
4
|
require "hoe"
|
5
|
+
require "rake/clean"
|
7
6
|
|
8
|
-
|
9
|
-
class Hoe
|
10
|
-
def with_config
|
11
|
-
config = Hoe::DEFAULT_CONFIG
|
12
|
-
|
13
|
-
rc = File.expand_path("~/.hoerc")
|
14
|
-
homeconfig = load_config(rc)
|
15
|
-
config = config.merge(homeconfig)
|
16
|
-
|
17
|
-
localconfig = load_config(File.expand_path(File.join(Dir.pwd, ".hoerc")))
|
18
|
-
config = config.merge(localconfig)
|
19
|
-
|
20
|
-
yield config, rc
|
21
|
-
end
|
22
|
-
|
23
|
-
def load_config(name)
|
24
|
-
File.exist?(name) ? safe_load_yaml(name) : {}
|
25
|
-
end
|
26
|
-
|
27
|
-
def safe_load_yaml(name)
|
28
|
-
return safe_load_yaml_file(name) if YAML.respond_to?(:safe_load_file)
|
29
|
-
|
30
|
-
data = IO.binread(name)
|
31
|
-
YAML.safe_load(data, permitted_classes: [Regexp])
|
32
|
-
rescue
|
33
|
-
YAML.safe_load(data, [Regexp])
|
34
|
-
end
|
35
|
-
|
36
|
-
def safe_load_yaml_file(name)
|
37
|
-
YAML.safe_load_file(name, permitted_classes: [Regexp])
|
38
|
-
rescue
|
39
|
-
YAML.safe_load_file(name, [Regexp])
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
Hoe.plugin :bundler
|
7
|
+
Hoe.plugin :cov
|
44
8
|
Hoe.plugin :doofus
|
45
9
|
Hoe.plugin :gemspec2
|
46
|
-
Hoe.plugin :
|
10
|
+
Hoe.plugin :git2
|
11
|
+
Hoe.plugin :rubygems
|
47
12
|
|
48
13
|
if RUBY_VERSION < "1.9"
|
49
14
|
class Array # :nodoc:
|
@@ -70,13 +35,16 @@ end
|
|
70
35
|
_spec = Hoe.spec "diff-lcs" do
|
71
36
|
developer("Austin Ziegler", "halostatue@gmail.com")
|
72
37
|
|
73
|
-
|
38
|
+
self.history_file = "CHANGELOG.md"
|
39
|
+
self.readme_file = "README.md"
|
40
|
+
self.licenses = ["MIT", "Artistic-1.0-Perl", "GPL-2.0-or-later"]
|
74
41
|
|
75
|
-
|
76
|
-
self.readme_file = "README.rdoc"
|
77
|
-
self.licenses = ["MIT", "Artistic-2.0", "GPL-2.0-or-later"]
|
42
|
+
require_ruby_version ">= 1.8"
|
78
43
|
|
79
|
-
spec_extras[:metadata] = ->(val) {
|
44
|
+
spec_extras[:metadata] = ->(val) {
|
45
|
+
val["rubygems_mfa_required"] = "true"
|
46
|
+
val["changelog_uri"] = "https://github.com/halostatue/diff-lcs/blob/main/CHANGELOG.md"
|
47
|
+
}
|
80
48
|
|
81
49
|
extra_dev_deps << ["hoe", ">= 3.0", "< 5"]
|
82
50
|
extra_dev_deps << ["hoe-doofus", "~> 1.0"]
|
data/SECURITY.md
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
# diff-lcs Security
|
2
|
+
|
3
|
+
## Supported Versions
|
4
|
+
|
5
|
+
Security reports are accepted for the most recent major release and the previous
|
6
|
+
version for a limited time after the initial major release version. After a
|
7
|
+
major release, the previous version will receive full support for six months and
|
8
|
+
security support for an additional six months (for a total of twelve months).
|
9
|
+
|
10
|
+
Because diff-lcs 1.x supports a wide range of Ruby versions, security reports
|
11
|
+
will only be accepted when they can be demonstrated on Ruby 3.1 or higher.
|
12
|
+
|
13
|
+
> [!information]
|
14
|
+
>
|
15
|
+
> There will be a diff-lcs 2.0 released in 2025 which narrows support to modern
|
16
|
+
> versions of Ruby only.
|
17
|
+
>
|
18
|
+
> | Release Date | Support Ends | Security Support Ends |
|
19
|
+
> | ------------ | ------------ | --------------------- |
|
20
|
+
> | 2025 | +6 months | +12 months |
|
21
|
+
>
|
22
|
+
> If the 2.0.0 release happens on 2025-07-01, regular support for diff-lcs 1.x
|
23
|
+
> will end on 2026-12-31 and security support for diff-lcs 1.x will end on
|
24
|
+
> 2026-06-30.
|
25
|
+
|
26
|
+
## Reporting a Vulnerability
|
27
|
+
|
28
|
+
By preference, use the [Tidelift security contact][tidelift]. Tidelift will
|
29
|
+
coordinate the fix and disclosure.
|
30
|
+
|
31
|
+
Alternatively, Send an email to [diff-lcs@halostatue.ca][email] with the text
|
32
|
+
`Diff::LCS` in the subject. Emails sent to this address should be encrypted
|
33
|
+
using [age][age] with the following public key:
|
34
|
+
|
35
|
+
```
|
36
|
+
age1fc6ngxmn02m62fej5cl30lrvwmxn4k3q2atqu53aatekmnqfwumqj4g93w
|
37
|
+
```
|
38
|
+
|
39
|
+
[tidelift]: https://tidelift.com/security
|
40
|
+
[email]: mailto:diff-lcs@halostatue.ca
|
41
|
+
[age]: https://github.com/FiloSottile/age
|
data/docs/artistic.txt
CHANGED
@@ -122,6 +122,6 @@ products derived from this software without specific prior written permission.
|
|
122
122
|
|
123
123
|
10. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
|
124
124
|
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
125
|
-
WARRANTIES OF
|
125
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
126
126
|
|
127
127
|
The End
|
data/lib/diff/lcs/change.rb
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
# addition of an element from either the old or the new sequenced
|
5
5
|
# enumerable.
|
6
6
|
class Diff::LCS::Change
|
7
|
-
IntClass = 1.class # Fixnum is deprecated in Ruby 2.4 #
|
7
|
+
IntClass = 1.class # Fixnum is deprecated in Ruby 2.4 # standard:disable Naming/ConstantName
|
8
8
|
|
9
9
|
# The only actions valid for changes are '+' (add), '-' (delete), '='
|
10
10
|
# (no change), '!' (changed), '<' (tail changes from first sequence), or
|
data/lib/diff/lcs/htmldiff.rb
CHANGED
@@ -5,7 +5,9 @@ require "cgi"
|
|
5
5
|
# Produce a simple HTML diff view.
|
6
6
|
class Diff::LCS::HTMLDiff
|
7
7
|
class << self
|
8
|
+
# standard:disable ThreadSafety/ClassAndModuleAttributes
|
8
9
|
attr_accessor :can_expand_tabs # :nodoc:
|
10
|
+
# standard:enable ThreadSafety/ClassAndModuleAttributes
|
9
11
|
end
|
10
12
|
self.can_expand_tabs = true
|
11
13
|
|