Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A Ruby Port of Neil Fraser's diff_match_patch Library

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 MIT-LICENSE
Octocat-spinner-32 README.rdoc
Octocat-spinner-32 Rakefile
Octocat-spinner-32 VERSION
Octocat-spinner-32 rdiff_match_patch.gemspec
README.rdoc

RDiffMatchPatch

This is a Ruby port of Google's DiffMatchPatch library (originally written by Neil Fraser neil.fraser.name) code.google.com/p/google-diff-match-patch/

Installation from GitHub Gems

sudo gem install arunthampi-rdiff_match_patch --source=http://gems.github.com

Installation from Source (More reliable)

git clone git://github.com/arunthampi/rdiff_match_patch.git
cd rdiff_match_patch
rake install

Status

As of now, only the 'match' capabilities of DiffMatchPatch have been implemented. Contributions are welcome to add support for Diff and Patch as well. Matching has been added as a module such as RDiffMatchPatch::Match.

The plan is that if you want only a specific functionality to be mixed in (to the String class for example), then you only include that particular module.

For example:

class String
  include RDiffMatchPatch::Match
end

When the entire library has been ported, you can get all the functionality by simply including the various RDiffMatchPatch modules, once they are implemented.

class String
  include RDiffMatchPatch::Match
  include RDiffMatchPatch::Patch
end

Usage

The module can be included like so:

class String
  include RDiffMatchPatch::Match
end

"abc".fuzzy_match("abc") # => 0
Something went wrong with that request. Please try again.