KDiff3
Provides a simple way to utilize the power of kdiff3 by Joachim Eibl in ruby.
Installation
gem install kdiff3
or
gem 'kdiff3' # in your Gemfile
Examples
Merging inline HTML
result = KDiff3.merge(
base: "<p>1,2,<p>1,<p>2,</p></p>3</p>",
yours: "<p>1,2,<p>1,</p>3</p>",
theirs: "<p>1,2,<p><p>2,</p></p>3</p>",
html: true
)
# => "<p>1,2,<p></p>3</p>"
Merging files
result = KDiff3.merge(
base: "path/to/base",
yours: "path/to/yours",
theirs: "path/to/theirs"
)
# => (whatever merged output is from the files)
Development
KDiff3 exists in ext/kdiff3 using a git subtree
- KDiff3 repo here: https://github.com/NullVoxPopuli/kdiff3
- More info on subtrees here: https://medium.com/@v/git-subtrees-a-tutorial-6ff568381844
Contributing
- Fork, Test, Pull Request :-)