workbook 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +2 -1
- data/lib/workbook/readers/xlsx_reader.rb +20 -16
- data/test/test_readers_xlsx_reader.rb +1 -0
- data/workbook.gemspec +2 -2
- metadata +3 -3
data/.gitignore
CHANGED
|
@@ -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
|
-
|
|
114
|
-
|
|
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
|
-
|
|
117
|
-
|
|
119
|
+
xls_format = cell.style_index
|
|
120
|
+
col_width = nil
|
|
118
121
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
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
|
-
|
|
132
|
+
f.add_raw xls_format
|
|
130
133
|
|
|
131
|
-
|
|
134
|
+
r[ci].format = f
|
|
135
|
+
end
|
|
132
136
|
end
|
|
133
137
|
end
|
|
134
138
|
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.
|
|
9
|
-
s.date = '2012-11
|
|
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
|
-
-
|
|
9
|
-
version: 0.1.
|
|
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
|
|
17
|
+
date: 2012-12-11 00:00:00 +01:00
|
|
18
18
|
default_executable:
|
|
19
19
|
dependencies:
|
|
20
20
|
- !ruby/object:Gem::Dependency
|