Project

rar

0.01
No commit activity in last 3 years
No release in over 3 years
RAR is a Ruby wrapper for the command-line application rar, also known as WinRAR for Windows.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.6
>= 3.0.0, ~> 3.0
 Project Readme

RAR

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.

Build Status Dependency Status

Installation

WinRAR must be installed for this gem to work.

Installing WinRAR for Mac

  • Download the installer files and extract.
  • Copy the file titled 'rar' into a folder that's in your $PATH such as /usr/local/bin. If you're not sure what folders are in your path, run echo $PATH.
  • Open a new terminal window and test installation by running rar. If you see information about WinRAR, it installed correctly.

Install the gem

gem install rar

And you're all set. Extra dependencies will automatically be installed.

Usage

Creating an archive

Creating an archive and adding arbitrary files to it is simple!

require 'rar'

archive = RAR::Archive.new '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 = RAR::Archive.new '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.

Contributing

  1. Fork it!
  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. Submit a pull request

History

v0.1

  • Initial release.