workbook 0.3.1 → 0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/.yardoc/checksums +21 -18
- data/.yardoc/object_types +0 -0
- data/.yardoc/objects/root.dat +0 -0
- data/Gemfile.lock +4 -4
- data/README.md +8 -5
- data/doc/RubyXL/Cell.html +18 -19
- data/doc/RubyXL/Workbook.html +116 -114
- data/doc/RubyXL.html +3 -3
- data/doc/Workbook/Book.html +513 -145
- data/doc/Workbook/Cell.html +181 -170
- data/doc/Workbook/Format.html +591 -77
- data/doc/Workbook/Modules/RawObjectsStorage.html +39 -45
- data/doc/Workbook/Modules/TableDiffSort.html +225 -87
- data/doc/Workbook/Modules/TypeParser.html +182 -131
- data/doc/Workbook/Modules.html +3 -3
- data/doc/Workbook/Readers/CsvReader.html +101 -39
- data/doc/Workbook/Readers/OdsReader.html +564 -0
- data/doc/Workbook/Readers/TxtReader.html +12 -14
- data/doc/Workbook/Readers/XlsReader.html +154 -138
- data/doc/Workbook/Readers/XlsShared.html +71 -72
- data/doc/Workbook/Readers/XlsxReader.html +89 -82
- data/doc/Workbook/Readers.html +6 -6
- data/doc/Workbook/Row.html +421 -206
- data/doc/Workbook/Sheet.html +379 -32
- data/doc/Workbook/Table.html +328 -90
- data/doc/Workbook/Template.html +55 -60
- data/doc/Workbook/Writers/CsvTableWriter.html +33 -8
- data/doc/Workbook/Writers/HtmlWriter.html +393 -0
- data/doc/Workbook/Writers/XlsWriter.html +132 -92
- data/doc/Workbook/Writers.html +5 -5
- data/doc/Workbook.html +16 -4
- data/doc/_index.html +45 -15
- data/doc/class_list.html +1 -1
- data/doc/css/style.css +10 -0
- data/doc/file.README.html +53 -48
- data/doc/frames.html +1 -1
- data/doc/index.html +53 -48
- data/doc/method_list.html +232 -56
- data/doc/top-level-namespace.html +3 -3
- data/lib/workbook/book.rb +27 -1
- data/lib/workbook/format.rb +46 -7
- data/lib/workbook/modules/type_parser.rb +8 -1
- data/lib/workbook/readers/ods_reader.rb +93 -0
- data/lib/workbook/row.rb +7 -0
- data/lib/workbook/sheet.rb +10 -0
- data/lib/workbook/version.rb +1 -1
- data/lib/workbook/writers/html_writer.rb +56 -0
- data/test/artifacts/book_with_tabs_and_colours.ods +0 -0
- data/test/artifacts/complex_types.ods +0 -0
- data/test/artifacts/excel_different_types.ods +0 -0
- data/test/artifacts/simple_sheet.ods +0 -0
- data/test/test_book.rb +6 -0
- data/test/test_format.rb +39 -0
- data/test/test_modules_type_parser.rb +2 -0
- data/test/test_readers_csv_reader.rb +44 -0
- data/test/test_readers_ods_reader.rb +51 -0
- data/test/test_readers_txt_reader.rb +53 -0
- data/test/test_row.rb +12 -0
- data/test/test_sheet.rb +12 -0
- data/test/test_writers_html_writer.rb +37 -0
- data/workbook.gemspec +2 -2
- metadata +21 -4
data/doc/Workbook/Template.html
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Class: Workbook::Template
|
8
8
|
|
9
|
-
— Documentation by YARD 0.8.
|
9
|
+
— Documentation by YARD 0.8.5.2
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -106,9 +106,9 @@
|
|
106
106
|
<h2>Overview</h2><div class="docstring">
|
107
107
|
<div class="discussion">
|
108
108
|
|
109
|
-
<p>Workbook::Template is a container for different Workbook::Format
|
110
|
-
|
111
|
-
|
109
|
+
<p>Workbook::Template is a container for different Workbook::Format's and the
|
110
|
+
storage of raw template data that isn't really supported by Workbook, but
|
111
|
+
should survive a typical read/write cyclus.</p>
|
112
112
|
|
113
113
|
|
114
114
|
</div>
|
@@ -296,19 +296,18 @@ but should survive a typical read/write cyclus.</p>
|
|
296
296
|
<pre class="lines">
|
297
297
|
|
298
298
|
|
299
|
-
9
|
300
299
|
10
|
301
300
|
11
|
302
|
-
12
|
301
|
+
12
|
302
|
+
13</pre>
|
303
303
|
</td>
|
304
304
|
<td>
|
305
|
-
<pre class="code"><span class="info file"># File 'lib/workbook/template.rb', line
|
305
|
+
<pre class="code"><span class="info file"># File 'lib/workbook/template.rb', line 10</span>
|
306
306
|
|
307
|
-
<span class='
|
308
|
-
<span class='
|
309
|
-
<span class='
|
310
|
-
<span class='
|
311
|
-
</pre>
|
307
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span>
|
308
|
+
<span class='ivar'>@formats</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
309
|
+
<span class='ivar'>@has_header</span> <span class='op'>=</span> <span class='kw'>true</span>
|
310
|
+
<span class='kw'>end</span></pre>
|
312
311
|
</td>
|
313
312
|
</tr>
|
314
313
|
</table>
|
@@ -367,25 +366,24 @@ but should survive a typical read/write cyclus.</p>
|
|
367
366
|
<pre class="lines">
|
368
367
|
|
369
368
|
|
370
|
-
21
|
371
369
|
22
|
372
370
|
23
|
373
371
|
24
|
374
372
|
25
|
375
373
|
26
|
376
|
-
27
|
374
|
+
27
|
375
|
+
28</pre>
|
377
376
|
</td>
|
378
377
|
<td>
|
379
|
-
<pre class="code"><span class="info file"># File 'lib/workbook/template.rb', line
|
380
|
-
|
381
|
-
<span class='
|
382
|
-
<span class='
|
383
|
-
<span class='
|
384
|
-
<span class='
|
385
|
-
<span class='
|
386
|
-
<span class='
|
387
|
-
<span class='
|
388
|
-
</pre>
|
378
|
+
<pre class="code"><span class="info file"># File 'lib/workbook/template.rb', line 22</span>
|
379
|
+
|
380
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_add_format'>add_format</span> <span class='id identifier rubyid_format'>format</span>
|
381
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_format'>format</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span> <span class='const'>Workbook</span><span class='op'>::</span><span class='const'>Format</span>
|
382
|
+
<span class='ivar'>@formats</span><span class='lbracket'>[</span><span class='id identifier rubyid_format'>format</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='rbracket'>]</span><span class='op'>=</span><span class='id identifier rubyid_format'>format</span>
|
383
|
+
<span class='kw'>else</span>
|
384
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>format should be a Workboot::Format</span><span class='tstring_end'>"</span></span>
|
385
|
+
<span class='kw'>end</span>
|
386
|
+
<span class='kw'>end</span></pre>
|
389
387
|
</td>
|
390
388
|
</tr>
|
391
389
|
</table>
|
@@ -423,8 +421,8 @@ but should survive a typical read/write cyclus.</p>
|
|
423
421
|
|
424
422
|
—
|
425
423
|
<div class='inline'>
|
426
|
-
<p>of the format (e.g. whatever you want, in diff names such as
|
427
|
-
‘
|
424
|
+
<p>of the format (e.g. whatever you want, in diff names such as ‘destroyed’,
|
425
|
+
‘updated’ and ‘created’ are being used)</p>
|
428
426
|
</div>
|
429
427
|
|
430
428
|
</li>
|
@@ -474,7 +472,6 @@ but should survive a typical read/write cyclus.</p>
|
|
474
472
|
<pre class="lines">
|
475
473
|
|
476
474
|
|
477
|
-
39
|
478
475
|
40
|
479
476
|
41
|
480
477
|
42
|
@@ -486,25 +483,25 @@ but should survive a typical read/write cyclus.</p>
|
|
486
483
|
48
|
487
484
|
49
|
488
485
|
50
|
489
|
-
51
|
486
|
+
51
|
487
|
+
52</pre>
|
490
488
|
</td>
|
491
489
|
<td>
|
492
|
-
<pre class="code"><span class="info file"># File 'lib/workbook/template.rb', line
|
493
|
-
|
494
|
-
<span class='
|
495
|
-
<span class='
|
496
|
-
<span class='
|
497
|
-
<span class='
|
498
|
-
<span class='
|
499
|
-
<span class='
|
500
|
-
<span class='
|
501
|
-
<span class='
|
502
|
-
<span class='
|
503
|
-
<span class='
|
504
|
-
<span class='
|
505
|
-
<span class='
|
506
|
-
<span class='
|
507
|
-
</pre>
|
490
|
+
<pre class="code"><span class="info file"># File 'lib/workbook/template.rb', line 40</span>
|
491
|
+
|
492
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_create_or_find_format_by'>create_or_find_format_by</span> <span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_variant'>variant</span><span class='op'>=</span><span class='symbol'>:default</span>
|
493
|
+
<span class='id identifier rubyid_fs'>fs</span> <span class='op'>=</span> <span class='ivar'>@formats</span><span class='lbracket'>[</span><span class='id identifier rubyid_name'>name</span><span class='rbracket'>]</span>
|
494
|
+
<span class='id identifier rubyid_fs'>fs</span> <span class='op'>=</span> <span class='ivar'>@formats</span><span class='lbracket'>[</span><span class='id identifier rubyid_name'>name</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span> <span class='kw'>if</span> <span class='id identifier rubyid_fs'>fs</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
495
|
+
<span class='id identifier rubyid_f'>f</span> <span class='op'>=</span> <span class='id identifier rubyid_fs'>fs</span><span class='lbracket'>[</span><span class='id identifier rubyid_variant'>variant</span><span class='rbracket'>]</span>
|
496
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_f'>f</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
497
|
+
<span class='id identifier rubyid_f'>f</span> <span class='op'>=</span> <span class='const'>Workbook</span><span class='op'>::</span><span class='const'>Format</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
498
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_variant'>variant</span> <span class='op'>!=</span> <span class='symbol'>:default</span> <span class='kw'>and</span> <span class='id identifier rubyid_fs'>fs</span><span class='lbracket'>[</span><span class='symbol'>:default</span><span class='rbracket'>]</span>
|
499
|
+
<span class='id identifier rubyid_f'>f</span> <span class='op'>=</span> <span class='id identifier rubyid_fs'>fs</span><span class='lbracket'>[</span><span class='symbol'>:default</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_clone'>clone</span>
|
500
|
+
<span class='kw'>end</span>
|
501
|
+
<span class='ivar'>@formats</span><span class='lbracket'>[</span><span class='id identifier rubyid_name'>name</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='id identifier rubyid_variant'>variant</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_f'>f</span>
|
502
|
+
<span class='kw'>end</span>
|
503
|
+
<span class='kw'>return</span> <span class='ivar'>@formats</span><span class='lbracket'>[</span><span class='id identifier rubyid_name'>name</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='id identifier rubyid_variant'>variant</span><span class='rbracket'>]</span>
|
504
|
+
<span class='kw'>end</span></pre>
|
508
505
|
</td>
|
509
506
|
</tr>
|
510
507
|
</table>
|
@@ -554,17 +551,16 @@ but should survive a typical read/write cyclus.</p>
|
|
554
551
|
<pre class="lines">
|
555
552
|
|
556
553
|
|
557
|
-
31
|
558
554
|
32
|
559
|
-
33
|
555
|
+
33
|
556
|
+
34</pre>
|
560
557
|
</td>
|
561
558
|
<td>
|
562
|
-
<pre class="code"><span class="info file"># File 'lib/workbook/template.rb', line
|
559
|
+
<pre class="code"><span class="info file"># File 'lib/workbook/template.rb', line 32</span>
|
563
560
|
|
564
|
-
<span class='
|
565
|
-
<span class='
|
566
|
-
<span class='
|
567
|
-
</pre>
|
561
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_formats'>formats</span>
|
562
|
+
<span class='ivar'>@formats</span>
|
563
|
+
<span class='kw'>end</span></pre>
|
568
564
|
</td>
|
569
565
|
</tr>
|
570
566
|
</table>
|
@@ -609,17 +605,16 @@ but should survive a typical read/write cyclus.</p>
|
|
609
605
|
<pre class="lines">
|
610
606
|
|
611
607
|
|
612
|
-
15
|
613
608
|
16
|
614
|
-
17
|
609
|
+
17
|
610
|
+
18</pre>
|
615
611
|
</td>
|
616
612
|
<td>
|
617
|
-
<pre class="code"><span class="info file"># File 'lib/workbook/template.rb', line
|
613
|
+
<pre class="code"><span class="info file"># File 'lib/workbook/template.rb', line 16</span>
|
618
614
|
|
619
|
-
<span class='
|
620
|
-
<span class='
|
621
|
-
<span class='
|
622
|
-
</pre>
|
615
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_has_header?'>has_header?</span>
|
616
|
+
<span class='ivar'>@has_header</span>
|
617
|
+
<span class='kw'>end</span></pre>
|
623
618
|
</td>
|
624
619
|
</tr>
|
625
620
|
</table>
|
@@ -630,9 +625,9 @@ but should survive a typical read/write cyclus.</p>
|
|
630
625
|
</div>
|
631
626
|
|
632
627
|
<div id="footer">
|
633
|
-
Generated on
|
628
|
+
Generated on Sun May 5 14:58:08 2013 by
|
634
629
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
635
|
-
0.8.
|
630
|
+
0.8.5.2 (ruby-1.9.3).
|
636
631
|
</div>
|
637
632
|
|
638
633
|
</body>
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Module: Workbook::Writers::CsvTableWriter
|
8
8
|
|
9
|
-
— Documentation by YARD 0.8.
|
9
|
+
— Documentation by YARD 0.8.5.2
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -149,13 +149,38 @@
|
|
149
149
|
<pre class="lines">
|
150
150
|
|
151
151
|
|
152
|
-
|
152
|
+
7
|
153
|
+
8
|
154
|
+
9
|
155
|
+
10
|
156
|
+
11
|
157
|
+
12
|
158
|
+
13
|
159
|
+
14
|
160
|
+
15
|
161
|
+
16
|
162
|
+
17
|
163
|
+
18
|
164
|
+
19
|
165
|
+
20</pre>
|
153
166
|
</td>
|
154
167
|
<td>
|
155
|
-
<pre class="code"><span class="info file"># File 'lib/workbook/writers/csv_table_writer.rb', line
|
156
|
-
|
157
|
-
<span class='
|
158
|
-
</
|
168
|
+
<pre class="code"><span class="info file"># File 'lib/workbook/writers/csv_table_writer.rb', line 7</span>
|
169
|
+
|
170
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_to_csv'>to_csv</span> <span class='id identifier rubyid_options'>options</span><span class='op'>=</span><span class='lbrace'>{</span><span class='rbrace'>}</span>
|
171
|
+
<span class='id identifier rubyid_csv'>csv</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_end'>"</span></span>
|
172
|
+
<span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</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>
|
173
|
+
<span class='kw'>self</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_r'>r</span><span class='comma'>,</span> <span class='id identifier rubyid_ri'>ri</span><span class='op'>|</span>
|
174
|
+
<span class='id identifier rubyid_line'>line</span><span class='op'>=</span><span class='kw'>nil</span>
|
175
|
+
<span class='kw'>begin</span>
|
176
|
+
<span class='id identifier rubyid_line'>line</span> <span class='op'>=</span> <span class='const'>CSV</span><span class='op'>::</span><span class='id identifier rubyid_generate_line'>generate_line</span><span class='lparen'>(</span><span class='id identifier rubyid_r'>r</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_value'>value</span> <span class='kw'>if</span> <span class='id identifier rubyid_c'>c</span><span class='rbrace'>}</span><span class='comma'>,</span><span class='lbrace'>{</span><span class='symbol'>:row_sep</span><span class='op'>=></span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_end'>"</span></span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
177
|
+
<span class='kw'>rescue</span> <span class='const'>TypeError</span>
|
178
|
+
<span class='id identifier rubyid_line'>line</span> <span class='op'>=</span> <span class='const'>CSV</span><span class='op'>::</span><span class='id identifier rubyid_generate_line'>generate_line</span><span class='lparen'>(</span><span class='id identifier rubyid_r'>r</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_value'>value</span> <span class='kw'>if</span> <span class='id identifier rubyid_c'>c</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
179
|
+
<span class='kw'>end</span>
|
180
|
+
<span class='id identifier rubyid_csv'>csv</span> <span class='op'>+=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_line'>line</span><span class='rbrace'>}</span><span class='tstring_content'>\n</span><span class='tstring_end'>"</span></span>
|
181
|
+
<span class='kw'>end</span>
|
182
|
+
<span class='id identifier rubyid_csv'>csv</span>
|
183
|
+
<span class='kw'>end</span></pre>
|
159
184
|
</td>
|
160
185
|
</tr>
|
161
186
|
</table>
|
@@ -166,9 +191,9 @@
|
|
166
191
|
</div>
|
167
192
|
|
168
193
|
<div id="footer">
|
169
|
-
Generated on
|
194
|
+
Generated on Sun May 5 14:58:06 2013 by
|
170
195
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
171
|
-
0.8.
|
196
|
+
0.8.5.2 (ruby-1.9.3).
|
172
197
|
</div>
|
173
198
|
|
174
199
|
</body>
|