This method is deprecated or moved on the latest stable version.
The last existing version (v1_9_3_392) is shown here.
add_metadata()
public
Adds metadata.gz to the gem-format tar file which was saved from a previous
#add_gem_contents
call.
# File lib/rubygems/package/tar_output.rb, line 95
def add_metadata
return if @metadata.nil?
@tar_writer.add_file "metadata.gz", 0644 do |io|
begin
sio = @signer ? StringIO.new : nil
gzos = Zlib::GzipWriter.new(sio || io)
gzos.write @metadata
ensure
gzos.flush
gzos.finish
# if we have a signing key, then sign the metadata digest and return
# the signature
if @signer then
require 'rubygems/security'
digest = Gem::Security::OPT[:dgst_algo].digest sio.string
@meta_signature = @signer.sign digest
io.write sio.string
end
end
end
end