Skip to content
/ gziprb Public

A full pure-Ruby implementation of gzip/deflate

License

Notifications You must be signed in to change notification settings

owst/gziprb

Repository files navigation

gziprb Build Status

gziprb is a pure-Ruby implementation of the famous GZIP/DEFLATE format. It is (definitely!) not optimised for performance, but was instead created as a learning exercise to try and better understand the gzip format.

Usage

To compress a file use gziprb INPUT_FILE, which will create INPUT_FILE.gz and not alter INPUT_FILE.

To decompress a file use gunziprb INPUT_FILE.gz, which will create INPUT_FILE and will not alter INPUT_FILE.gz.

Tests

gziprb is tested with unit tests (using RSpec) and shell integration tests (using bats). To run all tests, use bundle exec rake test (or just bundle exec rake as test is the default task).

bats and its extension libraries should be installed via the included npm package.json using npm install.

In addition to the npm dependency, the integration tests use gzip/gunzip, which may not be availabe, so only the unit tests can be run by using bundle exec rake spec. Similarly, just the integration tests can be run with bundle exec rake integration_test.

Acknowledgements

The official gzip repository contains puff.c a simple implementation of inflation of gzip-compressed files, which, along with Joshua Davies' blogpost were very useful when first trying to get to grips with the formats. Michael Dipperstein's blogpost contained several useful hints regarding LZ77.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/owst/gziprb.

About

A full pure-Ruby implementation of gzip/deflate

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published