diff --git a/.autotest b/.autotest
deleted file mode 100644
index 0857ef3..0000000
--- a/.autotest
+++ /dev/null
@@ -1,5 +0,0 @@
-# frozen_string_literal: true
-
-require 'rubygems'
-
-# vim: ft=ruby
diff --git a/.gemtest b/.gemtest
deleted file mode 100644
index e69de29..0000000
diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml
index d1b7e69..a0c84f1 100644
--- a/.github/FUNDING.yml
+++ b/.github/FUNDING.yml
@@ -1,5 +1,3 @@
-# These are supported funding model platforms
-
github: halostatue
buy_me_a_coffee: halostatue
ko_fi: halostatue
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index c547a8f..93b3c87 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -11,10 +11,15 @@ jobs:
name: Lint
runs-on: ubuntu-latest
+ permissions:
+ contents: read
+
steps:
- - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+ with:
+ persist-credentials: false
- - uses: ruby/setup-ruby@v1
+ - uses: ruby/setup-ruby@4a9ddd6f338a97768b8006bf671dfbad383215f4 # v1.207.0
with:
ruby-version: '3.3'
rubygems: latest
@@ -26,6 +31,9 @@ jobs:
required-ubuntu:
name: Ruby ${{ matrix.ruby }} - ${{ matrix.os }}
+ permissions:
+ contents: read
+
strategy:
fail-fast: false
matrix:
@@ -39,22 +47,16 @@ jobs:
- '3.1'
- '3.2'
- '3.3'
- - jruby
- truffleruby
- include:
- - ruby: jruby
- os: ubuntu-22.04
- continue-on-error: true
- - ruby: truffleruby
- os: ubuntu-22.04
- continue-on-error: true
runs-on: ${{ matrix.os }}
- continue-on-error: ${{ matrix.continue-on-error || false }}
steps:
- - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- - uses: ruby/setup-ruby@v1
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+ with:
+ persist-credentials: false
+
+ - uses: ruby/setup-ruby@4a9ddd6f338a97768b8006bf671dfbad383215f4 # v1.207.0
with:
ruby-version: ${{ matrix.ruby }}
rubygems: latest
@@ -66,25 +68,32 @@ jobs:
required-macos:
name: Ruby ${{ matrix.ruby }} - ${{ matrix.os }}
+ permissions:
+ contents: read
+
strategy:
fail-fast: false
matrix:
os:
- - macos-12
- macos-13
- macos-14
+ - macos-15
ruby:
- '2.6'
- '2.7'
- '3.1'
- '3.2'
- '3.3'
+ - '3.4'
runs-on: ${{ matrix.os }}
steps:
- - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- - uses: ruby/setup-ruby@v1
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+ with:
+ persist-credentials: false
+
+ - uses: ruby/setup-ruby@4a9ddd6f338a97768b8006bf671dfbad383215f4 # v1.207.0
with:
ruby-version: ${{ matrix.ruby }}
rubygems: latest
@@ -98,6 +107,10 @@ jobs:
# 2022. https://github.com/ruby/setup-ruby/issues/641
required-windows:
name: Ruby ${{ matrix.ruby }} - ${{ matrix.os }}
+
+ permissions:
+ contents: read
+
strategy:
fail-fast: false
matrix:
@@ -121,8 +134,11 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- - uses: ruby/setup-ruby@v1
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+ with:
+ persist-credentials: false
+
+ - uses: ruby/setup-ruby@4a9ddd6f338a97768b8006bf671dfbad383215f4 # v1.207.0
with:
ruby-version: ${{ matrix.ruby }}
rubygems: latest
@@ -134,6 +150,9 @@ jobs:
ruby-head-optional:
name: Ruby ${{ matrix.ruby }} - ${{ matrix.os }} (optional)
+ permissions:
+ contents: read
+
strategy:
fail-fast: false
@@ -149,8 +168,11 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- - uses: ruby/setup-ruby@v1
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+ with:
+ persist-credentials: false
+
+ - uses: ruby/setup-ruby@4a9ddd6f338a97768b8006bf671dfbad383215f4 # v1.207.0
with:
ruby-version: ${{ matrix.ruby }}
rubygems: latest
diff --git a/.github/workflows/reviewdog.yml b/.github/workflows/reviewdog.yml
new file mode 100644
index 0000000..cfb7178
--- /dev/null
+++ b/.github/workflows/reviewdog.yml
@@ -0,0 +1,61 @@
+name: Reviewdog
+
+on:
+ pull_request:
+
+jobs:
+ typos:
+ if: ${{ github.event.action != 'closed' }}
+ name: Typos
+ runs-on: ubuntu-22.04
+
+ permissions:
+ contents: read
+ pull-requests: write
+
+ steps:
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
+ with:
+ persist-credentials: false
+
+ - uses: reviewdog/action-typos@2e6b919585397817d4fc55f0ee1dc771530b1089 #v1.13.0
+
+ actionlint:
+ if: ${{ github.event.action != 'closed' }}
+ name: Actionlint
+ runs-on: ubuntu-22.04
+
+ permissions:
+ contents: read
+ pull-requests: write
+
+ steps:
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
+ with:
+ persist-credentials: false
+
+ - uses: reviewdog/action-actionlint@f3dcc52bc6039e5d736486952379dce3e869e8a2 #v1.63.0
+
+ standardrb:
+ if: ${{ github.event.action != 'closed' }}
+ name: 'Ruby: Standard'
+ runs-on: ubuntu-22.04
+
+ permissions:
+ contents: read
+ pull-requests: write
+
+ steps:
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
+ with:
+ persist-credentials: false
+
+ - uses: ruby/setup-ruby@4a9ddd6f338a97768b8006bf671dfbad383215f4 #v1.207.0
+ with:
+ ruby-version: '3.3'
+ bundler-cache: true
+
+ - uses: kirillplatonov/action-standard@ce7fc0be158421b01e5d9dc20eef1dcabcf18e4b #v1.0.1
+ with:
+ skip_install: true
+ use_bundler: true
diff --git a/.github/workflows/zizmor.yml b/.github/workflows/zizmor.yml
new file mode 100644
index 0000000..daaf475
--- /dev/null
+++ b/.github/workflows/zizmor.yml
@@ -0,0 +1,31 @@
+name: GitHub Actions Security Analysis with zizmor
+
+on:
+ push:
+ branches: ["main"]
+ pull_request:
+
+jobs:
+ zizmor:
+ name: zizmor latest via Cargo
+ runs-on: ubuntu-latest
+ permissions:
+ security-events: write
+ # required for workflows in private repositories
+ contents: read
+ actions: read
+ steps:
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+ with:
+ persist-credentials: false
+
+ - uses: actions-rust-lang/setup-rust-toolchain@11df97af8e8102fd60b60a77dfbf58d40cd843b8 # v1.10.1
+
+ - run: cargo install --locked zizmor
+ - run: zizmor --persona pedantic --format sarif . > results.sarif
+ env:
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ - uses: github/codeql-action/upload-sarif@b6a472f63d85b9c78a3ac5e89422239fc15e9b3c # v3.28.1
+ with:
+ sarif_file: results.sarif
+ category: zizmor
diff --git a/.gitignore b/.gitignore
index a049920..22d99a1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,20 +1,14 @@
-*.pyc
-*.rbc
-*.swp
-*~
-.DS_Store
+*.gem
+.bundle/
+.byebug_history
.rake_tasks~
-.rvmrc
.source_index
Gemfile.lock
-coverage.info
-coverage.vim
coverage/
doc/
html/
pkg/
publish/
research/
-spec/ldap.yml
website/index.html
-.byebug_history
+vendor/
diff --git a/.hoerc b/.hoerc
index 17059ec..b193cf7 100644
--- a/.hoerc
+++ b/.hoerc
@@ -1,50 +1,49 @@
---
exclude: !ruby/regexp '/
- \.(?:
- tmp |
- swp
- )$
- |
- \.(?:
- bundle |
- git |
- github |
- hg |
- idea |
- svn |
- vagrant
+ \.gemspec$
+ | \.tmp$
+ | \.swp$
+ | ^\.(?:
+ DS_Store
+ | autotest
+ | byebug_history
+ | gemtest
+ | gitattributes
+ | gitignore
+ | hoerc
+ | minitest\.rb
+ | simplecov-prelude\.rb
+ | workenv
+ | (?:
+ appveyor
+ | coveralls
+ | fasterer
+ | pullreview
+ | rubocop.*
+ | standard.*
+ | travis
+ | unused
+ )\.yml
+ | (?:
+ typos
+ )\.toml
+ )$
+ | ^\.(?:
+ bundle
+ | github
+ | git
+ | hg
+ | idea
+ | svn
+ | vagrant
)\/
- |
- [gG]emfile(?:\.lock)?
- |
- (?:
- support |
- research
+ | [gG]emfile(?:\.lock)?$
+ | [Aa]ppraisals$
+ | (?i:TAGS)$
+ | Vagrantfile$
+ | ^(?:
+ support
+ | types
+ | vendor
)\/
- |
- \b(?i:TAGS)$
- |
- \.(?:
- appveyor |
- coveralls |
- fasterer |
- pullreview |
- rubocop* |
- travis |
- unused
- )\.yml$
- |
- \.(?:
- DS_Store |
- autotest |
- byebug_history |
- gemtest |
- gitattributes |
- gitignore |
- hoerc |
- minitest.rb |
- simplecov-prelude.rb
- )$
- |
- \.gemspec$
/x'
diff --git a/.standard.yml b/.standard.yml
index 227fe7b..3d335aa 100644
--- a/.standard.yml
+++ b/.standard.yml
@@ -1,6 +1,13 @@
+---
parallel: true
ruby_version: 2.0
+
ignore:
- - 'diff-lcs.gemspec'
- - 'research/**/*'
- - 'pkg/**/*'
+ - '*.gemspec'
+ - research/**/*
+ - pkg/**/*
+ - Rakefile:
+ - Layout/HeredocIndentation
+
+plugins:
+ - standard-thread_safety
diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 0000000..abf9bc0
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,461 @@
+# Changelog
+
+## NEXT / 2025-MM-DD
+
+- Patrick Linnane fixed various minor typos. [#93][pull-93]
+
+- Mark Young added a Changelog link to the RubyGems metadata. [#92][pull-92]
+ This has been modified to incorporate it into the README.
+
+- Governance:
+
+ Changes described here are effective 2024-12-31.
+
+ - Update gem management details to use markdown files for everything, enabled
+ in part by [flavorjones/hoe-markdown][hoe-markdown]. Several files were
+ renamed to be more consistent with standard practices.
+
+ - Updated security notes with an [age][age] public key rather than pointing to
+ Keybase.io and a PGP public key which I no longer use. The use of the
+ [Tidelift security contact][tidelift] is recommended over direct disclosure.
+
+## 1.5.1 / 2024-01-31
+
+- Peter Goldstein updated CI configuration to add Ruby 3.1 and Masato Nakamura
+ added Ruby 3.2 and 3.3. [#82][pull-82], [#89][pull-89]
+
+- Switched to [standard ruby][standard ruby] formatting.
+
+- Justin Steele converted the licence file to Markdown. [#84][pull-84]
+
+- Updated the gem SPDX identifier for GPL 2.0 or later, resolving [#86][pull-86]
+ by Vit Ondruch.
+
+- Resolve a potential security issue with `ldiff` in its use of `IO.read`
+ instead of `File.read`. [#91][issue-91]
+
+- Added MFA authentication requirement for release to RubyGems. [#90][pull-90]
+
+- Added Dependabot management for actions and gems. [#90][pull-90]
+
+- Updated CodeQL configuration. [#90][pull-90]
+
+## 1.5.0 / 2021-12-23
+
+- Updated the CI configuration and monkey-patch Hoe.
+
+- Kenichi Kamiya fixed a test configuration deprecation in SimpleCov.
+ [#69][pull-69]
+
+- Tien introduced several corrections and code improvements:
+
+ - Removed an off-by-one error when calculating an index value by embracing
+ Ruby iteration properly. This had a side-effect of fixing a long-standing
+ bug in `#traverse_sequences` where the traversal would not be transitive.
+ That is, `LCS(s2, s1)` should produce a sequence that is transitive with
+ `LCS(s1, s2)` on traversal, and applying the diff computed from those
+ results would result in equivalent changes that could be played forward or
+ backward as appropriate. [#71][pull-], [#75][pull-75]
+
+ - The above fix resulted in a changed order of the longest common subsequence
+ when callbacks were applied. After analysis, it was determined that the
+ computed subsequence was _equivalent_ to the prior version, so the test was
+ updated. This also resulted in the clarification of documentation when
+ traversing the sub-sequences. [#79][pull-79]
+
+ - An infinite loop case in the case where `Diff::LCS` would be included into
+ an enumerable class has been fixed. [#73][pull-73]
+
+ - Clarified the purpose of a threshold test in calculation of LCS.
+ [#72][pull-72], [#80][pull-80]
+
+- Removed autotest directory
+
+## 1.4.4 / 2020-07-01
+
+- Fixed an issue reported by Jun Aruga in the `Diff::LCS::Ldiff` binary text
+ detection. [#44][issue-44]
+
+- Fixed a theoretical issue reported by Jun Aruga in `Diff::LCS::Hunk` to raise
+ a more useful exception. [#43][issue-43]
+
+- Added documentation that should address custom object issues as reported in
+ [#35][issue-35].
+
+- Fixed more diff errors, in part reported in [#65][issue-65].
+
+ - The use of `Numeric#abs` is incorrect in `Diff::LCS::Block#diff_size`. The
+ diff size _must_ be accurate for correct change placement.
+
+ - When selecting `@max_diff_size` in `Diff::LCS::Hunk`, choose it based on
+ `block.diff_size.abs`.
+
+ - Made a number of changes that will, unfortunately, increase allocations at
+ the cost of being safe with frozen strings.
+
+ - Add some knowledge that when `Diff::LCS::Hunk#diff` is called, that we are
+ processing the _last_ hunk, so some changes will be made to how the output
+ is generated.
+
+ - `old`, `ed`, and `reverse_ed` formats have no differences.
+
+ - `unified` format will report `\ No newline at end of file` given the
+ correct conditions, at most once. Unified range reporting also differs for
+ the last hunk such that the `length` of the range is reduced by one.
+
+ - `context` format will report `\No newline at end of file` given the
+ correct conditions, up to once per "file". Context range reporting also
+ differs for the last hunk such that the `end` part of the range is reduced
+ by one to a minimum of one.
+
+- Added a bunch more tests for the cases above, and fixed `hunk_spec.rb` so that
+ the phrase being compared isn't nonsense French.
+
+- Updated formatting.
+
+- Added a Rake task to assist with manual testing on Ruby 1.8.
+
+## 1.4.3 / 2020-06-29
+
+- Fixed several issues with 1.4 on Rubies older than 2.0. Some of this was
+ providing useful shim functions to Hoe 3.x (which dropped these older Rubies a
+ while ago). Specifically:
+
+ - Removed Array#lazy from a method in `Diff::LCS::Hunk`.
+
+ - Changed some unit tests to use old-style Symbol-keyed hashes.
+
+ - Changed some unit test helper functions to no longer use keyword parameters,
+ but only a trailing options hash.
+
+ - Made the use of `psych` dependent on `RUBY_VERSION >= 1.9`.
+
+ Resolves [#63][issue-63].
+
+## 1.4.2 / 2020-06-23
+
+- Camille Drapier fixed a small issue with RuboCop configuration. [#59][pull-59]
+
+- Applied another fix (and unit test) to fix an issue for the Chef team.
+ [#60][issue-60], [#61][pull-61]
+
+## 1.4.1 / 2020-06-23
+
+- Fix an issue where diff sizes could be negative, and they should be.
+ [#57][issue-57], [#58][pull-58]
+
+## 1.4 / 2020-06-23
+
+- Ruby versions lower than 2.4 are soft-deprecated and will not be run as part
+ of the CI process any longer.
+
+- Akinora MUSHA (knu) added the ability for `Diff::LCS::Change` objects to be
+ implicitly treated arrays. Originally provided as pull request [#47][pull-47],
+ but it introduced a number of test failures as documented in [#48][issue-48],
+ and remediation of `Diff::LCS` itself was introduced in [#49][pull-49].
+
+- Resolved [#5][issue-05] with some tests comparing output from `system` calls
+ to `bin/ldiff` with some pre-generated output. Resolved [#6][issue-06] with
+ these tests.
+
+- Resolved a previously undetected `bin/ldiff` issue with `--context` output not
+ matching `diff --context` output.
+
+- Resolved an issue with later versions of Ruby not working with an `OptParse`
+ specification of `Numeric`; this has been changed to `Integer`.
+
+- Brandon Fish added TruffleRuby in [#52][pull-52].
+
+- Fixed two missing classes as reported in [#53][issue-53].
+
+## 1.3 / 2017-01-18
+
+- Bugs fixed:
+
+ - Fixed an error for `bin/ldiff --version`. Fixes issue [#21][issue-21].
+
+ - Force `Diff::LCS::Change` and `Diff::LCS::ContextChange` to only perform
+ equality comparisons against themselves. Provided by Kevin Mook in pull
+ request [#29][pull-29].
+
+ - Fix tab expansion in `htmldiff`, provided by Mark Friedgan in pull request
+ [#25][pull-25].
+
+ - Silence Ruby 2.4 `Fixnum` deprecation warnings. Fixes issue [#38][issue-38]
+ and pull request [#36][pull-36].
+
+ - Ensure that test dependencies are loaded properly. Fixes issue
+ [#33][issue-33] and pull request [#34][pull-34].
+
+ - Fix issue [#1][issue-01] with incorrect intuition of patch direction.
+ Tentative fix, but the previous failure cases pass now.
+
+- Tooling changes:
+
+ - Added SimpleCov and Coveralls support.
+
+ - Change the homepage (temporarily) to the GitHub repo.
+
+ - Updated testing and gem infrastructure.
+
+ - Modernized the specs.
+
+- Cleaned up documentation.
+
+- Added a Code of Conduct.
+
+## 1.2.5 / 2013-11-08
+
+- Bugs fixed:
+
+ - Comparing arrays flattened them too far, especially with `Diff::LCS.sdiff`.
+ Fixed by Josh Bronson in pull request [#23][pull-23].
+
+## 1.2.4 / 2013-04-20
+
+- Bugs fixed:
+
+ - A bug was introduced after 1.1.3 when pruning common sequences at the start
+ of comparison. Paul Kunysch (@pck) fixed this in pull request
+ [#18][pull-18]. Thanks!
+
+ - The Rubinius (1.9 mode) bug in [rubinius/rubinius#2268][rubinius#2268] has
+ been fixed by the Rubinius team two days after it was filed. Thanks for
+ fixing this so quickly!
+
+- Switching to Raggi's hoe-gemspec2 for gemspec generation.
+
+## 1.2.3 / 2013-04-11
+
+- Bugs Fixed:
+
+ - The new encoding detection for diff output generation (added in 1.2.2)
+ introduced a bug if the left side of the comparison was the empty set.
+ Originally found in [rspec/rspec-expectations#238][rspec-expectations#238]
+ and [rspec/rspec-expectations#239][rspec-expectations#239]. Jon Rowe
+ developed a reasonable heuristic (left side, right side, empty string
+ literal) to avoid this bug.
+
+ - There is a known issue with Rubinius in 1.9 mode reported in
+ [rubinius/rubinius#2268][rubinius#2268] and demonstrated in the Travis CI
+ builds. For all other tested platforms, diff-lcs is considered stable. As
+ soon as a suitably small test-case can be created for the Rubinius team to
+ examine, this will be added to the Rubinius issue around this.
+
+## 1.2.2 / 2013-03-30
+
+- Bugs Fixed:
+
+ - `Diff::LCS::Hunk` could not properly generate a difference for comparison
+ sets that are not US-ASCII-compatible because of the use of literal regular
+ expressions and strings. Jon Rowe found this in
+ [rspec/rspec-expectations#219][rspec-expectations#219] and provided a first
+ pass implementation in pull request [#15][pull-15]. I've reworked it because
+ of test failures in Rubinius when running in Ruby 1.9 mode. This coerces the
+ added values to the encoding of the old dataset (as determined by the first
+ piece of the old dataset).
+
+ - Adding Travis CI testing for Ruby 2.0.
+
+## 1.2.1 / 2013-02-09
+
+- Bugs Fixed:
+
+ - As seen in [rspec/rspec-expectations#200][rspec-expectations#200], the
+ release of `Diff::LCS` 1.2 introduced an unnecessary public API change to
+ `Diff::LCS::Hunk` (see the change at
+ [rspec/rspec-expectations@3d6fc82c][rspec-expectations@3d6fc82c] for
+ details). The new method name (and behaviour) is more correct, but I should
+ not have renamed the function or should have at least provided an alias.
+ This release restores `Diff::LCS::Hunk#unshift` as an alias to #merge. Note
+ that the old `#unshift` behaviour was incorrect and will not be restored.
+
+## 1.2.0 / 2013-01-21
+
+- Minor Enhancements:
+
+ - Added special case handling for `Diff::LCS.patch` so that it handles patches
+ that are empty or contain no changes.
+
+ - Added two new methods (`#patch_me` and `#unpatch_me`) to the include-able
+ module.
+
+- Bugs Fixed:
+
+ - Fixed issue [#1][issue-01] patch direction detection.
+
+ - Resolved issue [#2][issue-02] by handling `string[string.size, 1]` properly
+ (it returns `""` not `nil`).
+
+ - Michael Granger (ged) fixed an implementation error in `Diff::LCS::Change`
+ and added specs in pull request [#8][pull-08]. Thanks!
+
+ - Made the code auto-testable.
+
+ - Vít Ondruch (voxik) provided the latest version of the GPL2 license file in
+ pull request [#10][pull-10]. Thanks!
+
+ - Fixed a documentation issue with the include-able versions of `#patch!` and
+ `#unpatch!` where they implied that they would replace the original value.
+ Given that `Diff::LCS.patch` always returns a copy, the documentation was
+ incorrect and has been corrected. To provide the behaviour that was
+ originally documented, two new methods were added to provide this behaviour.
+ Found by scooter-dangle in issue [#12][issue-12]. Thanks!
+
+- Code Style Changes:
+
+ - Removed trailing spaces.
+
+ - Calling class methods using `.` instead of `::`.
+
+ - Vít Ondruch (voxik) removed unnecessary shebangs in pull request
+ [#9][pull-09]. Thanks!
+
+ - Kenichi Kamiya (kachick) removed some warnings of an unused variable in
+ lucky pull request [#13][pull-13]. Thanks!
+
+ - Embarked on a major refactoring to make the files a little more manageable
+ and understand the code on a deeper level.
+
+ - Adding CI via Travis CI.
+
+## 1.1.3 / 2011-08-27
+
+- Converted to 'hoe' for release.
+
+- Converted tests to RSpec 2.
+
+- Extracted the body of `htmldiff` into a class available from
+ `diff/lcs/htmldiff`.
+
+- Migrated development and issue tracking to GitHub.
+
+- Bugs fixed:
+
+ - Eliminated the explicit use of RubyGems in both `bin/htmldiff` and
+ `bin/ldiff`. Resolves issue [#4][issue-04].
+
+ - Eliminated Ruby warnings. Resolves issue [#3][issue-03].
+
+## 1.1.2 / 2004-10-20
+
+- Fixed a problem reported by Mauricio Fernandez in `htmldiff`.
+
+## 1.1.1 / 2004-09-25
+
+- Fixed bug #891 (Set returned from patch command does not contain last equal
+ part).
+
+- Fixed a problem with callback initialisation code (it assumed that all
+ callbacks passed as classes can be initialised; now, it rescues NoMethodError
+ in the event of private :new being called).
+
+- Modified the non-initialisable callbacks to have a private `#new` method.
+
+- Moved `ldiff` core code to `Diff::LCS::Ldiff` (`diff/lcs/ldiff.rb`).
+
+## 1.1.0
+
+- Eliminated the need for `Diff::LCS::Event` and removed it.
+
+- Added a contextual diff callback, `Diff::LCS::ContextDiffCallback`.
+
+- Implemented (un-)patching for standard diff callback output formats with both
+ `#diff` and `#sdiff`.
+
+- Extensive documentation changes.
+
+## 1.0.4
+
+- Fixed a problem with `bin/ldiff` output, especially for unified format.
+ Newlines that should have been present weren't.
+
+- Changed the `.tar.gz` installer to generate Windows batch files if ones do not
+ exist already. Removed the existing batch files as they didn't work.
+
+## 1.0.3
+
+- Fixed a problem with `#traverse_sequences` where the first difference from the
+ left sequence might not be appropriately captured.
+
+## 1.0.2
+
+- Fixed an issue with `ldiff` not working because actions were changed from
+ symbols to strings.
+
+## 1.0.1
+
+- Minor modifications to the `gemspec`, the `README`.
+
+- Renamed the diff program to `ldiff` (as well as the companion batch file) so
+ as to not collide with the standard diff program.
+
+- Fixed issues with RubyGems. Requires RubyGems > 0.6.1 or >= 0.6.1 with the
+ latest CVS version.
+
+## 1.0
+
+- Initial release based mostly on Perl's Algorithm::Diff.
+
+[age]: https://github.com/FiloSottile/age
+[hoe-halostatue]: https://github.com/halostatue/hoe-halostatue
+[hoe-markdown]: https://github.com/flavorjones/hoe-markdown
+[issue-01]: https://github.com/halostatue/diff-lcs/issues/1
+[issue-02]: https://github.com/halostatue/diff-lcs/issues/2
+[issue-03]: https://github.com/halostatue/diff-lcs/issues/3
+[issue-04]: https://github.com/halostatue/diff-lcs/issues/4
+[issue-05]: https://github.com/halostatue/diff-lcs/issues/5
+[issue-06]: https://github.com/halostatue/diff-lcs/issues/6
+[issue-12]: https://github.com/halostatue/diff-lcs/issues/12
+[issue-21]: https://github.com/halostatue/diff-lcs/issues/21
+[issue-33]: https://github.com/halostatue/diff-lcs/issues/33
+[issue-35]: https://github.com/halostatue/diff-lcs/issues/35
+[issue-38]: https://github.com/halostatue/diff-lcs/issues/38
+[issue-43]: https://github.com/halostatue/diff-lcs/issues/43
+[issue-44]: https://github.com/halostatue/diff-lcs/issues/44
+[issue-48]: https://github.com/halostatue/diff-lcs/issues/48
+[issue-53]: https://github.com/halostatue/diff-lcs/issues/53
+[issue-57]: https://github.com/halostatue/diff-lcs/issues/57
+[issue-60]: https://github.com/halostatue/diff-lcs/issues/60
+[issue-63]: https://github.com/halostatue/diff-lcs/issues/63
+[issue-65]: https://github.com/halostatue/diff-lcs/issues/65
+[issue-91]: https://github.com/halostatue/diff-lcs/issues/91
+[pull-08]: https://github.com/halostatue/diff-lcs/pull/8
+[pull-09]: https://github.com/halostatue/diff-lcs/pull/9
+[pull-10]: https://github.com/halostatue/diff-lcs/pull/10
+[pull-13]: https://github.com/halostatue/diff-lcs/pull/13
+[pull-15]: https://github.com/halostatue/diff-lcs/pull/15
+[pull-18]: https://github.com/halostatue/diff-lcs/pull/18
+[pull-23]: https://github.com/halostatue/diff-lcs/pull/23
+[pull-25]: https://github.com/halostatue/diff-lcs/pull/25
+[pull-29]: https://github.com/halostatue/diff-lcs/pull/29
+[pull-34]: https://github.com/halostatue/diff-lcs/pull/34
+[pull-36]: https://github.com/halostatue/diff-lcs/pull/36
+[pull-47]: https://github.com/halostatue/diff-lcs/pull/47
+[pull-49]: https://github.com/halostatue/diff-lcs/pull/49
+[pull-52]: https://github.com/halostatue/diff-lcs/pull/52
+[pull-58]: https://github.com/halostatue/diff-lcs/pull/58
+[pull-59]: https://github.com/halostatue/diff-lcs/pull/59
+[pull-61]: https://github.com/halostatue/diff-lcs/pull/61
+[pull-69]: https://github.com/halostatue/diff-lcs/pull/69
+[pull-71]: https://github.com/halostatue/diff-lcs/pull/71
+[pull-72]: https://github.com/halostatue/diff-lcs/pull/72
+[pull-73]: https://github.com/halostatue/diff-lcs/pull/73
+[pull-75]: https://github.com/halostatue/diff-lcs/pull/75
+[pull-79]: https://github.com/halostatue/diff-lcs/pull/79
+[pull-80]: https://github.com/halostatue/diff-lcs/pull/80
+[pull-82]: https://github.com/halostatue/diff-lcs/pull/82
+[pull-84]: https://github.com/halostatue/diff-lcs/pull/84
+[pull-86]: https://github.com/halostatue/diff-lcs/pull/86
+[pull-89]: https://github.com/halostatue/diff-lcs/pull/89
+[pull-90]: https://github.com/halostatue/diff-lcs/pull/90
+[pull-92]: https://github.com/halostatue/diff-lcs/pull/92
+[pull-93]: https://github.com/halostatue/diff-lcs/pull/93
+[rspec-expectations#200]: https://github.com/rspec/rspec-expectations/pull/200
+[rspec-expectations#219]: https://github.com/rspec/rspec-expectations/issues/219
+[rspec-expectations#238]: https://github.com/rspec/rspec-expectations/issues/238
+[rspec-expectations#239]: https://github.com/rspec/rspec-expectations/issues/239
+[rspec-expectations@3d6fc82c]: https://github.com/rspec/rspec-expectations/commit/3d6fc82c
+[rubinius#2268]: https://github.com/rubinius/rubinius/issues/2268
+[standard ruby]: https://github.com/standardrb/standard
+[tidelift]: https://tidelift.com/security
diff --git a/Code-of-Conduct.md b/CODE_OF_CONDUCT.md
similarity index 100%
rename from Code-of-Conduct.md
rename to CODE_OF_CONDUCT.md
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md
new file mode 100644
index 0000000..c05081e
--- /dev/null
+++ b/CONTRIBUTORS.md
@@ -0,0 +1,47 @@
+# Contributors
+
+- Austin Ziegler created diff-lcs.
+
+Thanks to everyone else who has contributed to diff-lcs over the years:
+
+- @ginriki
+- @joshbronson
+- @kevinmook
+- @mckaz
+- Akinori Musha
+- Artem Ignatyev
+- Brandon Fish
+- Camille Drapier
+- Cédric Boutillier
+- Gregg Kellogg
+- Jagdeep Singh
+- Jason Gladish
+- Jon Rowe
+- Josef Strzibny
+- Josep (@apuratepp)
+- Josh Bronson
+- Jun Aruga
+- Justin Steele
+- Kenichi Kamiya
+- Kensuke Nagae
+- Kevin Ansfield
+- Koichi Ito
+- Mark Friedgan
+- Masato Nakamura
+- Mark Young
+- Michael Granger
+- Myron Marston
+- Nicolas Leger
+- Oleg Orlov
+- Patrick Linnane
+- Paul Kunysch
+- Pete Higgins
+- Peter Goldstein
+- Peter Wagenet
+- Philippe Lafoucrière
+- Ryan Lovelett
+- Scott Steele
+- Simon Courtois
+- Tien (@tiendo1011)
+- Tomas Jura
+- Vít Ondruch
diff --git a/Contributing.md b/Contributing.md
index 76406c9..f742c3e 100644
--- a/Contributing.md
+++ b/Contributing.md
@@ -1,33 +1,47 @@
# Contributing
-I value any contribution to diff-lcs you can provide: a bug report, a feature
-request, or code contributions.
-
-Code contributions to Diff::LCS are especially welcomeencouraged.
-Because Diff::LCS is a complex codebase, there are a few guidelines:
-
-- Code changes _will_ _not_ be accepted without tests. The test suite is written
- with [RSpec][RSpec].
-- Match my coding style.
-- Use a thoughtfully-named topic branch that contains your change. Rebase your
- commits into logical chunks as necessary.
-- Use [quality commit messages][quality commit messages].
-- Do not change the version number; when your patch is accepted and a release is
- made, the version will be updated at that point.
-- Submit a GitHub pull request with your changes.
-- New or changed behaviours require new or updated documentation.
+Contribution to diff-lcs is encouraged in any form: a bug report, a feature
+request, or code contributions. There are a few DOs and DON'Ts for
+
+- DO:
+
+ - Keep the coding style that already exists for any updated Ruby code (support
+ or otherwise). I use [Standard Ruby][standardrb] for linting and formatting.
+
+ - Use thoughtfully-named topic branches for contributions. Rebase your commits
+ into logical chunks as necessary.
+
+ - Use [quality commit messages][qcm].
+
+ - Add your name or GitHub handle to `CONTRIBUTORS.md` and a record in the
+ `CHANGELOG.md` as a separate commit from your main change. (Follow the style
+ in the `CHANGELOG.md` and provide a link to your PR.)
+
+ - Add or update tests, written in [RSpec][rspec], as appropriate.
+
+ - Add or update documentation, as appropriate.
+
+- DO NOT:
+
+ - Modify `VERSION` in `lib/diff/lcs.rb`. When your patch is accepted and a
+ release is made, the version will be updated at that point.
+
+ - Modify `diff-lcs.gemspect`; it is a generated file. (You _may_ use
+ `rake gemspec` to regenerate it if your change involves metadata related to
+ gem itself).
+
+ - Modify the `Gemfile`.
## Test Dependencies
-diff-lcs uses Ryan Davis’s [Hoe][Hoe] to manage the release process, and it adds
+diff-lcs uses Ryan Davis's [Hoe][Hoe] to manage the release process, and it adds
a number of rake tasks. You will mostly be interested in `rake`, which runs
tests in the same way that `rake spec` does.
To assist with the installation of the development dependencies for diff-lcs, I
-have provided a Gemfile pointing to the (generated) `diff-lcs.gemspec` file. If
-you already have `hoe` installed, you can accomplish the same thing with
-`rake newb`. This task will install any missing dependencies, run the specs, and
-generate the RDoc.
+have provided a Gemfile pointing to the (generated) `diff-lcs.gemspec` file.
+`minitar.gemspec` file. This will permit you to use `bundle install` to install
+the dependencies.
You can run tests with code coverage analysis by running `rake spec:coverage`.
@@ -36,7 +50,7 @@ You can run tests with code coverage analysis by running `rake spec:coverage`.
Here's the most direct way to get your work merged into the project:
- Fork the project.
-- Clone down your fork (`git clone git://github.com//diff-lcs.git`).
+- Clone your fork (`git clone git://github.com//diff-lcs.git`).
- Create a topic branch to contain your change
(`git checkout -b my_awesome_feature`).
- Hack away, add tests. Not necessarily in that order.
@@ -46,54 +60,15 @@ Here's the most direct way to get your work merged into the project:
- Create a pull request against halostatue/diff-lcs and describe what your
change does and the why you think it should be merged.
-## Contributors
-
-- Austin Ziegler created diff-lcs.
-
-Thanks to everyone else who has contributed to diff-lcs over the years:
-
-- @ginriki
-- @joshbronson
-- @kevinmook
-- @mckaz
-- Akinori Musha
-- Artem Ignatyev
-- Brandon Fish
-- Camille Drapier
-- Cédric Boutillier
-- Gregg Kellogg
-- Jagdeep Singh
-- Jason Gladish
-- Jon Rowe
-- Josef Strzibny
-- Josep (@apuratepp)
-- Josh Bronson
-- Jun Aruga
-- Justin Steele
-- Kenichi Kamiya
-- Kensuke Nagae
-- Kevin Ansfield
-- Koichi Ito
-- Mark Friedgan
-- Masato Nakamura
-- Mark Young
-- Michael Granger
-- Myron Marston
-- Nicolas Leger
-- Oleg Orlov
-- Patrick Linnane
-- Paul Kunysch
-- Pete Higgins
-- Peter Goldstein
-- Peter Wagenet
-- Philippe Lafoucrière
-- Ryan Lovelett
-- Scott Steele
-- Simon Courtois
-- Tien (@tiendo1011)
-- Tomas Jura
-- Vít Ondruch
+### Help Wanted
+
+I want to automated the releases. I am **not** switching from Hoe for release
+management, so the use of [rubygems/release-gem][release-gem] requires some care
+(perhaps by exporting `VERSION=$(rake version)` to the job), but assistance in
+getting this action going for an automated release would be greatly appreciated.
-[rspec]: http://rspec.info/documentation/
-[quality commit messages]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
[hoe]: https://github.com/seattlerb/hoe
+[qcm]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
+[release-gem]: https://github.com/rubygems/release-gem
+[rspec]: http://rspec.info/documentation/
+[standardrb]: https://github.com/standardrb/standard
diff --git a/Gemfile b/Gemfile
index 016d5cd..3c5d514 100644
--- a/Gemfile
+++ b/Gemfile
@@ -5,8 +5,9 @@ source "https://rubygems.org/"
gem "debug", platforms: [:mri_31]
-if RUBY_VERSION >= "3.0"
- gem "standardrb"
+if RUBY_VERSION.start_with?("3.")
+ gem "standard"
+ gem "standard-thread_safety"
gem "fasterer"
end
diff --git a/History.md b/History.md
deleted file mode 100644
index 92bfe60..0000000
--- a/History.md
+++ /dev/null
@@ -1,439 +0,0 @@
-# History
-
-## NEXT / YYYY-MM-DD
-
-- Patrick Linnane fixed various minor typos. [#93][]
-
-- Mark Young added a Changelog link to the RubyGems metadata. [#92][]
-
-## 1.5.1 / 2024-01-31
-
-- Peter Goldstein updated CI configuration to add Ruby 3.1 and Masato Nakamura
- added Ruby 3.2 and 3.3. [#82][], [#89][]
-
-- Updated the CI configuration, resolving [#82][] to add Ruby 3.1. Masato
-
-- Switched to [standard ruby][] formatting.
-
-- Justin Steele converted the licence file to Markdown. [#84][]
-
-- Updated the gem SPDX identifier for GPL 2.0 or later, resolving [#86][] by Vit
- Ondruch.
-
-- Resolve a potential security issue with `ldiff` in its use of `IO.read`
- instead of `File.read`. [#91][]
-
-- Added MFA authentication requirement for release to RubyGems. [#90][]
-
-- Added dependabot management for actions and gems. [#90][]
-
-- Updated CodeQL coniguration. [#90][]
-
-## 1.5.0 / 2021-12-23
-
-- Updated the CI configuration and monkey-patch Hoe.
-
-- Kenichi Kamiya fixed a test configuration deprecation in SimpleCov. [#69][]
-
-- Tien introduced several corrections and code improvements:
-
- - Removed an off-by-one error when calculating an index value by embracing
- Ruby iteration properly. This had a side-effect of fixing a long-standing
- bug in `#traverse_sequences` where the traversal would not be transitive.
- That is, `LCS(s2, s1)` should produce a sequence that is transitive with
- `LCS(s1, s2)` on traversal, and applying the diff computed from those
- results would result in equivalent changes that could be played forward or
- backward as appropriate. [#71][], [#75][]
-
- - The above fix resulted in a changed order of the longest common subsequence
- when callbacks were applied. After analysis, it was determined that the
- computed subsequence was _equivalent_ to the prior version, so the test was
- updated. This also resulted in the clarification of documentation when
- traversing the subsequences. [#79][]
-
- - An infinite loop case in the case where Diff::LCS would be included into an
- enumerable class has been fixed. [#73][]
-
- - Clarified the purpose of a threshold test in calculation of LCS. [#72][],
- [#80][]
-
-- Removed autotest directory
-
-## 1.4.4 / 2020-07-01
-
-- Fixed an issue reported by Jun Aruga in the Diff::LCS::Ldiff binary text
- detection. [#44][]
-
-- Fixed a theoretical issue reported by Jun Aruga in Diff::LCS::Hunk to raise
- a more useful exception. [#43][]
-
-- Added documentation that should address custom object issues as reported in
- [#35][].
-
-- Fixed more diff errors, in part reported in [#65][].
-
- - The use of `Numeric#abs` is incorrect in `Diff::LCS::Block#diff_size`. The
- diff size _must_ be accurate for correct change placement.
-
- - When selecting @max_diff_size in Diff::LCS::Hunk, choose it based on
- `block.diff_size.abs`.
-
- - Made a number of changes that will, unfortunately, increase allocations at
- the cost of being safe with frozen strings.
-
- - Add some knowledge that when `Diff::LCS::Hunk#diff` is called, that we are
- processing the _last_ hunk, so some changes will be made to how the output
- is generated.
-
- - `old`, `ed`, and `reverse_ed` formats have no differences.
-
- - `unified` format will report `\ No newline at end of file` given the
- correct conditions, at most once. Unified range reporting also differs for
- the last hunk such that the `length` of the range is reduced by one.
-
- - `context` format will report `\No newline at end of file` given the
- correct conditions, up to once per "file". Context range reporting also
- differs for the last hunk such that the `end` part of the range is reduced
- by one to a minimum of one.
-
-- Added a bunch more tests for the cases above, and fixed `hunk_spec.rb` so that
- the phrase being compared isn't nonsense French.
-
-- Updated formatting.
-
-- Added a Rake task to assist with manual testing on Ruby 1.8.
-
-## 1.4.3 / 2020-06-29
-
-- Fixed several issues with the 1.4 on Rubies older than 2.0. Some of this was
- providing useful shim functions to Hoe 3.x (which dropped these older Rubies
- a while ago). Specifically:
-
- - Removed Array#lazy from a method in Diff::LCS::Hunk.
-
- - Changed some unit tests to use old-style Symbol-keyed hashes.
-
- - Changed some unit test helper functions to no longer use keyword parameters,
- but only a trailing options hash.
-
- - Made the use of `psych` dependent on `RUBY_VERSION >= 1.9`.
-
- Resolves [#63][].
-
-## 1.4.2 / 2020-06-23
-
-- Camille Drapier fixed a small issue with RuboCop configuration. [#59][]
-
-- Applied another fix (and unit test) to fix an issue for the Chef team.
- [#60][], [#61][]
-
-## 1.4.1 / 2020-06-23
-
-- Fix an issue where diff sizes could be negative, and they should be. [#57][],
- [#58][]
-
-## 1.4 / 2020-06-23
-
-- Ruby versions lower than 2.4 are soft-deprecated and will not be run as part
- of the CI process any longer.
-
-- Akinora MUSHA (knu) added the ability for Diff::LCS::Change objects to be
- implicitly treated arrays. Originally provided as pull request [#47][], but it
- introduced a number of test failures as documented in [#48][], and remediation
- of Diff::LCS itself was introduced in [#49][].
-
-- Resolved [#5][] with some tests comparing output from `system` calls to
- `bin/ldiff` with some pre-generated output. Resolved [#6][] with these tests.
-
-- Resolved a previously undetected `bin/ldiff` issue with `--context` output not
- matching `diff --context` output.
-
-- Resolved an issue with later versions of Ruby not working with an `OptParse`
- specification of `Numeric`; this has been changed to `Integer`.
-
-- Brandon Fish added truffleruby in [#52][].
-
-- Fixed two missing classes as reported in [#53][].
-
-## 1.3 / 2017-01-18
-
-- Bugs fixed:
-
- - Fixed an error for bin/ldiff --version. Fixes issue [#21][].
-
- - Force Diff::LCS::Change and Diff::LCS::ContextChange to only perform
- equality comparisons against themselves. Provided by Kevin Mook in pull
- request [#29][].
-
- - Fix tab expansion in htmldiff, provided by Mark Friedgan in pull request
- [#25][].
-
- - Silence Ruby 2.4 Fixnum deprecation warnings. Fixes issue [#38][] and pull
- request [#36][].
-
- - Ensure that test dependencies are loaded properly. Fixes issue [#33][] and
- pull request [#34][].
-
- - Fix issue [#1][] with incorrect intuition of patch direction. Tentative fix,
- but the previous failure cases pass now.
-
-- Tooling changes:
-
- - Added SimpleCov and Coveralls support.
-
- - Change the homepage (temporarily) to the GitHub repo.
-
- - Updated testing and gem infrastructure.
-
- - Modernized the specs.
-
-- Cleaned up documentation.
-
-- Added a Code of Conduct.
-
-## 1.2.5 / 2013-11-08
-
-- Bugs fixed:
-
- - Comparing arrays flattened them too far, especially with Diff::LCS.sdiff.
- Fixed by Josh Bronson in pull request [#23][].
-
-## 1.2.4 / 2013-04-20
-
-- Bugs fixed:
-
- - A bug was introduced after 1.1.3 when pruning common sequences at the start
- of comparison. Paul Kunysch (@pck) fixed this in pull request [#18][].
- Thanks!
-
- - The Rubinius (1.9 mode) bug in [rubinius/rubinius#2268][] has been fixed by
- the Rubinius team two days after it was filed. Thanks for fixing this so
- quickly!
-
-- Switching to Raggi's hoe-gemspec2 for gemspec generation.
-
-## 1.2.3 / 2013-04-11
-
-- Bugs Fixed:
-
- - The new encoding detection for diff output generation (added in 1.2.2)
- introduced a bug if the left side of the comparison was the empty set.
- Originally found in [rspec/rspec-expectations#238][] and
- [rspec/rspec-expectations#239][]. Jon Rowe developed a reasonable heuristic
- (left side, right side, empty string literal) to avoid this bug.
-
- - There is a known issue with Rubinius in 1.9 mode reported in
- [rubinius/rubinius#2268][] and demonstrated in the Travis CI builds. For all
- other tested platforms, diff-lcs is considered stable. As soon as a suitably
- small test-case can be created for the Rubinius team to examine, this will
- be added to the Rubinius issue around this.
-
-## 1.2.2 / 2013-03-30
-
-- Bugs Fixed:
-
- - Diff::LCS::Hunk could not properly generate a difference for comparison sets
- that are not US-ASCII-compatible because of the use of literal regular
- expressions and strings. Jon Rowe found this in
- [rspec/rspec-expectations#219][] and provided a first pass implementation in
- pull request [#15][]. I've reworked it because of test failures in Rubinius
- when running in Ruby 1.9 mode. This coerces the added values to the encoding
- of the old dataset (as determined by the first piece of the old dataset).
-
- - Adding Travis CI testing for Ruby 2.0.
-
-## 1.2.1 / 2013-02-09
-
-- Bugs Fixed:
-
- - As seen in [rspec/rspec-expectations#200][], the release of Diff::LCS 1.2
- introduced an unnecessary public API change to Diff::LCS::Hunk (see the
- change at [rspec/rspec-expectations@3d6fc82c][] for details). The new method
- name (and behaviour) is more correct, but I should not have renamed the
- function or should have at least provided an alias. This release restores
- Diff::LCS::Hunk#unshift as an alias to #merge. Note that the old #unshift
- behaviour was incorrect and will not be restored.
-
-## 1.2.0 / 2013-01-21
-
-- Minor Enhancements:
-
- - Added special case handling for Diff::LCS.patch so that it handles patches
- that are empty or contain no changes.
-
- - Added two new methods (#patch_me and #unpatch_me) to the includable module.
-
-- Bugs Fixed:
-
- - Fixed issue [#1][] patch direction detection.
-
- - Resolved issue [#2][] by handling `string[string.size, 1]` properly (it
- returns `""` not `nil`).
-
- - Michael Granger (ged) fixed an implementation error in Diff::LCS::Change and
- added specs in pull request [#8][]. Thanks!
-
- - Made the code auto-testable.
-
- - Vít Ondruch (voxik) provided the latest version of the GPL2 license file in
- pull request [#10][]. Thanks!
-
- - Fixed a documentation issue with the includable versions of #patch! and
- #unpatch! where they implied that they would replace the original value.
- Given that Diff::LCS.patch always returns a copy, the documentation was
- incorrect and has been corrected. To provide the behaviour that was
- originally documented, two new methods were added to provide this behaviour.
- Found by scooter-dangle in issue [#12][]. Thanks!
-
-- Code Style Changes:
-
- - Removed trailing spaces.
-
- - Calling class methods using `.` instead of `::`.
-
- - Vít Ondruch (voxik) removed unnecessary shebangs in pull request [#9][].
- Thanks!
-
- - Kenichi Kamiya (kachick) removed some warnings of an unused variable in
- lucky pull request [#13][]. Thanks!
-
- - Embarked on a major refactoring to make the files a little more manageable
- and understand the code on a deeper level.
-
- - Adding to http://travis-ci.org.
-
-## 1.1.3 / 2011-08-27
-
-- Converted to 'hoe' for release.
-
-- Converted tests to RSpec 2.
-
-- Extracted the body of htmldiff into a class available from diff/lcs/htmldiff.
-
-- Migrated development and issue tracking to GitHub.
-
-- Bugs fixed:
-
- - Eliminated the explicit use of RubyGems in both bin/htmldiff and bin/ldiff.
- Resolves issue [#4][].
-
- - Eliminated Ruby warnings. Resolves issue [#3][].
-
-## 1.1.2 / 2004-10-20
-
-- Fixed a problem reported by Mauricio Fernandez in htmldiff.
-
-## 1.1.1 / 2004-09-25
-
-- Fixed bug #891 (Set returned from patch command does not contain last equal
- part).
-
-- Fixed a problem with callback initialisation code (it assumed that all
- callbacks passed as classes can be initialised; now, it rescues NoMethodError
- in the event of private :new being called).
-
-- Modified the non-initialisable callbacks to have a private #new method.
-
-- Moved ldiff core code to Diff::LCS::Ldiff (diff/lcs/ldiff.rb).
-
-## 1.1.0
-
-- Eliminated the need for Diff::LCS::Event and removed it.
-
-- Added a contextual diff callback, Diff::LCS::ContextDiffCallback.
-
-- Implemented patching/unpatching for standard Diff callback output formats with
- both #diff and #sdiff.
-
-- Extensive documentation changes.
-
-## 1.0.4
-
-- Fixed a problem with bin/ldiff output, especially for unified format. Newlines
- that should have been present weren't.
-
-- Changed the .tar.gz installer to generate Windows batch files if ones do not
- exist already. Removed the existing batch files as they didn't work.
-
-## 1.0.3
-
-- Fixed a problem with #traverse_sequences where the first difference from the
- left sequence might not be appropriately captured.
-
-## 1.0.2
-
-- Fixed an issue with ldiff not working because actions were changed from
- symbols to strings.
-
-## 1.0.1
-
-- Minor modifications to the gemspec, the README.
-
-- Renamed the diff program to ldiff (as well as the companion batch file) so as
- to not collide with the standard diff program.
-
-- Fixed issues with RubyGems. Requires RubyGems > 0.6.1 or >= 0.6.1 with the
- latest CVS version.
-
-## 1.0
-
-- Initial release based mostly on Perl's Algorithm::Diff.
-
-[#1]: https://github.com/halostatue/diff-lcs/issues/1
-[#2]: https://github.com/halostatue/diff-lcs/issues/2
-[#3]: https://github.com/halostatue/diff-lcs/issues/3
-[#4]: https://github.com/halostatue/diff-lcs/issues/4
-[#5]: https://github.com/halostatue/diff-lcs/issues/5
-[#6]: https://github.com/halostatue/diff-lcs/issues/6
-[#8]: https://github.com/halostatue/diff-lcs/pull/8
-[#9]: https://github.com/halostatue/diff-lcs/pull/9
-[#10]: https://github.com/halostatue/diff-lcs/pull/10
-[#12]: https://github.com/halostatue/diff-lcs/issues/12
-[#13]: https://github.com/halostatue/diff-lcs/pull/13
-[#15]: https://github.com/halostatue/diff-lcs/pull/15
-[#18]: https://github.com/halostatue/diff-lcs/pull/18
-[#21]: https://github.com/halostatue/diff-lcs/issues/21
-[#23]: https://github.com/halostatue/diff-lcs/pull/23
-[#25]: https://github.com/halostatue/diff-lcs/pull/25
-[#29]: https://github.com/halostatue/diff-lcs/pull/29
-[#33]: https://github.com/halostatue/diff-lcs/issues/33
-[#34]: https://github.com/halostatue/diff-lcs/pull/34
-[#35]: https://github.com/halostatue/diff-lcs/issues/35
-[#36]: https://github.com/halostatue/diff-lcs/pull/36
-[#38]: https://github.com/halostatue/diff-lcs/issues/38
-[#43]: https://github.com/halostatue/diff-lcs/issues/43
-[#44]: https://github.com/halostatue/diff-lcs/issues/44
-[#47]: https://github.com/halostatue/diff-lcs/pull/47
-[#48]: https://github.com/halostatue/diff-lcs/issues/48
-[#49]: https://github.com/halostatue/diff-lcs/pull/49
-[#52]: https://github.com/halostatue/diff-lcs/pull/52
-[#53]: https://github.com/halostatue/diff-lcs/issues/53
-[#57]: https://github.com/halostatue/diff-lcs/issues/57
-[#58]: https://github.com/halostatue/diff-lcs/pull/58
-[#59]: https://github.com/halostatue/diff-lcs/pull/59
-[#60]: https://github.com/halostatue/diff-lcs/issues/60
-[#61]: https://github.com/halostatue/diff-lcs/pull/61
-[#63]: https://github.com/halostatue/diff-lcs/issues/63
-[#65]: https://github.com/halostatue/diff-lcs/issues/65
-[#69]: https://github.com/halostatue/diff-lcs/issues/69
-[#71]: https://github.com/halostatue/diff-lcs/issues/71
-[#72]: https://github.com/halostatue/diff-lcs/issues/72
-[#73]: https://github.com/halostatue/diff-lcs/issues/73
-[#75]: https://github.com/halostatue/diff-lcs/issues/75
-[#79]: https://github.com/halostatue/diff-lcs/issues/79
-[#80]: https://github.com/halostatue/diff-lcs/issues/80
-[#82]: https://github.com/halostatue/diff-lcs/pull/82
-[#84]: https://github.com/halostatue/diff-lcs/pull/84
-[#86]: https://github.com/halostatue/diff-lcs/pull/86
-[#89]: https://github.com/halostatue/diff-lcs/pull/89
-[#90]: https://github.com/halostatue/diff-lcs/pull/90
-[#91]: https://github.com/halostatue/diff-lcs/issues/91
-[#92]: https://github.com/halostatue/diff-lcs/pull/92
-[#93]: https://github.com/halostatue/diff-lcs/pull/93
-[rspec/rspec-expectations#200]: https://github.com/rspec/rspec-expectations/pull/200
-[rspec/rspec-expectations#219]: https://github.com/rspec/rspec-expectations/issues/219
-[rspec/rspec-expectations#238]: https://github.com/rspec/rspec-expectations/issues/238
-[rspec/rspec-expectations#239]: https://github.com/rspec/rspec-expectations/issues/239
-[rspec/rspec-expectations@3d6fc82c]: https://github.com/rspec/rspec-expectations/commit/3d6fc82c
-[rubinius/rubinius#2268]: https://github.com/rubinius/rubinius/issues/2268
-[standard ruby]: https://github.com/standardrb/standard
diff --git a/License.md b/LICENCE.md
similarity index 100%
rename from License.md
rename to LICENCE.md
diff --git a/Manifest.txt b/Manifest.txt
index 0d7dcb3..0b1c107 100644
--- a/Manifest.txt
+++ b/Manifest.txt
@@ -1,11 +1,14 @@
.rspec
-Code-of-Conduct.md
+CHANGELOG.md
+CODE_OF_CONDUCT.md
+CONTRIBUTING.md
+CONTRIBUTORS.md
Contributing.md
-History.md
-License.md
+LICENCE.md
Manifest.txt
-README.rdoc
+README.md
Rakefile
+SECURITY.md
bin/htmldiff
bin/ldiff
docs/COPYING.txt
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..857a113
--- /dev/null
+++ b/README.md
@@ -0,0 +1,92 @@
+# Diff::LCS
+
+- home :: https://github.com/halostatue/diff-lcs
+- changelog :: https://github.com/halostatue/diff-lcs/blob/main/CHANGELOG.md
+- code :: https://github.com/halostatue/diff-lcs
+- bugs :: https://github.com/halostatue/diff-lcs/issues
+- rdoc :: http://rubydoc.info/github/halostatue/diff-lcs
+
+
+
+
+
+## Description
+
+Diff::LCS computes the difference between two Enumerable sequences using the
+McIlroy-Hunt longest common subsequence (LCS) algorithm. It includes utilities
+to create a simple HTML diff output format and a standard diff-like tool.
+
+This is release 1.4.3, providing a simple extension that allows for
+Diff::LCS::Change objects to be treated implicitly as arrays and fixes a number
+of formatting issues.
+
+Ruby versions below 2.5 are soft-deprecated, which means that older versions are
+no longer part of the CI test suite. If any changes have been introduced that
+break those versions, bug reports and patches will be accepted, but it will be
+up to the reporter to verify any fixes prior to release. The next major release
+will completely break compatibility.
+
+## Synopsis
+
+Using this module is quite simple. By default, Diff::LCS does not extend objects
+with the Diff::LCS interface, but will be called as if it were a function:
+
+```ruby
+require 'diff/lcs'
+
+seq1 = %w(a b c e h j l m n p)
+seq2 = %w(b c d e f j k l m r s t)
+
+lcs = Diff::LCS.LCS(seq1, seq2)
+diffs = Diff::LCS.diff(seq1, seq2)
+sdiff = Diff::LCS.sdiff(seq1, seq2)
+seq = Diff::LCS.traverse_sequences(seq1, seq2, callback_obj)
+bal = Diff::LCS.traverse_balanced(seq1, seq2, callback_obj)
+seq2 == Diff::LCS.patch!(seq1, diffs)
+seq1 == Diff::LCS.unpatch!(seq2, diffs)
+seq2 == Diff::LCS.patch!(seq1, sdiff)
+seq1 == Diff::LCS.unpatch!(seq2, sdiff)
+```
+
+Objects can be extended with Diff::LCS:
+
+```ruby
+seq1.extend(Diff::LCS)
+lcs = seq1.lcs(seq2)
+diffs = seq1.diff(seq2)
+sdiff = seq1.sdiff(seq2)
+seq = seq1.traverse_sequences(seq2, callback_obj)
+bal = seq1.traverse_balanced(seq2, callback_obj)
+seq2 == seq1.patch!(diffs)
+seq1 == seq2.unpatch!(diffs)
+seq2 == seq1.patch!(sdiff)
+seq1 == seq2.unpatch!(sdiff)
+```
+
+By requiring 'diff/lcs/array' or 'diff/lcs/string', Array or String will be
+extended for use this way.
+
+Note that Diff::LCS requires a sequenced enumerable container, which means that
+the order of enumeration is both predictable and consistent for the same set of
+data. While it is theoretically possible to generate a diff for an unordered
+hash, it will only be meaningful if the enumeration of the hashes is consistent.
+In general, this will mean that containers that behave like String or Array will
+perform best.
+
+## History
+
+Diff::LCS is a port of Perl's Algorithm::Diff that uses the McIlroy-Hunt longest
+common subsequence (LCS) algorithm to compute intelligent differences between
+two sequenced enumerable containers. The implementation is based on Mario I.
+Wolczko's [Smalltalk version 1.2][smalltalk] (1993) and Ned Konz's Perl version
+[Algorithm::Diff 1.15][perl]. `Diff::LCS#sdiff` and
+`Diff::LCS#traverse_balanced` were originally written for the Perl version by
+Mike Schilli.
+
+The algorithm is described in A Fast Algorithm for Computing Longest Common
+Subsequences, CACM, vol.20, no.5, pp.350-353, May 1977, with a few minor
+improvements to improve the speed. A simplified description of the algorithm,
+originally written for the Perl version, was written by Mark-Jason Dominus.
+
+[smalltalk]: ftp://st.cs.uiuc.edu/pub/Smalltalk/MANCHESTER/manchester/4.0/diff.st
+[perl]: http://search.cpan.org/~nedkonz/Algorithm-Diff-1.15/
diff --git a/README.rdoc b/README.rdoc
deleted file mode 100644
index 6092424..0000000
--- a/README.rdoc
+++ /dev/null
@@ -1,84 +0,0 @@
-= Diff::LCS
-
-home :: https://github.com/halostatue/diff-lcs
-code :: https://github.com/halostatue/diff-lcs
-bugs :: https://github.com/halostatue/diff-lcs/issues
-rdoc :: http://rubydoc.info/github/halostatue/diff-lcs
-continuous integration :: {
}[https://github.com/halostatue/diff-lcs/actions]
-
-== Description
-
-Diff::LCS computes the difference between two Enumerable sequences using the
-McIlroy-Hunt longest common subsequence (LCS) algorithm. It includes utilities
-to create a simple HTML diff output format and a standard diff-like tool.
-
-This is release 1.4.3, providing a simple extension that allows for
-Diff::LCS::Change objects to be treated implicitly as arrays and fixes a
-number of formatting issues.
-
-Ruby versions below 2.5 are soft-deprecated, which means that older versions
-are no longer part of the CI test suite. If any changes have been introduced
-that break those versions, bug reports and patches will be accepted, but it
-will be up to the reporter to verify any fixes prior to release. The next
-major release will completely break compatibility.
-
-== Synopsis
-
-Using this module is quite simple. By default, Diff::LCS does not extend
-objects with the Diff::LCS interface, but will be called as if it were a
-function:
-
- require 'diff/lcs'
-
- seq1 = %w(a b c e h j l m n p)
- seq2 = %w(b c d e f j k l m r s t)
-
- lcs = Diff::LCS.LCS(seq1, seq2)
- diffs = Diff::LCS.diff(seq1, seq2)
- sdiff = Diff::LCS.sdiff(seq1, seq2)
- seq = Diff::LCS.traverse_sequences(seq1, seq2, callback_obj)
- bal = Diff::LCS.traverse_balanced(seq1, seq2, callback_obj)
- seq2 == Diff::LCS.patch!(seq1, diffs)
- seq1 == Diff::LCS.unpatch!(seq2, diffs)
- seq2 == Diff::LCS.patch!(seq1, sdiff)
- seq1 == Diff::LCS.unpatch!(seq2, sdiff)
-
-Objects can be extended with Diff::LCS:
-
- seq1.extend(Diff::LCS)
- lcs = seq1.lcs(seq2)
- diffs = seq1.diff(seq2)
- sdiff = seq1.sdiff(seq2)
- seq = seq1.traverse_sequences(seq2, callback_obj)
- bal = seq1.traverse_balanced(seq2, callback_obj)
- seq2 == seq1.patch!(diffs)
- seq1 == seq2.unpatch!(diffs)
- seq2 == seq1.patch!(sdiff)
- seq1 == seq2.unpatch!(sdiff)
-
-By requiring 'diff/lcs/array' or 'diff/lcs/string', Array or String will be
-extended for use this way.
-
-Note that Diff::LCS requires a sequenced enumerable container, which means that
-the order of enumeration is both predictable and consistent for the same set of
-data. While it is theoretically possible to generate a diff for an unordered
-hash, it will only be meaningful if the enumeration of the hashes is
-consistent. In general, this will mean that containers that behave like String
-or Array will perform best.
-
-== History
-
-Diff::LCS is a port of Perl's Algorithm::Diff that uses the McIlroy-Hunt
-longest common subsequence (LCS) algorithm to compute intelligent differences
-between two sequenced enumerable containers. The implementation is based on
-Mario I. Wolczko's
-{Smalltalk version 1.2}[ftp://st.cs.uiuc.edu/pub/Smalltalk/MANCHESTER/manchester/4.0/diff.st]
-(1993) and Ned Konz's Perl version
-{Algorithm::Diff 1.15}[http://search.cpan.org/~nedkonz/Algorithm-Diff-1.15/].
-Diff::LCS#sdiff and Diff::LCS#traverse_balanced were originally written for the
-Perl version by Mike Schilli.
-
-The algorithm is described in A Fast Algorithm for Computing Longest Common
-Subsequences, CACM, vol.20, no.5, pp.350-353, May 1977, with a few minor
-improvements to improve the speed. A simplified description of the algorithm,
-originally written for the Perl version, was written by Mark-Jason Dominus.
diff --git a/Rakefile b/Rakefile
index c047913..3f39403 100644
--- a/Rakefile
+++ b/Rakefile
@@ -35,15 +35,15 @@ end
_spec = Hoe.spec "diff-lcs" do
developer("Austin Ziegler", "halostatue@gmail.com")
- self.history_file = "History.md"
- self.readme_file = "README.rdoc"
+ self.history_file = "CHANGELOG.md"
+ self.readme_file = "README.md"
self.licenses = ["MIT", "Artistic-1.0-Perl", "GPL-2.0-or-later"]
require_ruby_version ">= 1.8"
spec_extras[:metadata] = ->(val) {
val["rubygems_mfa_required"] = "true"
- val["changelog_uri"] = "https://github.com/halostatue/diff-lcs/blob/main/History.md"
+ val["changelog_uri"] = "https://github.com/halostatue/diff-lcs/blob/main/CHANGELOG.md"
}
extra_dev_deps << ["hoe", ">= 3.0", "< 5"]
diff --git a/SECURITY.md b/SECURITY.md
index f4744f4..16854f6 100644
--- a/SECURITY.md
+++ b/SECURITY.md
@@ -1,7 +1,41 @@
# diff-lcs Security
-## Security contact information
+## Supported Versions
-To report a security vulnerability, please use the
-[Tidelift security contact](https://tidelift.com/security). Tidelift will
+Security reports are accepted for the most recent major release and the previous
+version for a limited time after the initial major release version. After a
+major release, the previous version will receive full support for six months and
+security support for an additional six months (for a total of twelve months).
+
+Because diff-lcs 1.x supports a wide range of Ruby versions, security reports
+will only be accepted when they can be demonstrated on Ruby 3.1 or higher.
+
+> [!information]
+>
+> There will be a diff-lcs 2.0 released in 2025 which narrows support to modern
+> versions of Ruby only.
+>
+> | Release Date | Support Ends | Security Support Ends |
+> | ------------ | ------------ | --------------------- |
+> | 2025 | +6 months | +12 months |
+>
+> If the 2.0.0 release happens on 2025-07-01, regular support for diff-lcs 1.x
+> will end on 2026-12-31 and security support for diff-lcs 1.x will end on
+> 2026-06-30.
+
+## Reporting a Vulnerability
+
+By preference, use the [Tidelift security contact][tidelift]. Tidelift will
coordinate the fix and disclosure.
+
+Alternatively, Send an email to [diff-lcs@halostatue.ca][email] with the text
+`Diff::LCS` in the subject. Emails sent to this address should be encrypted
+using [age][age] with the following public key:
+
+```
+age1fc6ngxmn02m62fej5cl30lrvwmxn4k3q2atqu53aatekmnqfwumqj4g93w
+```
+
+[tidelift]: https://tidelift.com/security
+[email]: mailto:diff-lcs@halostatue.ca
+[age]: https://github.com/FiloSottile/age
diff --git a/diff-lcs.gemspec b/diff-lcs.gemspec
index 0ed0e6c..85364ac 100644
--- a/diff-lcs.gemspec
+++ b/diff-lcs.gemspec
@@ -6,20 +6,20 @@ Gem::Specification.new do |s|
s.version = "1.5.1".freeze
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
- s.metadata = { "bug_tracker_uri" => "https://github.com/halostatue/diff-lcs/issues", "changelog_uri" => "https://github.com/halostatue/diff-lcs/blob/main/History.md", "homepage_uri" => "https://github.com/halostatue/diff-lcs", "rubygems_mfa_required" => "true", "source_code_uri" => "https://github.com/halostatue/diff-lcs" } if s.respond_to? :metadata=
+ s.metadata = { "changelog_uri" => "https://github.com/halostatue/diff-lcs/blob/main/CHANGELOG.md", "rubygems_mfa_required" => "true" } if s.respond_to? :metadata=
s.require_paths = ["lib".freeze]
s.authors = ["Austin Ziegler".freeze]
- s.date = "2024-08-22"
- s.description = "Diff::LCS computes the difference between two Enumerable sequences using the\nMcIlroy-Hunt longest common subsequence (LCS) algorithm. It includes utilities\nto create a simple HTML diff output format and a standard diff-like tool.\n\nThis is release 1.4.3, providing a simple extension that allows for\nDiff::LCS::Change objects to be treated implicitly as arrays and fixes a\nnumber of formatting issues.\n\nRuby versions below 2.5 are soft-deprecated, which means that older versions\nare no longer part of the CI test suite. If any changes have been introduced\nthat break those versions, bug reports and patches will be accepted, but it\nwill be up to the reporter to verify any fixes prior to release. The next\nmajor release will completely break compatibility.".freeze
+ s.date = "2025-02-02"
+ s.description = "Diff::LCS computes the difference between two Enumerable sequences using the\nMcIlroy-Hunt longest common subsequence (LCS) algorithm. It includes utilities\nto create a simple HTML diff output format and a standard diff-like tool.\n\nThis is release 1.4.3, providing a simple extension that allows for\nDiff::LCS::Change objects to be treated implicitly as arrays and fixes a number\nof formatting issues.\n\nRuby versions below 2.5 are soft-deprecated, which means that older versions are\nno longer part of the CI test suite. If any changes have been introduced that\nbreak those versions, bug reports and patches will be accepted, but it will be\nup to the reporter to verify any fixes prior to release. The next major release\nwill completely break compatibility.".freeze
s.email = ["halostatue@gmail.com".freeze]
s.executables = ["htmldiff".freeze, "ldiff".freeze]
- s.extra_rdoc_files = ["Code-of-Conduct.md".freeze, "Contributing.md".freeze, "History.md".freeze, "License.md".freeze, "Manifest.txt".freeze, "README.rdoc".freeze, "docs/COPYING.txt".freeze, "docs/artistic.txt".freeze]
- s.files = [".rspec".freeze, "Code-of-Conduct.md".freeze, "Contributing.md".freeze, "History.md".freeze, "License.md".freeze, "Manifest.txt".freeze, "README.rdoc".freeze, "Rakefile".freeze, "bin/htmldiff".freeze, "bin/ldiff".freeze, "docs/COPYING.txt".freeze, "docs/artistic.txt".freeze, "lib/diff-lcs.rb".freeze, "lib/diff/lcs.rb".freeze, "lib/diff/lcs/array.rb".freeze, "lib/diff/lcs/backports.rb".freeze, "lib/diff/lcs/block.rb".freeze, "lib/diff/lcs/callbacks.rb".freeze, "lib/diff/lcs/change.rb".freeze, "lib/diff/lcs/htmldiff.rb".freeze, "lib/diff/lcs/hunk.rb".freeze, "lib/diff/lcs/internals.rb".freeze, "lib/diff/lcs/ldiff.rb".freeze, "lib/diff/lcs/string.rb".freeze, "spec/change_spec.rb".freeze, "spec/diff_spec.rb".freeze, "spec/fixtures/aX".freeze, "spec/fixtures/bXaX".freeze, "spec/fixtures/ds1.csv".freeze, "spec/fixtures/ds2.csv".freeze, "spec/fixtures/ldiff/output.diff".freeze, "spec/fixtures/ldiff/output.diff-c".freeze, "spec/fixtures/ldiff/output.diff-e".freeze, "spec/fixtures/ldiff/output.diff-f".freeze, "spec/fixtures/ldiff/output.diff-u".freeze, "spec/fixtures/ldiff/output.diff.chef".freeze, "spec/fixtures/ldiff/output.diff.chef-c".freeze, "spec/fixtures/ldiff/output.diff.chef-e".freeze, "spec/fixtures/ldiff/output.diff.chef-f".freeze, "spec/fixtures/ldiff/output.diff.chef-u".freeze, "spec/fixtures/ldiff/output.diff.chef2".freeze, "spec/fixtures/ldiff/output.diff.chef2-c".freeze, "spec/fixtures/ldiff/output.diff.chef2-d".freeze, "spec/fixtures/ldiff/output.diff.chef2-e".freeze, "spec/fixtures/ldiff/output.diff.chef2-f".freeze, "spec/fixtures/ldiff/output.diff.chef2-u".freeze, "spec/fixtures/new-chef".freeze, "spec/fixtures/new-chef2".freeze, "spec/fixtures/old-chef".freeze, "spec/fixtures/old-chef2".freeze, "spec/hunk_spec.rb".freeze, "spec/issues_spec.rb".freeze, "spec/lcs_spec.rb".freeze, "spec/ldiff_spec.rb".freeze, "spec/patch_spec.rb".freeze, "spec/sdiff_spec.rb".freeze, "spec/spec_helper.rb".freeze, "spec/traverse_balanced_spec.rb".freeze, "spec/traverse_sequences_spec.rb".freeze]
+ s.extra_rdoc_files = ["CHANGELOG.md".freeze, "CODE_OF_CONDUCT.md".freeze, "CONTRIBUTING.md".freeze, "CONTRIBUTORS.md".freeze, "Contributing.md".freeze, "LICENCE.md".freeze, "Manifest.txt".freeze, "README.md".freeze, "SECURITY.md".freeze, "docs/COPYING.txt".freeze, "docs/artistic.txt".freeze]
+ s.files = [".rspec".freeze, "CHANGELOG.md".freeze, "CODE_OF_CONDUCT.md".freeze, "CONTRIBUTING.md".freeze, "CONTRIBUTORS.md".freeze, "Contributing.md".freeze, "LICENCE.md".freeze, "Manifest.txt".freeze, "README.md".freeze, "Rakefile".freeze, "SECURITY.md".freeze, "bin/htmldiff".freeze, "bin/ldiff".freeze, "docs/COPYING.txt".freeze, "docs/artistic.txt".freeze, "lib/diff-lcs.rb".freeze, "lib/diff/lcs.rb".freeze, "lib/diff/lcs/array.rb".freeze, "lib/diff/lcs/backports.rb".freeze, "lib/diff/lcs/block.rb".freeze, "lib/diff/lcs/callbacks.rb".freeze, "lib/diff/lcs/change.rb".freeze, "lib/diff/lcs/htmldiff.rb".freeze, "lib/diff/lcs/hunk.rb".freeze, "lib/diff/lcs/internals.rb".freeze, "lib/diff/lcs/ldiff.rb".freeze, "lib/diff/lcs/string.rb".freeze, "spec/change_spec.rb".freeze, "spec/diff_spec.rb".freeze, "spec/fixtures/aX".freeze, "spec/fixtures/bXaX".freeze, "spec/fixtures/ds1.csv".freeze, "spec/fixtures/ds2.csv".freeze, "spec/fixtures/ldiff/output.diff".freeze, "spec/fixtures/ldiff/output.diff-c".freeze, "spec/fixtures/ldiff/output.diff-e".freeze, "spec/fixtures/ldiff/output.diff-f".freeze, "spec/fixtures/ldiff/output.diff-u".freeze, "spec/fixtures/ldiff/output.diff.chef".freeze, "spec/fixtures/ldiff/output.diff.chef-c".freeze, "spec/fixtures/ldiff/output.diff.chef-e".freeze, "spec/fixtures/ldiff/output.diff.chef-f".freeze, "spec/fixtures/ldiff/output.diff.chef-u".freeze, "spec/fixtures/ldiff/output.diff.chef2".freeze, "spec/fixtures/ldiff/output.diff.chef2-c".freeze, "spec/fixtures/ldiff/output.diff.chef2-d".freeze, "spec/fixtures/ldiff/output.diff.chef2-e".freeze, "spec/fixtures/ldiff/output.diff.chef2-f".freeze, "spec/fixtures/ldiff/output.diff.chef2-u".freeze, "spec/fixtures/new-chef".freeze, "spec/fixtures/new-chef2".freeze, "spec/fixtures/old-chef".freeze, "spec/fixtures/old-chef2".freeze, "spec/hunk_spec.rb".freeze, "spec/issues_spec.rb".freeze, "spec/lcs_spec.rb".freeze, "spec/ldiff_spec.rb".freeze, "spec/patch_spec.rb".freeze, "spec/sdiff_spec.rb".freeze, "spec/spec_helper.rb".freeze, "spec/traverse_balanced_spec.rb".freeze, "spec/traverse_sequences_spec.rb".freeze]
s.homepage = "https://github.com/halostatue/diff-lcs".freeze
s.licenses = ["MIT".freeze, "Artistic-1.0-Perl".freeze, "GPL-2.0-or-later".freeze]
- s.rdoc_options = ["--main".freeze, "README.rdoc".freeze]
+ s.rdoc_options = ["--main".freeze, "README.md".freeze]
s.required_ruby_version = Gem::Requirement.new(">= 1.8".freeze)
- s.rubygems_version = "3.5.17".freeze
+ s.rubygems_version = "3.5.22".freeze
s.summary = "Diff::LCS computes the difference between two Enumerable sequences using the McIlroy-Hunt longest common subsequence (LCS) algorithm".freeze
s.specification_version = 4
diff --git a/docs/artistic.txt b/docs/artistic.txt
index c04639a..763e17a 100644
--- a/docs/artistic.txt
+++ b/docs/artistic.txt
@@ -122,6 +122,6 @@ products derived from this software without specific prior written permission.
10. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
-WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
The End
diff --git a/lib/diff/lcs.rb b/lib/diff/lcs.rb
index bdf0805..0ff8492 100644
--- a/lib/diff/lcs.rb
+++ b/lib/diff/lcs.rb
@@ -421,7 +421,7 @@ def traverse_sequences(seq1, seq2, callbacks = Diff::LCS::SequenceCallbacks) # :
# occurred.
#
# #traverse_balanced might be a bit slower than #traverse_sequences,
- # noticable only while processing huge amounts of data.
+ # noticeable only while processing huge amounts of data.
#
# == Algorithm
#
diff --git a/lib/diff/lcs/hunk.rb b/lib/diff/lcs/hunk.rb
index 2ac76c5..a36caed 100644
--- a/lib/diff/lcs/hunk.rb
+++ b/lib/diff/lcs/hunk.rb
@@ -22,7 +22,7 @@ def initialize(data_old, data_new, piece, flag_context, file_length_difference)
end
if String.method_defined?(:encoding)
- @preferred_data_encoding = data_old.fetch(0) { data_new.fetch(0, "") }.encoding
+ @preferred_data_encoding = data_old.fetch(0) { data_new.fetch(0) { "" } }.encoding
end
@data_old = data_old