A simple Ruby Gem to decompress and check the CRC of compressed files.
Add this line to your application's Gemfile:
And then execute:
Or install it yourself as:
$ gem install dearchiver
Dearchiver will use the command line of your operating system to perform the desired operations in the compressed files. This means that you need to have utilities installed (say unzip, unrar, 7zip and tar).
Usage is very simple.
Just for now the gem will work only of the following type of files:
.zip .rar .tar.gz .7z
TESTED ON Ubuntu 10.04: No idea how it is going to behave in other OS.
da = Dearchiver.new(:filename => "foo.zip") da.crc_ok?
If the filename doesn't have any extension, you can use:
da = Dearchiver.new(:filename => "foo", :archive_type => ".zip") da.crc_ok?
da = Dearchiver.new(:filename => "foo.zip") da.extract_to("/tmp") puts da.list_of_files
Original Blog Post
- Fork it
- Create your feature branch (
git checkout -b my-new-feature)
- Commit your changes (
git commit -am 'Added some feature')
- Push to the branch (
git push origin my-new-feature)
- Create new Pull Request