Type:
Class

Create a package based upon a Gem::Specification. Gem packages, as well as zip files and tar/gzipped packages can be produced by this task.

In addition to the Rake targets generated by Rake::PackageTask, a Gem::PackageTask will also generate the following tasks:

package_dir/name-version.gem”

Create a RubyGems package with the given name and version.

Example using a Gem::Specification:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
require 'rubygems'
require 'rubygems/package_task'
 
spec = Gem::Specification.new do |s|
  s.summary = "Ruby based make-like utility."
  s.name = 'rake'
  s.version = PKG_VERSION
  s.requirements << 'none'
  s.files = PKG_FILES
  s.description = <<-EOF
Rake is a Make-like program implemented in Ruby. Tasks
and dependencies are specified in standard Ruby syntax.
  EOF
end
 
Gem::PackageTask.new(spec) do |pkg|
  pkg.need_zip = true
  pkg.need_tar = true
end
define
  • References/Ruby on Rails/Ruby/Classes/Gem/Gem::PackageTask

define() Instance Public methods Create the Rake tasks and actions specified

2025-01-10 15:47:30
new
  • References/Ruby on Rails/Ruby/Classes/Gem/Gem::PackageTask

new(gem_spec) Class Public methods Create a Gem Package task library. Automatically

2025-01-10 15:47:30
init
  • References/Ruby on Rails/Ruby/Classes/Gem/Gem::PackageTask

init(gem) Instance Public methods Initialization tasks without the âyield selfâ

2025-01-10 15:47:30