lib/roo/excel.rb in roo-0.2.4 vs lib/roo/excel.rb in roo-0.2.5

- old
+ new

@@ -14,11 +14,11 @@ if DateTime.now < Date.new(2007,6,10) return ["Tabelle1", "Name of Sheet 2", "Sheet3"] else #worksheet = @workbook.worksheet(0) # p @workbook - p @workbook.worksheet(0) + # p @workbook.worksheet(0) ["aaa","bbb","ccc"] end end # sets the working sheet (1,2,3,..) @@ -78,11 +78,23 @@ } end def row(rownumber) worksheet = @workbook.worksheet(@default_sheet) - row = worksheet.row(rownumber) - row + therow = worksheet.row(rownumber-1) + result = [] + therow.each {|cell| + case cell.type + when :numeric then result << cell.to_i + when :text then result << cell.to_s('latin1') + when :date then result << cell.date + else + return result << cell.to_s + end + + #result << cell.value + } + return result end def first_column fr, lr, fc, lc = get_firsts_lasts fc