Class | Buildr::Unzip |
In: |
lib/buildr/packaging/ziptask.rb
(CVS)
|
Parent: | Object |
An object for unzipping/untarring a file into a target directory. You can tell it to include or exclude only specific files and directories, and also to map files from particular paths inside the zip file into the target directory. Once ready, call extract.
Usually it is more convenient to create a file task for extracting the zip file (see unzip) and pass this object as a prerequisite to other tasks.
See Buildr#unzip.
Extract the zip/tgz file into the target directory.
You can call this method directly. However, if you are using the unzip method, it creates a file task for the target directory: use that task instead as a prerequisite. For example:
build unzip(dir=>zip_file)
Or:
unzip(dir=>zip_file).target.invoke
Allows you to unzip from a path. Returns an object you can use to specify which files to include/exclude relative to that path. Expands the file relative to that path.
For example:
unzip(Dir.pwd=>'test.jar').from_path('etc').include('LICENSE')
will unzip etc/LICENSE into ./LICENSE.
This is different from:
unzip(Dir.pwd=>'test.jar').include('etc/LICENSE')
which unzips etc/LICENSE into ./etc/LICENSE.