underlog / unpacker

ruby gem for working with archives (relies on system binaries)

This URL has Read+Write access

name age message
file .bnsignore Fri Apr 24 03:28:01 -0700 2009 Initial commit. [underlog]
file .gitignore Fri Apr 24 03:40:13 -0700 2009 Making bones happy. rcov [underlog]
file History.txt Wed Jun 10 11:27:37 -0700 2009 Version bump [underlog]
file README.txt Wed Jun 10 11:24:09 -0700 2009 Switched from test::unit to rspec, for the sake... [underlog]
file Rakefile Wed Jun 10 11:24:09 -0700 2009 Switched from test::unit to rspec, for the sake... [underlog]
directory bin/ Wed Jun 10 11:24:09 -0700 2009 Switched from test::unit to rspec, for the sake... [underlog]
directory lib/ Wed Jun 10 11:27:37 -0700 2009 Version bump [underlog]
directory spec/ Wed Jun 10 11:24:09 -0700 2009 Switched from test::unit to rspec, for the sake... [underlog]
directory test/ Wed Jun 10 11:24:09 -0700 2009 Switched from test::unit to rspec, for the sake... [underlog]
README.txt
unpacker
    by Petyo Ivanov

== DESCRIPTION

Small library for unpacking various archives, extracted from Beanstalk (http://beanstalkapp.com) (and rewritten, in 
fact).

== FEATURES/PROBLEMS

None so far :). Won't run on Windows, haven't tested.

== SAMPLE USAGE

To test archives do:

    Unpacker.valid? 'path/to/file.zip'

The method optionally accepts second argument, file name (if it is different than the file path). Handy if you test temp 
uploaded files. 

To extract files do:

    Unpacker.unpack('path/to/myfile.zip') do |directory_that_contains_extracted_files|
      
    end

To recognize archives do:

    Unpacker.archive? 'path/to/archive.txt'

In case the archive is not supported (currently working with zip, bzip, gzip, tar and rar) you may get 
UnrecognizedArchiveError in both methods.

The gem takes care to remove any temporary extractings after the block is executed; (uses /tmp/ directory). 

When working with .gz files (single archive), the extracted file is always called **gz-contents**. 

== REQUIREMENTS

Relies on system calls, so you should have 
- unzip
- unrar
- tar
- gunzip
- bunzip 

In path.

== INSTALL

`sudo gem install underlog-unpacker`

== LICENSE

(The MIT License)

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.