Class: Gem::Package::TarOutput

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

add_gem_contents add_metadata add_signatures close new open

### Public Class methods

new(io, signer)

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.

open(io, signer = nil) {|data_tar_writer| ...}

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

add_gem_contents() {|data_tar_writer| ...}

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.

add_metadata()

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

add_signatures()

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

close()

Closes the TarOutput.

[Validate]