Ruby bindings to bsdiff and bspatch

Installation

gem install 'rb-bsdiff'

Or via Gemfile:

gem 'rb-bsdiff'

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.

Usage

  # 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')

Caveats

As the underlying code only works with files, so does this API. Pass in only filenames for parameters.

License

  • Cloudability's contributions to this project are made available under the Simplified BSD License.
  • BSDiff is produced under the Simplified BSD License
  • The original version of this gem, by Todd Fisher does not specify a license for his contributions, however:
    • His direct modifications to the BSDiff source retain the original copyright notice without modification or annotation.
    • His new contributions do not specify a license.