Sha256: 22cb21bbf4e8aac478fa50a3cae895aaa5b156c55512cfd8be90aa99e23917e2

Contents?: true

Size: 1.78 KB

Versions: 7

Compression:

Stored size: 1.78 KB

Contents

require 'roo/generic_spreadsheet'
require 'roo/csv'

class CsvExtended < Csv
  # def read_cells(sheet=nil)
  #   sheet = @default_sheet unless sheet
  #   @cell_type = {} unless @cell_type
  #   @cell = {} unless @cell
  #   @first_row[sheet] = 1
  #   @last_row[sheet] = 0
  #   @first_column[sheet] = 1
  #   @last_column[sheet] = 1
  #   rownum = 1
  #   CSV.foreach(@filename) do |row|
  #     row.each_with_index do |elem,i|
  #       @cell[[rownum,i+1]] = cell_postprocessing rownum,i+1, elem
  #       @cell_type[[rownum,i+1]] = celltype_class @cell[[rownum,i+1]]
  #       if i+1 > @last_column[sheet]
  #         @last_column[sheet] += 1
  #       end
  #     end
  #     rownum += 1
  #     @last_row[sheet] += 1
  #   end
  #   @cells_read[sheet] = true
  #   #-- adjust @first_row if neccessary
  #   loop do
  #     if !row(@first_row[sheet]).any? and @first_row[sheet] < @last_row[sheet]
  #       @first_row[sheet] += 1
  #     else
  #       break
  #     end
  #   end
  #   #-- adjust @last_row if neccessary
  #   loop do
  #     if !row(@last_row[sheet]).any? and @last_row[sheet] and
  #         @last_row[sheet] > @first_row[sheet]
  #       @last_row[sheet] -= 1
  #     else
  #       break
  #     end
  #   end
  #   #-- adjust @first_column if neccessary
  #   loop do
  #     if !column(@first_column[sheet]).any? and
  #         @first_column[sheet] and
  #         @first_column[sheet] < @last_column[sheet]
  #       @first_column[sheet] += 1
  #     else
  #       break
  #     end
  #   end
  #   #-- adjust @last_column if neccessary
  #   loop do
  #     if !column(@last_column[sheet]).any? and
  #         @last_column[sheet] and
  #         @last_column[sheet] > @first_column[sheet]
  #       @last_column[sheet] -= 1
  #     else
  #       break
  #     end
  #   end
  # end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
simple-spreadsheet-0.1.1 lib/simple-spreadsheet/classes/csv_extended.rb
simple-spreadsheet-0.1.0 lib/simple-spreadsheet/classes/csv_extended.rb
simple-spreadsheet-0.0.6 lib/simple-spreadsheet/classes/csv_extended.rb
simple-spreadsheet-0.0.5.4 lib/simple-spreadsheet/classes/csv_extended.rb
simple-spreadsheet-0.0.5.3 lib/simple-spreadsheet/classes/csv_extended.rb
simple-spreadsheet-0.0.5.2 lib/simple-spreadsheet/classes/csv_extended.rb
simple-spreadsheet-0.0.5.1 lib/simple_spreadsheet/classes/csv_extended.rb