Skip to content

Upgrading diff-lcs 1 to 2

Breaking1.6.2 → 2.0.0Breaking5Platform1New1Other2

BreakingUpgrade verdict

5 breaking changes and a platform requirement change.

  • The htmldiff command-line tool is gone and has no substitute.
  • The ldiff tool can no longer produce ed or reverse_ed script output.
  • Use Diff::LCS.lcs instead of the removed Diff::LCS.LCS alias.
  • Sorting of change objects now compares position first, then action, then element, and the action order changed.
Top 4 of 6 that need code or config changes

Ruby requirement changed in 2.0.0.beta.1: >= 1.8 → >= 3.2.0, < 5.

Breaking5
Removes the htmldiff binary and its supporting code without replacement.
htmldiff
ldiff no longer supports ed-script output (ed and reverse_ed formats).
ldiffedreverse_ed
Removes Diff::LCS.LCS as an alias for Diff::LCS.lcs.
Diff::LCS.LCSDiff::LCS.lcs
Fixes Diff::LCS::Change and Diff::LCS::ContextChange comparison ordering and changes the order of VALID_ACTIONS.
Diff::LCS::ChangeDiff::LCS::ContextChange<=>VALID_ACTIONS
Internal APIs including Diff::LCS::Block, Diff::LCS::Change, Diff::LCS::ContextChange, and Diff::LCS::Hunk changed for compatibility.
Diff::LCS::BlockDiff::LCS::ChangeDiff::LCS::ContextChangeDiff::LCS::Hunk
Platform1
diff-lcs 2 requires Ruby 3.2 or higher.