add_file (Gem::Package::TarWriter)

    # File lib/rubygems/package.rb, line 243
        def add_file(name, mode)
          raise BlockNeeded unless block_given?
          raise ClosedIO if @closed
          raise NonSeekableIO unless @io.respond_to? :pos=
          name, prefix = split_name(name)
          init_pos = @io.pos
          @io.write "\0" * 512 # placeholder for the header
          yield RestrictedStream.new(@io)
          #FIXME: what if an exception is raised in the block?
          #FIXME: what if an exception is raised in the block?
          size = @io.pos - init_pos - 512
          remainder = (512 - (size % 512)) % 512
          @io.write("\0" * remainder)
          final_pos = @io.pos
          @io.pos = init_pos
          header = TarHeader.new(:name => name, :mode => mode,
                                 :size => size, :prefix => prefix).to_s
          @io.write header
          @io.pos = final_pos
        end