csv_decision 0.0.6 → 0.0.7

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.
Files changed (81) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +9 -1
  3. data/README.md +112 -93
  4. data/benchmarks/rufus_decision.rb +9 -1
  5. data/csv_decision.gemspec +6 -6
  6. data/doc/CSVDecision.html +54 -90
  7. data/doc/CSVDecision/CellValidationError.html +1 -1
  8. data/doc/CSVDecision/Columns.html +104 -45
  9. data/doc/CSVDecision/Columns/Dictionary.html +40 -24
  10. data/doc/CSVDecision/Columns/Entry.html +209 -22
  11. data/doc/CSVDecision/Constant.html +9 -50
  12. data/doc/CSVDecision/Data.html +182 -47
  13. data/doc/CSVDecision/Decide.html +97 -93
  14. data/doc/CSVDecision/Decision.html +105 -294
  15. data/doc/CSVDecision/Error.html +1 -1
  16. data/doc/CSVDecision/FileError.html +1 -1
  17. data/doc/CSVDecision/Function.html +18 -7
  18. data/doc/CSVDecision/Guard.html +245 -0
  19. data/doc/CSVDecision/Header.html +58 -50
  20. data/doc/CSVDecision/Input.html +20 -12
  21. data/doc/CSVDecision/Load.html +80 -14
  22. data/doc/CSVDecision/Matchers.html +237 -279
  23. data/doc/CSVDecision/Matchers/Constant.html +280 -13
  24. data/doc/CSVDecision/Matchers/Function.html +188 -19
  25. data/doc/CSVDecision/Matchers/Guard.html +568 -0
  26. data/doc/CSVDecision/Matchers/Matcher.html +200 -14
  27. data/doc/CSVDecision/Matchers/Numeric.html +165 -13
  28. data/doc/CSVDecision/Matchers/Pattern.html +56 -163
  29. data/doc/CSVDecision/Matchers/Range.html +48 -37
  30. data/doc/CSVDecision/Matchers/Symbol.html +161 -16
  31. data/doc/CSVDecision/Numeric.html +4 -4
  32. data/doc/CSVDecision/Options.html +53 -55
  33. data/doc/CSVDecision/Parse.html +23 -13
  34. data/doc/CSVDecision/ScanRow.html +461 -73
  35. data/doc/CSVDecision/Symbol.html +4 -4
  36. data/doc/CSVDecision/Table.html +185 -79
  37. data/doc/_index.html +15 -28
  38. data/doc/class_list.html +1 -1
  39. data/doc/file.README.html +105 -82
  40. data/doc/index.html +105 -82
  41. data/doc/method_list.html +137 -113
  42. data/doc/top-level-namespace.html +1 -1
  43. data/lib/csv_decision.rb +2 -5
  44. data/lib/csv_decision/columns.rb +14 -5
  45. data/lib/csv_decision/data.rb +24 -6
  46. data/lib/csv_decision/decide.rb +18 -20
  47. data/lib/csv_decision/decision.rb +106 -42
  48. data/lib/csv_decision/header.rb +44 -23
  49. data/lib/csv_decision/input.rb +4 -2
  50. data/lib/csv_decision/load.rb +7 -3
  51. data/lib/csv_decision/matchers.rb +49 -41
  52. data/lib/csv_decision/matchers/constant.rb +62 -4
  53. data/lib/csv_decision/matchers/function.rb +33 -2
  54. data/lib/csv_decision/matchers/guard.rb +143 -0
  55. data/lib/csv_decision/matchers/numeric.rb +34 -3
  56. data/lib/csv_decision/matchers/pattern.rb +11 -4
  57. data/lib/csv_decision/matchers/range.rb +34 -26
  58. data/lib/csv_decision/matchers/symbol.rb +71 -5
  59. data/lib/csv_decision/options.rb +31 -20
  60. data/lib/csv_decision/parse.rb +28 -9
  61. data/lib/csv_decision/scan_row.rb +79 -13
  62. data/lib/csv_decision/table.rb +34 -23
  63. data/spec/csv_decision/columns_spec.rb +32 -7
  64. data/spec/csv_decision/constant_spec.rb +2 -26
  65. data/spec/csv_decision/decision_spec.rb +0 -9
  66. data/spec/csv_decision/examples_spec.rb +33 -16
  67. data/spec/csv_decision/matchers/function_spec.rb +1 -1
  68. data/spec/csv_decision/matchers/guard_spec.rb +153 -0
  69. data/spec/csv_decision/matchers/numeric_spec.rb +1 -1
  70. data/spec/csv_decision/matchers/pattern_spec.rb +2 -2
  71. data/spec/csv_decision/matchers/range_spec.rb +2 -2
  72. data/spec/csv_decision/matchers/symbol_spec.rb +1 -1
  73. data/spec/csv_decision/options_spec.rb +3 -3
  74. data/spec/csv_decision/table_spec.rb +96 -12
  75. data/spec/data/valid/benchmark_regexp.csv +10 -0
  76. data/spec/data/valid/regular_expressions.csv +11 -0
  77. metadata +14 -9
  78. data/lib/csv_decision/constant.rb +0 -54
  79. data/lib/csv_decision/function.rb +0 -32
  80. data/lib/csv_decision/numeric.rb +0 -38
  81. data/lib/csv_decision/symbol.rb +0 -73
