Ruby bindings to bsdiff and bspatch
gem install 'rb-bsdiff'
Or via Gemfile:
As this uses native-code extensions you will of course require a working build toolchain. Additionally, you will need the BZip2 libraries to be present on your system. On OSX they should already be present. On Linux, you may need to install relevant packages, for example:
sudo apt-get install libbz2-1.0 libbz2-dev
See http://bzip.org/ for more information.
# Generate a patch from ext/b0 to ext/b1 as p0. BSDiff.diff('ext/b0', 'ext/b1', 'p0') # apply patch p0 to ext/b0 and produce output as b3. b3 should be # identical to ext/b1. BSDiff.patch('ext/b0', 'b3', 'p0')
As the underlying code only works with files, so does this API. Pass in only filenames for parameters.