Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/abhiyerra/rrdiff
Ruby bindings to librsync and to the rdiff tool.
https://github.com/abhiyerra/rrdiff
Last synced: about 4 hours ago
JSON representation
Ruby bindings to librsync and to the rdiff tool.
- Host: GitHub
- URL: https://github.com/abhiyerra/rrdiff
- Owner: abhiyerra
- License: mit
- Created: 2009-12-28T14:45:05.000Z (about 15 years ago)
- Default Branch: master
- Last Pushed: 2019-01-10T20:56:59.000Z (about 6 years ago)
- Last Synced: 2024-11-24T17:09:45.283Z (about 2 months ago)
- Language: Ruby
- Homepage:
- Size: 46.9 KB
- Stars: 24
- Watchers: 3
- Forks: 15
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# rrdiff - Ruby bindings to librsync/rdiff.
Lets say you have two files oldfile and newfile where newfile
is a modified version of oldfile. We want to be able to apply
the change to oldfile such that it becomes newfile.The first process is to create a signature for the oldfile. The
parameters are the original file and where you want to store
the signature file.RRDiff.signature("oldfile", "sigfile")
Then from the newfile and the sigfile generate a delta. Deltafile
is where the delta is stored.RRDiff.delta("newfile", "sigfile", "deltafile")
Finally, apply the deltafile to the oldfile to create the patchedfile
which should be equivalent to newfile.RRDiff.patch("oldfile", "deltafile", "patchedfile")
There is also a File interface, that you can pass File instances.
It will return Tempfiles.RRDiff::File.signature(oldfile) #=>
RRDiff::File.delta(sigfile, newfile) #=>
RRDiff::File.diff(oldfile, newfile) #=>
RRDiff::File.patch(oldfile, deltafile) #=>