@@ -133,7 +133,7 @@
133
133
  </div>
134
134
 
135
135
  <div id="footer">
136
- Generated on Tue Dec 26 21:20:20 2017 by
136
+ Generated on Sat Dec 30 13:04:05 2017 by
137
137
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
138
138
  0.9.12 (ruby-2.3.0).
139
139
  </div>
@@ -62,7 +62,7 @@
62
62
  <div id="content"><h1>Class: CSVDecision::Columns
63
63
 
64
64
 
65
-
65
+ <span class="private note title">Private</span>
66
66
  </h1>
67
67
  <div class="box_info">
68
68
 
@@ -101,7 +101,11 @@
101
101
 
102
102
  <h2>Overview</h2><div class="docstring">
103
103
  <div class="discussion">
104
-
104
+ <p class="note private">
105
+ <strong>This class is part of a private API.</strong>
106
+ You should avoid using this class if possible, as it may be removed or be changed in the future.
107
+ </p>
108
+
105
109
  <p>Dictionary of all this table&#39;s columns - inputs, outputs etc.</p>
106
110
 
107
111
 
@@ -130,7 +134,7 @@
130
134
  <li class="public ">
131
135
  <span class="summary_signature">
132
136
 
133
- <a href="#dictionary-instance_method" title="#dictionary (instance method)">#<strong>dictionary</strong> &#x21d2; Object </a>
137
+ <a href="#dictionary-instance_method" title="#dictionary (instance method)">#<strong>dictionary</strong> &#x21d2; Columns::Dictionary </a>
134
138
 
135
139
 
136
140
 
@@ -146,7 +150,7 @@
146
150
 
147
151
 
148
152
 
149
-
153
+ <span class="private note title">private</span>
150
154
 
151
155
 
152
156
  <span class="summary_desc"><div class='inline'>
@@ -185,7 +189,7 @@
185
189
 
186
190
 
187
191
 
188
-
192
+ <span class="private note title">private</span>
189
193
 
190
194
 
191
195
  <span class="summary_desc"><div class='inline'>
@@ -198,7 +202,7 @@
198
202
  <li class="public ">
199
203
  <span class="summary_signature">
200
204
 
201
- <a href="#ins-instance_method" title="#ins (instance method)">#<strong>ins</strong> &#x21d2; Object </a>
205
+ <a href="#ins-instance_method" title="#ins (instance method)">#<strong>ins</strong> &#x21d2; Hash{Index=&gt;Entry} </a>
202
206
 
203
207
 
204
208
 
@@ -209,11 +213,11 @@
209
213
 
210
214
 
211
215
 
212
-
216
+ <span class="private note title">private</span>
213
217
 
214
218
 
215
219
  <span class="summary_desc"><div class='inline'>
216
- <p>Input columns.</p>
220
+ <p>Input columns hash keyed by column index.</p>
217
221
  </div></span>
218
222
 
219
223
  </li>
@@ -222,7 +226,7 @@
222
226
  <li class="public ">
223
227
  <span class="summary_signature">
224
228
 
225
- <a href="#outs-instance_method" title="#outs (instance method)">#<strong>outs</strong> &#x21d2; Object </a>
229
+ <a href="#outs-instance_method" title="#outs (instance method)">#<strong>outs</strong> &#x21d2; Hash{Index=&gt;Entry} </a>
226
230
 
227
231
 
228
232
 
@@ -233,11 +237,11 @@
233
237
 
234
238
 
235
239
 
236
-
240
+ <span class="private note title">private</span>
237
241
 
238
242
 
239
243
  <span class="summary_desc"><div class='inline'>
240
- <p>Output columns.</p>
244
+ <p>Output columns hash keyed by column index.</p>
241
245
  </div></span>
242
246
 
243
247
  </li>
@@ -260,7 +264,11 @@
260
264
 
261
265
  </h3><div class="docstring">
262
266
  <div class="discussion">
263
-
267
+ <p class="note private">
268
+ <strong>This method is part of a private API.</strong>
269
+ You should avoid using this method if possible, as it may be removed or be changed in the future.
270
+ </p>
271
+
264
272
  <p>Returns a new instance of Columns</p>
265
273
 
266
274
 
@@ -295,19 +303,19 @@
295
303
  <pre class="lines">
296
304
 
297
305
 
298
- 65
299
- 66
300
- 67
301
- 68
302
- 69
303
- 70
304
- 71
305
- 72
306
- 73
307
- 74</pre>
306
+ 74
307
+ 75
308
+ 76
309
+ 77
310
+ 78
311
+ 79
312
+ 80
313
+ 81
314
+ 82
315
+ 83</pre>
308
316
  </td>
309
317
  <td>
310
- <pre class="code"><span class="info file"># File 'lib/csv_decision/columns.rb', line 65</span>
318
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/columns.rb', line 74</span>
311
319
 
312
320
  <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_table'>table</span><span class='rparen'>)</span>
313
321
  <span class='comment'># If a column does not have a valid header cell, then it&#39;s empty of data.
@@ -334,7 +342,7 @@
334
342
  <div class="method_details first">
335
343
  <h3 class="signature first" id="dictionary-instance_method">
336
344
 
337
- #<strong>dictionary</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
345
+ #<strong>dictionary</strong> &#x21d2; <tt><span class='object_link'><a href="Columns/Dictionary.html" title="CSVDecision::Columns::Dictionary (class)">Columns::Dictionary</a></span></tt> <span class="extras">(readonly)</span>
338
346
 
339
347
 
340
348
 
@@ -342,14 +350,31 @@
342
350
 
343
351
  </h3><div class="docstring">
344
352
  <div class="discussion">
345
-
346
- <p>Dictionary of all data columns</p>
353
+ <p class="note private">
354
+ <strong>This method is part of a private API.</strong>
355
+ You should avoid using this method if possible, as it may be removed or be changed in the future.
356
+ </p>
357
+
358
+ <p>Dictionary of all data columns.</p>
347
359
 
348
360
 
349
361
  </div>
350
362
  </div>
351
363
  <div class="tags">
352
364
 
365
+ <p class="tag_title">Returns:</p>
366
+ <ul class="return">
367
+
368
+ <li>
369
+
370
+
371
+ <span class='type'>(<tt><span class='object_link'><a href="Columns/Dictionary.html" title="CSVDecision::Columns::Dictionary (class)">Columns::Dictionary</a></span></tt>)</span>
372
+
373
+
374
+
375
+ </li>
376
+
377
+ </ul>
353
378
 
354
379
  </div><table class="source_code">
355
380
  <tr>
@@ -357,12 +382,12 @@
357
382
  <pre class="lines">
358
383
 
359
384
 
360
- 42
361
- 43
362
- 44</pre>
385
+ 49
386
+ 50
387
+ 51</pre>
363
388
  </td>
364
389
  <td>
365
- <pre class="code"><span class="info file"># File 'lib/csv_decision/columns.rb', line 42</span>
390
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/columns.rb', line 49</span>
366
391
 
367
392
  <span class='kw'>def</span> <span class='id identifier rubyid_dictionary'>dictionary</span>
368
393
  <span class='ivar'>@dictionary</span>
@@ -382,7 +407,7 @@
382
407
  <div class="method_details first">
383
408
  <h3 class="signature first" id="ins-instance_method">
384
409
 
385
- #<strong>ins</strong> &#x21d2; <tt>Object</tt>
410
+ #<strong>ins</strong> &#x21d2; <tt>Hash{Index=&gt;<span class='object_link'><a href="Columns/Entry.html" title="CSVDecision::Columns::Entry (class)">Entry</a></span>}</tt>
386
411
 
387
412
 
388
413
 
@@ -390,14 +415,31 @@
390
415
 
391
416
  </h3><div class="docstring">
392
417
  <div class="discussion">
393
-
394
- <p>Input columns</p>
418
+ <p class="note private">
419
+ <strong>This method is part of a private API.</strong>
420
+ You should avoid using this method if possible, as it may be removed or be changed in the future.
421
+ </p>
422
+
423
+ <p>Input columns hash keyed by column index.</p>
395
424
 
396
425
 
397
426
  </div>
398
427
  </div>
399
428
  <div class="tags">
400
429
 
