Sha256: 6b13c47f20ec44cfba57c12f5dfaf54c8ef4cd2d1b9279a85435d93d281a9208

Contents?: true

Size: 1.01 KB

Versions: 10

Compression:

Stored size: 1.01 KB

Contents

# -*- coding: utf-8 -*-

class WriteFile
  ###############################################################################
  #
  # _prepend($data)
  #
  # General storage function
  #
  def prepend(*args)
    data =
      ruby_18 { args.join } ||
      ruby_19 { args.collect{ |arg| arg.dup.force_encoding('ASCII-8BIT') }.join }
    data = add_continue(data) if data.bytesize > @limit

    @datasize += data.bytesize
    @data      = data + @data

    data
  end

  ###############################################################################
  #
  # _append($data)
  #
  # General storage function
  #
  def append(*args)
    data =
      ruby_18 { args.join } ||
      ruby_19 { args.collect{ |arg| arg.dup.force_encoding('ASCII-8BIT') }.join }
    # Add CONTINUE records if necessary
    data = add_continue(data) if data.bytesize > @limit
    if @using_tmpfile
      @filehandle.write data
      @datasize += data.bytesize
    else
      @datasize += data.bytesize
      @data      = @data + data
    end

    data
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
writeexcel-0.6.9 lib/writeexcel/write_file.rb
writeexcel-0.6.8 lib/writeexcel/write_file.rb
writeexcel-0.6.7 lib/writeexcel/write_file.rb
writeexcel-0.6.6 lib/writeexcel/write_file.rb
writeexcel-0.6.5 lib/writeexcel/write_file.rb
writeexcel-0.6.4 lib/writeexcel/write_file.rb
writeexcel-0.6.3 lib/writeexcel/write_file.rb
writeexcel-0.6.2 lib/writeexcel/write_file.rb
writeexcel-0.6.1 lib/writeexcel/write_file.rb
writeexcel-0.6.0 lib/writeexcel/write_file.rb