RAR is a Ruby wrapper for the command-line application
rar, also known as
WinRAR for Windows. A free evaluation copy can be obtained from RarLab.
gem install rar
And you're all set. Extra dependencies will automatically be installed.
Creating an archive
Creating an archive and adding arbitrary files to it is simple!
require 'rar' archive = ::. 'archive.rar' archive.add_file 'some-file.txt' archive.add_file 'some-other-file.jpg' archive.create!
Adding command-line options
RAR provides a mapping of verbosely named options for ease of use.
archive = ::. 'archive.rar', volume_size: 15_000_000 archive.add_file 'some-file.txt' archive.add_file 'some-large-file.bin' archive.create!
This example splits the archive into multiple volumes with a size of 15MB.
To see more options, take a look at the documentation.
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request
- Initial release.