KDiff3

Gem Version Build Status Code Climate Test Coverage Dependency Status security

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

Contributing

  • Fork, Test, Pull Request :-)