430
+ <p class="tag_title">Returns:</p>
431
+ <ul class="return">
432
+
433
+ <li>
434
+
435
+
436
+ <span class='type'>(<tt>Hash{Index=&gt;<span class='object_link'><a href="Columns/Entry.html" title="CSVDecision::Columns::Entry (class)">Entry</a></span>}</tt>)</span>
437
+
438
+
439
+
440
+ </li>
441
+
442
+ </ul>
401
443
 
402
444
  </div><table class="source_code">
403
445
  <tr>
@@ -405,12 +447,12 @@
405
447
  <pre class="lines">
406
448
 
407
449
 
408
- 45
409
- 46
410
- 47</pre>
450
+ 53
451
+ 54
452
+ 55</pre>
411
453
  </td>
412
454
  <td>
413
- <pre class="code"><span class="info file"># File 'lib/csv_decision/columns.rb', line 45</span>
455
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/columns.rb', line 53</span>
414
456
 
415
457
  <span class='kw'>def</span> <span class='id identifier rubyid_ins'>ins</span>
416
458
  <span class='ivar'>@dictionary</span><span class='period'>.</span><span class='id identifier rubyid_ins'>ins</span>
@@ -423,7 +465,7 @@
423
465
  <div class="method_details ">
424
466
  <h3 class="signature " id="outs-instance_method">
425
467
 
426
- #<strong>outs</strong> &#x21d2; <tt>Object</tt>
468
+ #<strong>outs</strong> &#x21d2; <tt>Hash{Index=&gt;<span class='object_link'><a href="Columns/Entry.html" title="CSVDecision::Columns::Entry (class)">Entry</a></span>}</tt>
427
469
 
428
470
 
429
471
 
@@ -431,14 +473,31 @@
431
473
 
432
474
  </h3><div class="docstring">
433
475
  <div class="discussion">
434
-
435
- <p>Output columns</p>
476
+ <p class="note private">
477
+ <strong>This method is part of a private API.</strong>
478
+ You should avoid using this method if possible, as it may be removed or be changed in the future.
479
+ </p>
480
+
481
+ <p>Output columns hash keyed by column index.</p>
436
482
 
437
483
 
438
484
  </div>
439
485
  </div>
440
486
  <div class="tags">
441
487
 
488
+ <p class="tag_title">Returns:</p>
489
+ <ul class="return">
490
+
491
+ <li>
492
+
493
+
494
+ <span class='type'>(<tt>Hash{Index=&gt;<span class='object_link'><a href="Columns/Entry.html" title="CSVDecision::Columns::Entry (class)">Entry</a></span>}</tt>)</span>
495
+
496
+
497
+
498
+ </li>
499
+
500
+ </ul>
442
501
 
443
502
  </div><table class="source_code">
444
503
  <tr>
@@ -446,12 +505,12 @@
446
505
  <pre class="lines">
447
506
 
448
507
 
449
- 50
450
- 51
451
- 52</pre>
508
+ 59
509
+ 60
510
+ 61</pre>
452
511
  </td>
453
512
  <td>
454
- <pre class="code"><span class="info file"># File 'lib/csv_decision/columns.rb', line 50</span>
513
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/columns.rb', line 59</span>
455
514
 
456
515
  <span class='kw'>def</span> <span class='id identifier rubyid_outs'>outs</span>
457
516
  <span class='ivar'>@dictionary</span><span class='period'>.</span><span class='id identifier rubyid_outs'>outs</span>
@@ -466,7 +525,7 @@
466
525
  </div>
467
526
 
468
527
  <div id="footer">
469
- Generated on Tue Dec 26 21:20:20 2017 by
528
+ Generated on Sat Dec 30 13:04:05 2017 by
470
529
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
471
530
  0.9.12 (ruby-2.3.0).
472
531
  </div>
@@ -62,7 +62,7 @@
62
62
  <div id="content"><h1>Class: CSVDecision::Columns::Dictionary
63
63
 
64
64
 
65
-
65
+ <span class="private note title">Private</span>
66
66
  </h1>
67
67
  <div class="box_info">
68
68
 
@@ -101,7 +101,11 @@
101
101
 
102
102
  <h2>Overview</h2><div class="docstring">
103
103
  <div class="discussion">
104
-
104
+ <p class="note private">
105
+ <strong>This class is part of a private API.</strong>
106
+ You should avoid using this class if possible, as it may be removed or be changed in the future.
107
+ </p>
108
+
105
109
  <p>Dictionary of all data columns. The key of each hash is the header
106
110
  cell&#39;s array column index. Note that input and output columns can be
