-
-
Notifications
You must be signed in to change notification settings - Fork 60
feat: diff-lcs 2.0.0 beta 1 #214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Breaking-Change: The htmldiff binary and support code have been removed without replacement. Signed-off-by: Austin Ziegler <[email protected]>
With Ruby 3.2 as the minimum supported version, compatibility shims for older Ruby versions are no longer needed. Breaking-Change: Removed backports.rb which provided compatibility for older Ruby versions. Signed-off-by: Austin Ziegler <[email protected]>
These formats are super old and very unlikely used. Their implementation was broken for a while and no-one reported it. The GNU doc say that ed format is "almost obsolete". [1] The reverse_ed (aka forward-ed) is described as "not very useful". [2] [1]: https://www.gnu.org/software/diffutils/manual/html_node/ed-Scripts.html [2]: https://www.gnu.org/software/diffutils/manual/html_node/Forward-ed.html Resolves: #108 Breaking-Change: The ed and reverse_ed output formats are no longer supported in ldiff. Signed-off-by: Austin Ziegler <[email protected]>
Signed-off-by: Austin Ziegler <[email protected]>
Modernized Block class using Ruby 3.2+ Data class for immutability and better performance. The constructor is private; use from_chunk instead. Breaking-Change: Block is immutable; new is private, from_chunk instead Signed-off-by: Austin Ziegler <[email protected]>
Modernized `Diff::LCS::Change` and `Diff::LCS::ContextChange` using immutable Data classes. Breaking-Change: change objects are immutable Signed-off-by: Austin Ziegler <[email protected]>
Signed-off-by: Austin Ziegler <[email protected]>
Optimized hunk processing by caching encoding-related strings and removing unnecessary encoding detection conditionals. Signed-off-by: Austin Ziegler <[email protected]>
Applied modern Ruby design and simplified implementation around string enumerable sequences. Signed-off-by: Austin Ziegler <[email protected]>
Simplified string enumerable sequence handling. Signed-off-by: Austin Ziegler <[email protected]>
Simplified build tooling, updated GitHub Actions workflows, prepared changelog for dev release, and updated support for Ruby 3.2 through 4.x. - Streamlined Rakefile and Gemfile and removed unnecessary complexity - Added Ruby 4.0 support and dropped unsupported Ruby versions - Simplified CI configuration - Updated release and support documents. Signed-off-by: Austin Ziegler <[email protected]>
743923b to
1d93a09
Compare
This was referenced Dec 31, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This prepares for the release of diff-lcs 2.0 beta 1. This version makes Ruby 3.2 the minimum supported version, allowing for significant modernization and breaking changes.
With modern Ruby support, we get:
readability improvements (endless methods, pattern matching);
support for immutable Data classes (
Diff::LCS::Block,Diff::LCS::Change, andDiff::LCS::ContextChange);removal of compatibility shims;
reduction in conditional tests in loops, especially for String character extraction (compare
string ? seq[i, 1] : seq[i]toseq[i]); andoptimizations to string and relying on standard encoding support present since Ruby 2.1.
The primary API (methods and class methods on
Diff::LCS) has not changed, with one exception noted below. Internal APIs (includingDiff::LCS::Block,Diff::LCS::Change,Diff::LCS::ContextChange, andDiff::LCS::Hunk) have changed for compatibility.Additionally:
The
htmldiffbinary and supporting code have been removed without replacement.ldiffno longer supportsed-script output (edandreverse_edformats). As Baptiste Courtois says in Drop ed & reverse_ed formats #108, the "implementation was broken for a while and no-one reported it."The method
Diff::LCS.LCShas been removed as an alias forDiff::LCS.lcs. Most callers are usingDiff::LCS.lcsand modern Ruby did-you-mean support should assist with this update.Release Timeline
This is a development release (2.0.0.beta.1) to allow downstream consumers (especially RSpec) time to test compatibility before the final 2.0 release in January 2026.