Class Archive::Extract
In: lib/archive/extract.rb
Parent: Object

Extraction OOP interface for Archive. See ::new and extract for more information.

Methods

extract   new  

Attributes

dir  [R]  The extraction directory target. See ::new.
filename  [R]  The filename of the compressed archive. See ::new.

Public Class methods

Create a new Extract object. Takes a filename as string containing the archive name, and a directory name as string containing the target path to extract to. The default target is the current directory.

If either the filename or directory name do not already exist, ArgumentError will be raised.

Extraction tries to preserve timestamps and permissions, but not uid/gid. Note that this is format-dependent — e.g., .zip files will always be extracted as mode 0777.

Public Instance methods

Perform the extraction. Takes an optional value that when true prints each filename extracted to stdout.

[Validate]