Sha256: 319eb570eeefc67db4e56615b4c597ef4ed3dbe9b65c33989b0b351091982c5d
Contents?: true
Size: 798 Bytes
Versions: 27
Compression:
Stored size: 798 Bytes
Contents
# encoding: UTF-8 require 'csv' module Wice class Spreadsheet #:nodoc: attr_reader :tempfile # CSV in 1.9.1 is a version of FasterCSV if RUBY_VERSION == '1.9.1' || RUBY_VERSION == '1.9.2' def initialize(name, field_separator) #:nodoc: @tempfile = Tempfile.new(name) @csv = CSV.new(@tempfile, :col_sep => field_separator) end def << (row) #:nodoc: @csv << row end else def initialize(name, field_separator) #:nodoc: @tempfile = Tempfile.new(name) @field_separator = field_separator end def << (row) #:nodoc: CSV::Writer.generate(@tempfile, @field_separator) do |csv| csv << row.map(&:to_s) end end end end end
Version data entries
27 entries across 27 versions & 4 rubygems