diff~hanneskaeufler

Crystal sequence differencing implementation.
1.0.0 Latest release released

crystal-diff

Crystal sequence differencing implementation.

Based on the algorithm proposed in "An O(NP) Sequence Comparision Algorithm" (Wu, 1989)

Build Status Document

Installation

Add this to your application's shard.yml:

dependencies:
  diff:
    github: MakeNowJust/crystal-diff

Usage

require "diff"
require "colorize"

Diff.diff("hello world", "hello good-bye").each do |chunk|
  print chunk.data.colorize(
    chunk.append? ? :green :
    chunk.delete? ? :red   : :dark_gray)
end

result

Development

$ crystal spec

Contributing

  1. Fork it ( https://github.com/MakeNowJust/crystal-diff/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

diff:
  github: hanneskaeufler/crystal-diff
  version: ~> 1.0.0
License MIT
Crystal none

Authors

Dependencies 0

Development Dependencies 0

Dependents 0

Last synced .
search fire star recently