The Rake::PackageTask class is a task library used to automate the creation of redistributable package files (such as .zip, .tar.gz, or .tgz archives). When initialized, it automatically defines several Rake tasks for your project.
Generated Tasks
:package: Creates all requested package files.:repackage: Rebuilds package files from scratch, even if they are not out of date (runs :clobber_package first).:clobber_package: Deletes all generated package files. This is automatically added to the main :clobber task.
Configuration Options
When creating a PackageTask, you can configure the following attributes:
name: The name of the package.version: The version string (e.g., '1.2.3'). Use :noversion to build a package without a version in the filename.package_dir: The directory where packages are stored (defaults to 'pkg').package_files: A Rake::FileList of files to include in the archive.need_tar, need_tar_gz, need_tar_bz2, need_tar_xz, need_zip: Boolean flags to enable specific archive formats.tar_command: The command used for tar archives (defaults to 'tar').zip_command: The command used for zip archives (defaults to 'zip').without_parent_dir: If true, the archive will not contain the top-level directory named after the package (the files will be at the root of the archive).
Rake::PackageTask.new("rake", "1.2.3") do |p|
p.need_tar = true
p.package_files.include("lib/**/*.rb")
end