workbook 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -1,4 +1,5 @@
1
1
  untitled document.xls
2
2
  test.xls
3
3
  compare*.xls
4
- sharepoint_download_excel.*
4
+ sharepoint_download_excel.*
5
+ *.gem
@@ -109,26 +109,30 @@ 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
-
113
- r[ci] = Workbook::Cell.new cell.value
114
- r[ci].parse!
112
+ if cell
113
+ r[ci] = Workbook::Cell.new nil
114
+ else
115
+ r[ci] = Workbook::Cell.new cell.value
116
+
117
+ r[ci].parse!
115
118
 
116
- xls_format = cell.style_index
117
- col_width = nil
119
+ xls_format = cell.style_index
120
+ col_width = nil
118
121
 
119
- if ri == 0
120
- col_width = col_widths[ci]
121
- end
122
- f = template.create_or_find_format_by "style_index_#{cell.style_index}", col_width
123
- f[:width]= col_width
124
- f[:background_color] = "##{cell.fill_color}"
125
- f[:number_format] = ms_formatting_to_strftime(cell.number_format)
126
- f[:font_family] = cell.font_name
127
- f[:color] = "##{cell.font_color}"
122
+ if ri == 0
123
+ col_width = col_widths[ci]
124
+ end
125
+ f = template.create_or_find_format_by "style_index_#{cell.style_index}", col_width
126
+ f[:width]= col_width
127
+ f[:background_color] = "##{cell.fill_color}"
128
+ f[:number_format] = ms_formatting_to_strftime(cell.number_format)
129
+ f[:font_family] = cell.font_name
130
+ f[:color] = "##{cell.font_color}"
128
131
 
129
- f.add_raw xls_format
132
+ f.add_raw xls_format
130
133
 
131
- r[ci].format = f
134
+ r[ci].format = f
135
+ end
132
136
  end
133
137
  end
134
138
  end
@@ -11,6 +11,7 @@ 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
14
15
  end
15
16
  end
16
17
  end
data/workbook.gemspec CHANGED
@@ -5,8 +5,8 @@ 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.5'
9
- s.date = '2012-11-12'
8
+ s.version = '0.1.6'
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."
12
12
  s.authors = ["Maarten Brouwers"]
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 5
9
- version: 0.1.5
8
+ - 6
9
+ version: 0.1.6
10
10
  platform: ruby
11
11
  authors:
12
12
  - Maarten Brouwers
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2012-11-12 00:00:00 +01:00
17
+ date: 2012-12-11 00:00:00 +01:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency