Flowdock
method

write_package

Importance_0
Ruby latest stable (v2_5_5) - 0 notes - Class: Builder

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v1_9_3_392) is shown here.

write_package() private

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/rubygems/builder.rb, line 75
  def write_package
    file_name = File.basename @spec.cache_file
    open file_name, 'wb' do |gem_io|
      Gem::Package.open gem_io, 'w', @signer do |pkg|
        yaml = @spec.to_yaml
        pkg.metadata = yaml

        @spec.files.each do |file|
          next if File.directory?(file)
          next if file == file_name # Don't add gem onto itself

          stat = File.stat(file)
          mode = stat.mode & 0777
          size = stat.size

          pkg.add_file_simple file, mode, size do |tar_io|
            tar_io.write open(file, "rb") { |f| f.read }
          end
        end
      end
    end
  end
Register or log in to add new notes.