107
111
  interspersed and need not have unique names.</p>
@@ -136,7 +140,7 @@ interspersed and need not have unique names.</p>
136
140
 
137
141
 
138
142
 
139
-
143
+ <span class="private note title">private</span>
140
144
 
141
145
 
142
146
  <span class="summary_desc"><div class='inline'>
@@ -163,7 +167,7 @@ interspersed and need not have unique names.</p>
163
167
 
164
168
 
165
169
 
166
-
170
+ <span class="private note title">private</span>
167
171
 
168
172
 
169
173
  <span class="summary_desc"><div class='inline'>
@@ -202,7 +206,7 @@ interspersed and need not have unique names.</p>
202
206
 
203
207
 
204
208
 
205
-
209
+ <span class="private note title">private</span>
206
210
 
207
211
 
208
212
  <span class="summary_desc"><div class='inline'>
@@ -230,7 +234,11 @@ interspersed and need not have unique names.</p>
230
234
 
231
235
  </h3><div class="docstring">
232
236
  <div class="discussion">
233
-
237
+ <p class="note private">
238
+ <strong>This method is part of a private API.</strong>
239
+ You should avoid using this method if possible, as it may be removed or be changed in the future.
240
+ </p>
241
+
234
242
  <p>TODO: Input columns with a default value (planned feature) attr_accessor
235
243
  :defaults</p>
236
244
 
@@ -246,15 +254,15 @@ interspersed and need not have unique names.</p>
246
254
  <pre class="lines">
247
255
 
248
256
 
249
- 33
250
- 34
251
- 35
252
- 36
253
- 37
254
- 38</pre>
257
+ 39
258
+ 40
259
+ 41
260
+ 42
261
+ 43
262
+ 44</pre>
255
263
  </td>
256
264
  <td>
257
- <pre class="code"><span class="info file"># File 'lib/csv_decision/columns.rb', line 33</span>
265
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/columns.rb', line 39</span>
258
266
 
259
267
  <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span>
260
268
  <span class='ivar'>@ins</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
@@ -285,7 +293,11 @@ interspersed and need not have unique names.</p>
285
293
 
286
294
  </h3><div class="docstring">
287
295
  <div class="discussion">
288
-
296
+ <p class="note private">
297
+ <strong>This method is part of a private API.</strong>
298
+ You should avoid using this method if possible, as it may be removed or be changed in the future.
299
+ </p>
300
+
289
301
  <p>Input columns.</p>
290
302
 
291
303
 
@@ -318,12 +330,12 @@ interspersed and need not have unique names.</p>
318
330
  <pre class="lines">
319
331
 
320
332
 
321
- 21
322
- 22
323
- 23</pre>
333
+ 27
334
+ 28
335
+ 29</pre>
324
336
  </td>
325
337
  <td>
326
- <pre class="code"><span class="info file"># File 'lib/csv_decision/columns.rb', line 21</span>
338
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/columns.rb', line 27</span>
327
339
 
328
340
  <span class='kw'>def</span> <span class='id identifier rubyid_ins'>ins</span>
329
341
  <span class='ivar'>@ins</span>
@@ -346,7 +358,11 @@ interspersed and need not have unique names.</p>
346
358
 
347
359
  </h3><div class="docstring">
348
360
  <div class="discussion">
349
-
361
+ <p class="note private">
362
+ <strong>This method is part of a private API.</strong>
363
+ You should avoid using this method if possible, as it may be removed or be changed in the future.
364
+ </p>
365
+
350
366
  <p>Output columns.</p>
351
367
 
352
368
 
@@ -379,12 +395,12 @@ interspersed and need not have unique names.</p>
379
395
  <pre class="lines">
380
396
 
381
397
 
382
- 25
383
- 26
384
- 27</pre>
398
+ 31
399
+ 32
400
+ 33</pre>
385
401
  </td>
386
402
  <td>
387
- <pre class="code"><span class="info file"># File 'lib/csv_decision/columns.rb', line 25</span>
403
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/columns.rb', line 31</span>
388
404
 
389
405
  <span class='kw'>def</span> <span class='id identifier rubyid_outs'>outs</span>
390
406
  <span class='ivar'>@outs</span>
@@ -400,7 +416,7 @@ interspersed and need not have unique names.</p>
400
416
  </div>
401
417
 
402
418
  <div id="footer">
403
- Generated on Tue Dec 26 21:20:20 2017 by
419
+ Generated on Sat Dec 30 13:04:05 2017 by
404
420
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
405
421
  0.9.12 (ruby-2.3.0).
406
422
  </div>