Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/MakeNowJust/crystal-diff
A Crystal sequence differencing implementation
https://github.com/MakeNowJust/crystal-diff
Last synced: about 1 month ago
JSON representation
A Crystal sequence differencing implementation
- Host: GitHub
- URL: https://github.com/MakeNowJust/crystal-diff
- Owner: makenowjust
- License: mit
- Created: 2016-01-22T13:51:37.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2021-01-07T23:39:32.000Z (almost 4 years ago)
- Last Synced: 2024-08-01T17:31:53.272Z (4 months ago)
- Language: Crystal
- Homepage:
- Size: 37.1 KB
- Stars: 39
- Watchers: 4
- Forks: 6
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-crystal - crystal-diff - A Crystal sequence differencing implementation (Algorithms and Data structures)
- awesome-crystal - crystal-diff - A Crystal sequence differencing implementation (Algorithms and Data structures)
README
# crystal-diff
Crystal sequence differencing implementation.
Based on the algorithm proposed in ["An O(NP) Sequence Comparision Algorithm" (Wu, 1989)](https://publications.mpi-cbg.de/Wu_1990_6334.pdf)
[![Build Status](https://img.shields.io/travis/MakeNowJust/crystal-diff.svg?style=flat-square)](https://travis-ci.org/MakeNowJust/crystal-diff)
## Installation
Add this to your application's `shard.yml`:
```yaml
dependencies:
diff:
github: MakeNowJust/crystal-diff
```## Usage
```crystal
require "colorize"
require "../src/diff"Diff.diff("hello world", "hello good-bye").each do |chunk|
print chunk.data.colorize(
chunk.append? ? :green : chunk.delete? ? :red : :dark_gray)
end
puts
```![result](example/diff-char.png)
## Development
```console
$ 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
- [MakeNowJust](https://github.com/MakeNowJust) TSUYUSATO Kitsune - creator, maintainer