workbook 0.4.13 → 0.4.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -1
- data/lib/workbook/modules/cell.rb +14 -0
- data/lib/workbook/version.rb +1 -1
- data/test/test_modules_cache.rb +14 -14
- data/test/test_modules_cell.rb +9 -2
- data/test/test_readers_xls_reader.rb +1 -1
- metadata +4 -46
- data/doc/RubyXL/Cell.html +0 -201
- data/doc/RubyXL/Workbook.html +0 -449
- data/doc/RubyXL.html +0 -128
- data/doc/Workbook/Book.html +0 -1852
- data/doc/Workbook/Cell.html +0 -1553
- data/doc/Workbook/Format.html +0 -1168
- data/doc/Workbook/Modules/RawObjectsStorage.html +0 -502
- data/doc/Workbook/Modules/TableDiffSort.html +0 -758
- data/doc/Workbook/Modules/TypeParser.html +0 -1063
- data/doc/Workbook/Modules.html +0 -117
- data/doc/Workbook/NilValue.html +0 -434
- data/doc/Workbook/Readers/CsvReader.html +0 -324
- data/doc/Workbook/Readers/OdsReader.html +0 -1066
- data/doc/Workbook/Readers/TxtReader.html +0 -236
- data/doc/Workbook/Readers/XlsReader.html +0 -378
- data/doc/Workbook/Readers/XlsShared.html +0 -188
- data/doc/Workbook/Readers/XlsxReader.html +0 -302
- data/doc/Workbook/Readers.html +0 -117
- data/doc/Workbook/Row.html +0 -2392
- data/doc/Workbook/Sheet.html +0 -875
- data/doc/Workbook/Table.html +0 -1732
- data/doc/Workbook/Template.html +0 -634
- data/doc/Workbook/Writers/CsvTableWriter.html +0 -200
- data/doc/Workbook/Writers/HtmlWriter.html +0 -407
- data/doc/Workbook/Writers/XlsWriter.html +0 -905
- data/doc/Workbook/Writers.html +0 -117
- data/doc/Workbook.html +0 -142
- data/doc/_index.html +0 -381
- data/doc/class_list.html +0 -53
- data/doc/css/common.css +0 -1
- data/doc/css/full_list.css +0 -57
- data/doc/css/style.css +0 -338
- data/doc/file.README.html +0 -245
- data/doc/file_list.html +0 -55
- data/doc/frames.html +0 -28
- data/doc/index.html +0 -245
- data/doc/js/app.js +0 -214
- data/doc/js/full_list.js +0 -173
- data/doc/js/jquery.js +0 -4
- data/doc/method_list.html +0 -1308
- data/doc/top-level-namespace.html +0 -112
- data/test/artifacts/floats_problem.xls +0 -0
@@ -1,236 +0,0 @@
|
|
1
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
-
<head>
|
5
|
-
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
|
-
<title>
|
7
|
-
Module: Workbook::Readers::TxtReader
|
8
|
-
|
9
|
-
— Documentation by YARD 0.8.5.2
|
10
|
-
|
11
|
-
</title>
|
12
|
-
|
13
|
-
<link rel="stylesheet" href="../../css/style.css" type="text/css" media="screen" charset="utf-8" />
|
14
|
-
|
15
|
-
<link rel="stylesheet" href="../../css/common.css" type="text/css" media="screen" charset="utf-8" />
|
16
|
-
|
17
|
-
<script type="text/javascript" charset="utf-8">
|
18
|
-
hasFrames = window.top.frames.main ? true : false;
|
19
|
-
relpath = '../../';
|
20
|
-
framesUrl = "../../frames.html#!" + escape(window.location.href);
|
21
|
-
</script>
|
22
|
-
|
23
|
-
|
24
|
-
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
25
|
-
|
26
|
-
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
27
|
-
|
28
|
-
|
29
|
-
</head>
|
30
|
-
<body>
|
31
|
-
<div id="header">
|
32
|
-
<div id="menu">
|
33
|
-
|
34
|
-
<a href="../../_index.html">Index (T)</a> »
|
35
|
-
<span class='title'><span class='object_link'><a href="../../Workbook.html" title="Workbook (module)">Workbook</a></span></span> » <span class='title'><span class='object_link'><a href="../Readers.html" title="Workbook::Readers (module)">Readers</a></span></span>
|
36
|
-
»
|
37
|
-
<span class="title">TxtReader</span>
|
38
|
-
|
39
|
-
|
40
|
-
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
41
|
-
</div>
|
42
|
-
|
43
|
-
<div id="search">
|
44
|
-
|
45
|
-
<a class="full_list_link" id="class_list_link"
|
46
|
-
href="../../class_list.html">
|
47
|
-
Class List
|
48
|
-
</a>
|
49
|
-
|
50
|
-
<a class="full_list_link" id="method_list_link"
|
51
|
-
href="../../method_list.html">
|
52
|
-
Method List
|
53
|
-
</a>
|
54
|
-
|
55
|
-
<a class="full_list_link" id="file_list_link"
|
56
|
-
href="../../file_list.html">
|
57
|
-
File List
|
58
|
-
</a>
|
59
|
-
|
60
|
-
</div>
|
61
|
-
<div class="clear"></div>
|
62
|
-
</div>
|
63
|
-
|
64
|
-
<iframe id="search_frame"></iframe>
|
65
|
-
|
66
|
-
<div id="content"><h1>Module: Workbook::Readers::TxtReader
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
</h1>
|
71
|
-
|
72
|
-
<dl class="box">
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
<dt class="r1">Included in:</dt>
|
81
|
-
<dd class="r1"><span class='object_link'><a href="../Book.html" title="Workbook::Book (class)">Book</a></span></dd>
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
<dt class="r2 last">Defined in:</dt>
|
86
|
-
<dd class="r2 last">lib/workbook/readers/txt_reader.rb</dd>
|
87
|
-
|
88
|
-
</dl>
|
89
|
-
<div class="clear"></div>
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
<h2>
|
100
|
-
Instance Method Summary
|
101
|
-
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
102
|
-
</h2>
|
103
|
-
|
104
|
-
<ul class="summary">
|
105
|
-
|
106
|
-
<li class="public ">
|
107
|
-
<span class="summary_signature">
|
108
|
-
|
109
|
-
<a href="#load_txt-instance_method" title="#load_txt (instance method)">- (Object) <strong>load_txt</strong>(text) </a>
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
</span>
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
124
|
-
|
125
|
-
</li>
|
126
|
-
|
127
|
-
|
128
|
-
<li class="public ">
|
129
|
-
<span class="summary_signature">
|
130
|
-
|
131
|
-
<a href="#parse_txt-instance_method" title="#parse_txt (instance method)">- (Object) <strong>parse_txt</strong>(csv_raw) </a>
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
</span>
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
146
|
-
|
147
|
-
</li>
|
148
|
-
|
149
|
-
|
150
|
-
</ul>
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
<div id="instance_method_details" class="method_details_list">
|
156
|
-
<h2>Instance Method Details</h2>
|
157
|
-
|
158
|
-
|
159
|
-
<div class="method_details first">
|
160
|
-
<h3 class="signature first" id="load_txt-instance_method">
|
161
|
-
|
162
|
-
- (<tt>Object</tt>) <strong>load_txt</strong>(text)
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
</h3><table class="source_code">
|
169
|
-
<tr>
|
170
|
-
<td>
|
171
|
-
<pre class="lines">
|
172
|
-
|
173
|
-
|
174
|
-
5
|
175
|
-
6
|
176
|
-
7
|
177
|
-
8</pre>
|
178
|
-
</td>
|
179
|
-
<td>
|
180
|
-
<pre class="code"><span class="info file"># File 'lib/workbook/readers/txt_reader.rb', line 5</span>
|
181
|
-
|
182
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_load_txt'>load_txt</span> <span class='id identifier rubyid_text'>text</span>
|
183
|
-
<span class='id identifier rubyid_csv'>csv</span> <span class='op'>=</span> <span class='id identifier rubyid_text'>text</span>
|
184
|
-
<span class='id identifier rubyid_parse_txt'>parse_txt</span> <span class='id identifier rubyid_csv'>csv</span>
|
185
|
-
<span class='kw'>end</span></pre>
|
186
|
-
</td>
|
187
|
-
</tr>
|
188
|
-
</table>
|
189
|
-
</div>
|
190
|
-
|
191
|
-
<div class="method_details ">
|
192
|
-
<h3 class="signature " id="parse_txt-instance_method">
|
193
|
-
|
194
|
-
- (<tt>Object</tt>) <strong>parse_txt</strong>(csv_raw)
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
</h3><table class="source_code">
|
201
|
-
<tr>
|
202
|
-
<td>
|
203
|
-
<pre class="lines">
|
204
|
-
|
205
|
-
|
206
|
-
10
|
207
|
-
11
|
208
|
-
12
|
209
|
-
13
|
210
|
-
14</pre>
|
211
|
-
</td>
|
212
|
-
<td>
|
213
|
-
<pre class="code"><span class="info file"># File 'lib/workbook/readers/txt_reader.rb', line 10</span>
|
214
|
-
|
215
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_parse_txt'>parse_txt</span> <span class='id identifier rubyid_csv_raw'>csv_raw</span>
|
216
|
-
<span class='id identifier rubyid_csv'>csv</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
217
|
-
<span class='id identifier rubyid_csv_raw'>csv_raw</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\n</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_l'>l</span><span class='op'>|</span> <span class='id identifier rubyid_csv'>csv</span> <span class='op'><<</span> <span class='id identifier rubyid_csv_lib'>csv_lib</span><span class='period'>.</span><span class='id identifier rubyid_parse_line'>parse_line</span><span class='lparen'>(</span><span class='id identifier rubyid_l'>l</span><span class='comma'>,</span><span class='lbrace'>{</span><span class='symbol'>:col_sep</span><span class='op'>=></span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\t</span><span class='tstring_end'>"</span></span><span class='rbrace'>}</span><span class='rparen'>)</span><span class='semicolon'>;</span><span class='kw'>nil</span><span class='rbrace'>}</span>
|
218
|
-
<span class='kw'>self</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='op'>=</span><span class='const'>Workbook</span><span class='op'>::</span><span class='const'>Sheet</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_csv'>csv</span><span class='comma'>,</span><span class='kw'>self</span><span class='comma'>,</span><span class='lbrace'>{</span><span class='symbol'>:parse_cells_on_batch_creation</span><span class='op'>=></span><span class='kw'>true</span><span class='comma'>,</span> <span class='symbol'>:cell_parse_options</span><span class='op'>=></span><span class='lbrace'>{</span><span class='symbol'>:detect_date</span><span class='op'>=></span><span class='kw'>true</span><span class='rbrace'>}</span><span class='rbrace'>}</span><span class='rparen'>)</span> <span class='kw'>unless</span> <span class='id identifier rubyid_sheet'>sheet</span><span class='period'>.</span><span class='id identifier rubyid_has_contents?'>has_contents?</span>
|
219
|
-
<span class='kw'>end</span></pre>
|
220
|
-
</td>
|
221
|
-
</tr>
|
222
|
-
</table>
|
223
|
-
</div>
|
224
|
-
|
225
|
-
</div>
|
226
|
-
|
227
|
-
</div>
|
228
|
-
|
229
|
-
<div id="footer">
|
230
|
-
Generated on Sun May 19 23:16:29 2013 by
|
231
|
-
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
232
|
-
0.8.5.2 (ruby-1.9.3).
|
233
|
-
</div>
|
234
|
-
|
235
|
-
</body>
|
236
|
-
</html>
|
@@ -1,378 +0,0 @@
|
|
1
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
-
<head>
|
5
|
-
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
|
-
<title>
|
7
|
-
Module: Workbook::Readers::XlsReader
|
8
|
-
|
9
|
-
— Documentation by YARD 0.8.5.2
|
10
|
-
|
11
|
-
</title>
|
12
|
-
|
13
|
-
<link rel="stylesheet" href="../../css/style.css" type="text/css" media="screen" charset="utf-8" />
|
14
|
-
|
15
|
-
<link rel="stylesheet" href="../../css/common.css" type="text/css" media="screen" charset="utf-8" />
|
16
|
-
|
17
|
-
<script type="text/javascript" charset="utf-8">
|
18
|
-
hasFrames = window.top.frames.main ? true : false;
|
19
|
-
relpath = '../../';
|
20
|
-
framesUrl = "../../frames.html#!" + escape(window.location.href);
|
21
|
-
</script>
|
22
|
-
|
23
|
-
|
24
|
-
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
25
|
-
|
26
|
-
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
27
|
-
|
28
|
-
|
29
|
-
</head>
|
30
|
-
<body>
|
31
|
-
<div id="header">
|
32
|
-
<div id="menu">
|
33
|
-
|
34
|
-
<a href="../../_index.html">Index (X)</a> »
|
35
|
-
<span class='title'><span class='object_link'><a href="../../Workbook.html" title="Workbook (module)">Workbook</a></span></span> » <span class='title'><span class='object_link'><a href="../Readers.html" title="Workbook::Readers (module)">Readers</a></span></span>
|
36
|
-
»
|
37
|
-
<span class="title">XlsReader</span>
|
38
|
-
|
39
|
-
|
40
|
-
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
41
|
-
</div>
|
42
|
-
|
43
|
-
<div id="search">
|
44
|
-
|
45
|
-
<a class="full_list_link" id="class_list_link"
|
46
|
-
href="../../class_list.html">
|
47
|
-
Class List
|
48
|
-
</a>
|
49
|
-
|
50
|
-
<a class="full_list_link" id="method_list_link"
|
51
|
-
href="../../method_list.html">
|
52
|
-
Method List
|
53
|
-
</a>
|
54
|
-
|
55
|
-
<a class="full_list_link" id="file_list_link"
|
56
|
-
href="../../file_list.html">
|
57
|
-
File List
|
58
|
-
</a>
|
59
|
-
|
60
|
-
</div>
|
61
|
-
<div class="clear"></div>
|
62
|
-
</div>
|
63
|
-
|
64
|
-
<iframe id="search_frame"></iframe>
|
65
|
-
|
66
|
-
<div id="content"><h1>Module: Workbook::Readers::XlsReader
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
</h1>
|
71
|
-
|
72
|
-
<dl class="box">
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
<dt class="r1">Included in:</dt>
|
81
|
-
<dd class="r1"><span class='object_link'><a href="../Book.html" title="Workbook::Book (class)">Book</a></span></dd>
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
<dt class="r2 last">Defined in:</dt>
|
86
|
-
<dd class="r2 last">lib/workbook/readers/xls_reader.rb</dd>
|
87
|
-
|
88
|
-
</dl>
|
89
|
-
<div class="clear"></div>
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
<h2>
|
100
|
-
Instance Method Summary
|
101
|
-
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
102
|
-
</h2>
|
103
|
-
|
104
|
-
<ul class="summary">
|
105
|
-
|
106
|
-
<li class="public ">
|
107
|
-
<span class="summary_signature">
|
108
|
-
|
109
|
-
<a href="#load_xls-instance_method" title="#load_xls (instance method)">- (Object) <strong>load_xls</strong>(file_obj) </a>
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
</span>
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
124
|
-
|
125
|
-
</li>
|
126
|
-
|
127
|
-
|
128
|
-
<li class="public ">
|
129
|
-
<span class="summary_signature">
|
130
|
-
|
131
|
-
<a href="#parse_xls-instance_method" title="#parse_xls (instance method)">- (Object) <strong>parse_xls</strong>(xls_spreadsheet = template.raws[Spreadsheet::Excel::Workbook], options = {}) </a>
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
</span>
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
146
|
-
|
147
|
-
</li>
|
148
|
-
|
149
|
-
|
150
|
-
</ul>
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
<div id="instance_method_details" class="method_details_list">
|
156
|
-
<h2>Instance Method Details</h2>
|
157
|
-
|
158
|
-
|
159
|
-
<div class="method_details first">
|
160
|
-
<h3 class="signature first" id="load_xls-instance_method">
|
161
|
-
|
162
|
-
- (<tt>Object</tt>) <strong>load_xls</strong>(file_obj)
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
</h3><table class="source_code">
|
169
|
-
<tr>
|
170
|
-
<td>
|
171
|
-
<pre class="lines">
|
172
|
-
|
173
|
-
|
174
|
-
8
|
175
|
-
9
|
176
|
-
10
|
177
|
-
11
|
178
|
-
12
|
179
|
-
13
|
180
|
-
14
|
181
|
-
15
|
182
|
-
16
|
183
|
-
17
|
184
|
-
18
|
185
|
-
19
|
186
|
-
20
|
187
|
-
21
|
188
|
-
22</pre>
|
189
|
-
</td>
|
190
|
-
<td>
|
191
|
-
<pre class="code"><span class="info file"># File 'lib/workbook/readers/xls_reader.rb', line 8</span>
|
192
|
-
|
193
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_load_xls'>load_xls</span> <span class='id identifier rubyid_file_obj'>file_obj</span>
|
194
|
-
<span class='kw'>begin</span>
|
195
|
-
<span class='id identifier rubyid_sp'>sp</span> <span class='op'>=</span> <span class='const'>Spreadsheet</span><span class='period'>.</span><span class='id identifier rubyid_open'>open</span><span class='lparen'>(</span><span class='id identifier rubyid_file_obj'>file_obj</span><span class='comma'>,</span> <span class='id identifier rubyid_mode'>mode</span><span class='op'>=</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>rb</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
196
|
-
<span class='id identifier rubyid_template'>template</span><span class='period'>.</span><span class='id identifier rubyid_add_raw'>add_raw</span> <span class='id identifier rubyid_sp'>sp</span>
|
197
|
-
<span class='id identifier rubyid_parse_xls'>parse_xls</span> <span class='id identifier rubyid_sp'>sp</span>
|
198
|
-
<span class='kw'>rescue</span> <span class='const'>Ole</span><span class='op'>::</span><span class='const'>Storage</span><span class='op'>::</span><span class='const'>FormatError</span> <span class='op'>=></span> <span class='id identifier rubyid_e'>e</span>
|
199
|
-
<span class='kw'>begin</span>
|
200
|
-
<span class='comment'># Assuming it is a tab separated txt inside .xls
|
201
|
-
</span> <span class='id identifier rubyid_open'>open</span><span class='lparen'>(</span><span class='id identifier rubyid_file_obj'>file_obj</span><span class='period'>.</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>txt</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
202
|
-
<span class='kw'>rescue</span>
|
203
|
-
<span class='id identifier rubyid_raise'>raise</span> <span class='id identifier rubyid_e'>e</span>
|
204
|
-
<span class='kw'>end</span>
|
205
|
-
<span class='kw'>end</span>
|
206
|
-
|
207
|
-
<span class='kw'>end</span></pre>
|
208
|
-
</td>
|
209
|
-
</tr>
|
210
|
-
</table>
|
211
|
-
</div>
|
212
|
-
|
213
|
-
<div class="method_details ">
|
214
|
-
<h3 class="signature " id="parse_xls-instance_method">
|
215
|
-
|
216
|
-
- (<tt>Object</tt>) <strong>parse_xls</strong>(xls_spreadsheet = template.raws[Spreadsheet::Excel::Workbook], options = {})
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
</h3><table class="source_code">
|
223
|
-
<tr>
|
224
|
-
<td>
|
225
|
-
<pre class="lines">
|
226
|
-
|
227
|
-
|
228
|
-
25
|
229
|
-
26
|
230
|
-
27
|
231
|
-
28
|
232
|
-
29
|
233
|
-
30
|
234
|
-
31
|
235
|
-
32
|
236
|
-
33
|
237
|
-
34
|
238
|
-
35
|
239
|
-
36
|
240
|
-
37
|
241
|
-
38
|
242
|
-
39
|
243
|
-
40
|
244
|
-
41
|
245
|
-
42
|
246
|
-
43
|
247
|
-
44
|
248
|
-
45
|
249
|
-
46
|
250
|
-
47
|
251
|
-
48
|
252
|
-
49
|
253
|
-
50
|
254
|
-
51
|
255
|
-
52
|
256
|
-
53
|
257
|
-
54
|
258
|
-
55
|
259
|
-
56
|
260
|
-
57
|
261
|
-
58
|
262
|
-
59
|
263
|
-
60
|
264
|
-
61
|
265
|
-
62
|
266
|
-
63
|
267
|
-
64
|
268
|
-
65
|
269
|
-
66
|
270
|
-
67
|
271
|
-
68
|
272
|
-
69
|
273
|
-
70
|
274
|
-
71
|
275
|
-
72
|
276
|
-
73
|
277
|
-
74
|
278
|
-
75
|
279
|
-
76
|
280
|
-
77
|
281
|
-
78
|
282
|
-
79
|
283
|
-
80
|
284
|
-
81
|
285
|
-
82
|
286
|
-
83
|
287
|
-
84
|
288
|
-
85
|
289
|
-
86
|
290
|
-
87
|
291
|
-
88
|
292
|
-
89</pre>
|
293
|
-
</td>
|
294
|
-
<td>
|
295
|
-
<pre class="code"><span class="info file"># File 'lib/workbook/readers/xls_reader.rb', line 25</span>
|
296
|
-
|
297
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_parse_xls'>parse_xls</span> <span class='id identifier rubyid_xls_spreadsheet'>xls_spreadsheet</span><span class='op'>=</span><span class='id identifier rubyid_template'>template</span><span class='period'>.</span><span class='id identifier rubyid_raws'>raws</span><span class='lbracket'>[</span><span class='const'>Spreadsheet</span><span class='op'>::</span><span class='const'>Excel</span><span class='op'>::</span><span class='const'>Workbook</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='op'>=</span><span class='lbrace'>{</span><span class='rbrace'>}</span>
|
298
|
-
<span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='symbol'>:additional_type_parsing</span><span class='op'>=></span><span class='kw'>true</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span> <span class='id identifier rubyid_options'>options</span>
|
299
|
-
<span class='id identifier rubyid_number_of_worksheets'>number_of_worksheets</span> <span class='op'>=</span> <span class='id identifier rubyid_xls_spreadsheet'>xls_spreadsheet</span><span class='period'>.</span><span class='id identifier rubyid_worksheets'>worksheets</span><span class='period'>.</span><span class='id identifier rubyid_count'>count</span>
|
300
|
-
<span class='lparen'>(</span><span class='int'>0</span><span class='op'>..</span><span class='id identifier rubyid_number_of_worksheets'>number_of_worksheets</span><span class='op'>-</span><span class='int'>1</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_si'>si</span><span class='op'>|</span>
|
301
|
-
<span class='id identifier rubyid_xls_sheet'>xls_sheet</span> <span class='op'>=</span> <span class='id identifier rubyid_xls_spreadsheet'>xls_spreadsheet</span><span class='period'>.</span><span class='id identifier rubyid_worksheets'>worksheets</span><span class='lbracket'>[</span><span class='id identifier rubyid_si'>si</span><span class='rbracket'>]</span>
|
302
|
-
<span class='kw'>begin</span>
|
303
|
-
<span class='id identifier rubyid_number_of_rows'>number_of_rows</span> <span class='op'>=</span> <span class='id identifier rubyid_xls_spreadsheet'>xls_spreadsheet</span><span class='period'>.</span><span class='id identifier rubyid_worksheets'>worksheets</span><span class='lbracket'>[</span><span class='id identifier rubyid_si'>si</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_count'>count</span>
|
304
|
-
<span class='id identifier rubyid_s'>s</span> <span class='op'>=</span> <span class='id identifier rubyid_create_or_open_sheet_at'>create_or_open_sheet_at</span><span class='lparen'>(</span><span class='id identifier rubyid_si'>si</span><span class='rparen'>)</span>
|
305
|
-
<span class='lparen'>(</span><span class='int'>0</span><span class='op'>..</span><span class='id identifier rubyid_number_of_rows'>number_of_rows</span><span class='op'>-</span><span class='int'>1</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_ri'>ri</span><span class='op'>|</span>
|
306
|
-
<span class='id identifier rubyid_xls_row'>xls_row</span> <span class='op'>=</span> <span class='id identifier rubyid_xls_sheet'>xls_sheet</span><span class='period'>.</span><span class='id identifier rubyid_row'>row</span><span class='lparen'>(</span><span class='id identifier rubyid_ri'>ri</span><span class='rparen'>)</span>
|
307
|
-
<span class='id identifier rubyid_r'>r</span> <span class='op'>=</span> <span class='id identifier rubyid_s'>s</span><span class='period'>.</span><span class='id identifier rubyid_table'>table</span><span class='period'>.</span><span class='id identifier rubyid_create_or_open_row_at'>create_or_open_row_at</span><span class='lparen'>(</span><span class='id identifier rubyid_ri'>ri</span><span class='rparen'>)</span>
|
308
|
-
<span class='id identifier rubyid_col_widths'>col_widths</span> <span class='op'>=</span> <span class='id identifier rubyid_xls_sheet'>xls_sheet</span><span class='period'>.</span><span class='id identifier rubyid_columns'>columns</span><span class='period'>.</span><span class='id identifier rubyid_collect'>collect</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_c'>c</span><span class='op'>|</span> <span class='id identifier rubyid_c'>c</span><span class='period'>.</span><span class='id identifier rubyid_width'>width</span> <span class='kw'>if</span> <span class='id identifier rubyid_c'>c</span><span class='rbrace'>}</span>
|
309
|
-
<span class='id identifier rubyid_xls_row'>xls_row</span><span class='period'>.</span><span class='id identifier rubyid_each_with_index'>each_with_index</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_xls_cell'>xls_cell</span><span class='comma'>,</span><span class='id identifier rubyid_ci'>ci</span><span class='op'>|</span>
|
310
|
-
|
311
|
-
<span class='kw'>begin</span>
|
312
|
-
<span class='id identifier rubyid_r'>r</span><span class='lbracket'>[</span><span class='id identifier rubyid_ci'>ci</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='const'>Workbook</span><span class='op'>::</span><span class='const'>Cell</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='id identifier rubyid_xls_cell'>xls_cell</span>
|
313
|
-
<span class='id identifier rubyid_r'>r</span><span class='lbracket'>[</span><span class='id identifier rubyid_ci'>ci</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_parse!'>parse!</span>
|
314
|
-
<span class='kw'>rescue</span> <span class='const'>ArgumentError</span> <span class='op'>=></span> <span class='id identifier rubyid_e'>e</span>
|
315
|
-
<span class='kw'>if</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span><span class='period'>.</span><span class='id identifier rubyid_match'>match</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>not a Spreadsheet::Formula</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
316
|
-
<span class='id identifier rubyid_v'>v</span> <span class='op'>=</span> <span class='id identifier rubyid_xls_cell'>xls_cell</span><span class='period'>.</span><span class='id identifier rubyid_value'>value</span>
|
317
|
-
<span class='kw'>if</span> <span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span> <span class='op'>==</span> <span class='const'>Float</span> <span class='kw'>and</span> <span class='id identifier rubyid_xls_row'>xls_row</span><span class='period'>.</span><span class='id identifier rubyid_format'>format</span><span class='lparen'>(</span><span class='id identifier rubyid_ci'>ci</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_date?'>date?</span>
|
318
|
-
<span class='id identifier rubyid_xls_row'>xls_row</span><span class='lbracket'>[</span><span class='id identifier rubyid_ci'>ci</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_v'>v</span>
|
319
|
-
<span class='id identifier rubyid_v'>v</span> <span class='op'>=</span> <span class='id identifier rubyid_xls_row'>xls_row</span><span class='period'>.</span><span class='id identifier rubyid_datetime'>datetime</span><span class='lparen'>(</span><span class='id identifier rubyid_ci'>ci</span><span class='rparen'>)</span>
|
320
|
-
<span class='kw'>end</span>
|
321
|
-
<span class='kw'>if</span> <span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span> <span class='const'>Spreadsheet</span><span class='op'>::</span><span class='const'>Excel</span><span class='op'>::</span><span class='const'>Error</span>
|
322
|
-
<span class='id identifier rubyid_v'>v</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>----!</span><span class='tstring_end'>"</span></span>
|
323
|
-
<span class='kw'>end</span>
|
324
|
-
<span class='id identifier rubyid_r'>r</span><span class='lbracket'>[</span><span class='id identifier rubyid_ci'>ci</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='const'>Workbook</span><span class='op'>::</span><span class='const'>Cell</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='id identifier rubyid_v'>v</span>
|
325
|
-
<span class='kw'>elsif</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span><span class='period'>.</span><span class='id identifier rubyid_match'>match</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>not a Spreadsheet::Link</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
326
|
-
<span class='id identifier rubyid_r'>r</span><span class='lbracket'>[</span><span class='id identifier rubyid_ci'>ci</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='const'>Workbook</span><span class='op'>::</span><span class='const'>Cell</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='id identifier rubyid_xls_cell'>xls_cell</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
|
327
|
-
<span class='kw'>elsif</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span><span class='period'>.</span><span class='id identifier rubyid_match'>match</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>not a Spreadsheet::Link</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
328
|
-
<span class='id identifier rubyid_r'>r</span><span class='lbracket'>[</span><span class='id identifier rubyid_ci'>ci</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='const'>Workbook</span><span class='op'>::</span><span class='const'>Cell</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='id identifier rubyid_xls_cell'>xls_cell</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
|
329
|
-
<span class='kw'>elsif</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span><span class='period'>.</span><span class='id identifier rubyid_match'>match</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>not a Spreadsheet::Excel::Error</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
330
|
-
<span class='id identifier rubyid_r'>r</span><span class='lbracket'>[</span><span class='id identifier rubyid_ci'>ci</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>._.</span><span class='tstring_end'>"</span></span>
|
331
|
-
<span class='kw'>else</span>
|
332
|
-
<span class='id identifier rubyid_r'>r</span><span class='lbracket'>[</span><span class='id identifier rubyid_ci'>ci</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>._.</span><span class='tstring_end'>"</span></span> <span class='comment'># raise e (we're going to be silent for now)
|
333
|
-
</span> <span class='kw'>end</span>
|
334
|
-
<span class='kw'>end</span>
|
335
|
-
<span class='id identifier rubyid_xls_format'>xls_format</span> <span class='op'>=</span> <span class='id identifier rubyid_xls_row'>xls_row</span><span class='period'>.</span><span class='id identifier rubyid_format'>format</span><span class='lparen'>(</span><span class='id identifier rubyid_ci'>ci</span><span class='rparen'>)</span>
|
336
|
-
<span class='id identifier rubyid_col_width'>col_width</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
337
|
-
|
338
|
-
<span class='kw'>if</span> <span class='id identifier rubyid_ri'>ri</span> <span class='op'>==</span> <span class='int'>0</span>
|
339
|
-
<span class='id identifier rubyid_col_width'>col_width</span> <span class='op'>=</span> <span class='id identifier rubyid_col_widths'>col_widths</span><span class='lbracket'>[</span><span class='id identifier rubyid_ci'>ci</span><span class='rbracket'>]</span>
|
340
|
-
<span class='kw'>end</span>
|
341
|
-
<span class='id identifier rubyid_f'>f</span> <span class='op'>=</span> <span class='id identifier rubyid_template'>template</span><span class='period'>.</span><span class='id identifier rubyid_create_or_find_format_by'>create_or_find_format_by</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>object_id_</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_xls_format'>xls_format</span><span class='period'>.</span><span class='id identifier rubyid_object_id'>object_id</span><span class='rbrace'>}</span><span class='tstring_end'>"</span></span><span class='comma'>,</span><span class='id identifier rubyid_col_width'>col_width</span>
|
342
|
-
<span class='id identifier rubyid_f'>f</span><span class='lbracket'>[</span><span class='symbol'>:width</span><span class='rbracket'>]</span><span class='op'>=</span> <span class='id identifier rubyid_col_width'>col_width</span>
|
343
|
-
<span class='id identifier rubyid_f'>f</span><span class='lbracket'>[</span><span class='symbol'>:rotation</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_xls_format'>xls_format</span><span class='period'>.</span><span class='id identifier rubyid_rotation'>rotation</span> <span class='kw'>if</span> <span class='id identifier rubyid_xls_format'>xls_format</span><span class='period'>.</span><span class='id identifier rubyid_rotation'>rotation</span>
|
344
|
-
<span class='id identifier rubyid_f'>f</span><span class='lbracket'>[</span><span class='symbol'>:background_color</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_xls_color_to_html_hex'>xls_color_to_html_hex</span><span class='lparen'>(</span><span class='id identifier rubyid_xls_format'>xls_format</span><span class='period'>.</span><span class='id identifier rubyid_pattern_fg_color'>pattern_fg_color</span><span class='rparen'>)</span>
|
345
|
-
<span class='id identifier rubyid_f'>f</span><span class='lbracket'>[</span><span class='symbol'>:number_format</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_ms_formatting_to_strftime'>ms_formatting_to_strftime</span><span class='lparen'>(</span><span class='id identifier rubyid_xls_format'>xls_format</span><span class='period'>.</span><span class='id identifier rubyid_number_format'>number_format</span><span class='rparen'>)</span>
|
346
|
-
<span class='id identifier rubyid_f'>f</span><span class='lbracket'>[</span><span class='symbol'>:text_direction</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_xls_format'>xls_format</span><span class='period'>.</span><span class='id identifier rubyid_text_direction'>text_direction</span>
|
347
|
-
<span class='id identifier rubyid_f'>f</span><span class='lbracket'>[</span><span class='symbol'>:font_family</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_xls_format'>xls_format</span><span class='period'>.</span><span class='id identifier rubyid_font'>font</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='rbrace'>}</span><span class='tstring_content'>, </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_xls_format'>xls_format</span><span class='period'>.</span><span class='id identifier rubyid_font'>font</span><span class='period'>.</span><span class='id identifier rubyid_family'>family</span><span class='rbrace'>}</span><span class='tstring_end'>"</span></span>
|
348
|
-
<span class='id identifier rubyid_f'>f</span><span class='lbracket'>[</span><span class='symbol'>:font_weight</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_xls_format'>xls_format</span><span class='period'>.</span><span class='id identifier rubyid_font'>font</span><span class='period'>.</span><span class='id identifier rubyid_weight'>weight</span>
|
349
|
-
<span class='id identifier rubyid_f'>f</span><span class='lbracket'>[</span><span class='symbol'>:color</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_xls_color_to_html_hex'>xls_color_to_html_hex</span><span class='lparen'>(</span><span class='id identifier rubyid_xls_format'>xls_format</span><span class='period'>.</span><span class='id identifier rubyid_font'>font</span><span class='period'>.</span><span class='id identifier rubyid_color'>color</span><span class='rparen'>)</span>
|
350
|
-
|
351
|
-
<span class='id identifier rubyid_f'>f</span><span class='period'>.</span><span class='id identifier rubyid_add_raw'>add_raw</span> <span class='id identifier rubyid_xls_format'>xls_format</span>
|
352
|
-
|
353
|
-
<span class='id identifier rubyid_r'>r</span><span class='lbracket'>[</span><span class='id identifier rubyid_ci'>ci</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_format'>format</span> <span class='op'>=</span> <span class='id identifier rubyid_f'>f</span>
|
354
|
-
<span class='kw'>end</span>
|
355
|
-
<span class='kw'>end</span>
|
356
|
-
<span class='kw'>rescue</span> <span class='const'>TypeError</span>
|
357
|
-
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>WARNING: Failed at worksheet (</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_si'>si</span><span class='rbrace'>}</span><span class='tstring_content'>)... ignored</span><span class='tstring_end'>"</span></span>
|
358
|
-
<span class='comment'>#ignore SpreadsheetGem can be buggy...
|
359
|
-
</span> <span class='kw'>end</span>
|
360
|
-
<span class='kw'>end</span>
|
361
|
-
<span class='kw'>end</span></pre>
|
362
|
-
</td>
|
363
|
-
</tr>
|
364
|
-
</table>
|
365
|
-
</div>
|
366
|
-
|
367
|
-
</div>
|
368
|
-
|
369
|
-
</div>
|
370
|
-
|
371
|
-
<div id="footer">
|
372
|
-
Generated on Sun May 19 23:16:29 2013 by
|
373
|
-
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
374
|
-
0.8.5.2 (ruby-1.9.3).
|
375
|
-
</div>
|
376
|
-
|
377
|
-
</body>
|
378
|
-
</html>
|