Class Gem::Package::TarOutput
In: lib/rubygems/package/tar_output.rb
Parent: Object

TarOutput is a wrapper to TarWriter that builds gem-format tar file.

Gem-format tar files contain the following files:

data.tar.gz
A gzipped tar file containing the files that compose the gem which will be extracted into the gem/ dir on installation.
metadata.gz
A YAML format Gem::Specification.
data.tar.gz.sig
A signature for the gem‘s data.tar.gz.
metadata.gz.sig
A signature for the gem‘s metadata.gz.

See TarOutput::open for usage details.

Methods

Public Class methods

Creates a new TarOutput that will write a gem-format tar file to io. If signer is given, the data.tar.gz and metadata.gz will be signed and the signatures will be added to the tar file.

Creates a new TarOutput which will yield a TarWriter object for the data.tar.gz portion of a gem-format tar file.

See initialize for details on io and signer.

See add_gem_contents for details on adding metadata to the tar file.

Public Instance methods

Yields a TarWriter for the data.tar.gz inside a gem-format tar file. The yielded TarWriter has been extended with a metadata= method for attaching a YAML format Gem::Specification which will be written by add_metadata.

Adds metadata.gz to the gem-format tar file which was saved from a previous add_gem_contents call.

Adds data.tar.gz.sig and metadata.gz.sig to the gem-format tar files if a Gem::Security::Signer was sent to initialize.

Closes the TarOutput.

[Validate]