trinitronx / lzop-file

Ruby library for writing LZOP files.
MIT License
2 stars 0 forks source link

LZOP::File

Build Status Gratipay

Ruby library for writing LZOP files.

This gem writes the binary file format for .lzo or .lz files in native Ruby code. The lzoruby gem is used to compress the data.

Known Issues

This release of lzop-file is currently not feature-complete & should be treated as a beta release! There are known issues with the current implementation with regards to output file compatibility with the lzop tool:

Installation

Notes: This gem depends on lzoruby which uses native C extensions, and depends on the lzo library. As such, it has dependencies that should probably not be used on JRuby in production.

To install the LZO Library:

Add this line to your application's Gemfile:

gem 'lzop-file'

And then execute:

$ bundle

Or install it yourself as:

$ gem install lzop-file

Usage

Writing LZO Compressed files is simple:

require 'lzop-file'

uncompressed_file_data = "Hello World\n" * 100

my_test_file = LZOP::File.new( '/tmp/my_test_file.lzo' )
my_test_file.write( uncompressed_file_data )

Or to write just the header:

require 'lzop-file'

LZOP::File.new( '/tmp/my_test_file.lzo_header' ).write_header

Contributing

  1. Fork it ( https://github.com/trinitronx/lzop-file/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request