# gdiff / gpatch

## Description An implementation of the gdiff protocol. [Protocol description](www.w3.org/TR/NOTE-gdiff-19970901)

## Find it at

http://ruby.brian-schroeder.de/gdiff/

## Installation:

wget http://ruby.brian-schroeder.de/gdiff/releases/gdiff-0.0.1.tar.bz2
tar -xvvjf gdiff-0.0.1.tar.bz2
cd gdiff-0.0.1
ruby setup.rb

## Usage:

gdiff file_a file_b > patch
gpatch file_a patch > file_b_from_patch

### or as a library:

require 'gdiff'

File.open("patch", "wb") do | patch |
  patch << Diff::GDiff.diff(File.read("file_a"), File.read("file_b")).pack
end

File.open("file_b_from_patch", "wb") do | file_b_2 |
  file_b_2 << Diff::GDiff.unpack(File.read("patch")).apply_to(File.read("file_a"))
end

## Authors This was implemented by Brian Schroeder with the help of Zed Shaws wonderfull suffix-tree extension.

## License GPL and ruby license if applicable (I have to ask zed).