workbook 0.1.6 → 0.1.6.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -109,7 +109,7 @@ module Workbook
109
109
  r = s.table.create_or_open_row_at(ri)
110
110
 
111
111
  row.each_with_index do |cell,ci|
112
- if cell
112
+ if cell.nil?
113
113
  r[ci] = Workbook::Cell.new nil
114
114
  else
115
115
  r[ci] = Workbook::Cell.new cell.value
Binary file
@@ -11,7 +11,18 @@ module Readers
11
11
  assert_equal(8,w.sheet.table.first[:b].format[:width].round)
12
12
  assert_equal(4,w.sheet.table.first[:a].format[:width].round)
13
13
  assert_equal(25,w.sheet.table.first[:c].format[:width].round)
14
- y w
15
14
  end
15
+ def test_open_native_xlsx
16
+ w = Workbook::Book.new
17
+ w.open 'test/artifacts/native_xlsx.xlsx'
18
+
19
+ assert_equal([:datum_gemeld, :adm_gereed, :callnr],w.sheet.table.header.to_symbols)
20
+
21
+ assert_equal("Callnr.",w.sheet.table[0][:callnr].value)
22
+ assert_equal("2475617.00",w.sheet.table[3][:callnr].value)
23
+ assert_equal("2012-12-03T09:48:59+00:00",w.sheet.table[6][:datum_gemeld].value.to_s)
24
+ assert_equal("2012-12-03T12:30:00+00:00",w.sheet.table[7][:datum_gemeld].value.to_s)
25
+ end
26
+
16
27
  end
17
28
  end
data/workbook.gemspec CHANGED
@@ -5,7 +5,7 @@ require "workbook"
5
5
  Gem::Specification.new do |s|
6
6
  s.name = 'workbook'
7
7
  s.rubyforge_project = 'workbook'
8
- s.version = '0.1.6'
8
+ s.version = '0.1.6.1'
9
9
  s.date = '2012-12-11'
10
10
  s.summary = "Workbook is a datastructure to contain books of tables (an anlogy used in e.g. Excel)"
11
11
  s.description = "Workbook contains workbooks, as in a table, contains rows, contains cells, reads/writes excels and csv's and tab separated, and offers basic diffing and sorting capabilities."
metadata CHANGED
@@ -6,7 +6,8 @@ version: !ruby/object:Gem::Version
6
6
  - 0
7
7
  - 1
8
8
  - 6
9
- version: 0.1.6
9
+ - 1
10
+ version: 0.1.6.1
10
11
  platform: ruby
11
12
  authors:
12
13
  - Maarten Brouwers
@@ -107,6 +108,7 @@ files:
107
108
  - test/artifacts/excel_different_types.txt
108
109
  - test/artifacts/excel_different_types.xls
109
110
  - test/artifacts/excel_different_types.xlsx
111
+ - test/artifacts/native_xlsx.xlsx
110
112
  - test/artifacts/simple_csv.csv
111
113
  - test/artifacts/simple_excel_csv.csv
112
114
  - test/artifacts/simple_sheet.xls
@@ -168,6 +170,7 @@ test_files:
168
170
  - test/artifacts/excel_different_types.txt
169
171
  - test/artifacts/excel_different_types.xls
170
172
  - test/artifacts/excel_different_types.xlsx
173
+ - test/artifacts/native_xlsx.xlsx
171
174
  - test/artifacts/simple_csv.csv
172
175
  - test/artifacts/simple_excel_csv.csv
173
176
  - test/artifacts/simple_sheet.xls