csv_decision2 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (134) hide show
  1. checksums.yaml +7 -0
  2. data/.codeclimate.yml +3 -0
  3. data/.coveralls.yml +2 -0
  4. data/.gitignore +14 -0
  5. data/.rspec +2 -0
  6. data/.rubocop.yml +30 -0
  7. data/.travis.yml +6 -0
  8. data/CHANGELOG.md +85 -0
  9. data/Dockerfile +6 -0
  10. data/Gemfile +7 -0
  11. data/LICENSE +21 -0
  12. data/README.md +356 -0
  13. data/benchmarks/rufus_decision.rb +158 -0
  14. data/csv_decision2.gemspec +38 -0
  15. data/doc/CSVDecision/CellValidationError.html +143 -0
  16. data/doc/CSVDecision/Columns/Default.html +589 -0
  17. data/doc/CSVDecision/Columns/Dictionary.html +801 -0
  18. data/doc/CSVDecision/Columns/Entry.html +508 -0
  19. data/doc/CSVDecision/Columns.html +1259 -0
  20. data/doc/CSVDecision/Constant.html +254 -0
  21. data/doc/CSVDecision/Data.html +479 -0
  22. data/doc/CSVDecision/Decide.html +302 -0
  23. data/doc/CSVDecision/Decision.html +1011 -0
  24. data/doc/CSVDecision/Defaults.html +291 -0
  25. data/doc/CSVDecision/Dictionary/Entry.html +1147 -0
  26. data/doc/CSVDecision/Dictionary.html +426 -0
  27. data/doc/CSVDecision/Error.html +139 -0
  28. data/doc/CSVDecision/FileError.html +143 -0
  29. data/doc/CSVDecision/Function.html +240 -0
  30. data/doc/CSVDecision/Guard.html +245 -0
  31. data/doc/CSVDecision/Header.html +647 -0
  32. data/doc/CSVDecision/Index.html +741 -0
  33. data/doc/CSVDecision/Input.html +404 -0
  34. data/doc/CSVDecision/Load.html +296 -0
  35. data/doc/CSVDecision/Matchers/Constant.html +484 -0
  36. data/doc/CSVDecision/Matchers/Function.html +511 -0
  37. data/doc/CSVDecision/Matchers/Guard.html +503 -0
  38. data/doc/CSVDecision/Matchers/Matcher.html +507 -0
  39. data/doc/CSVDecision/Matchers/Numeric.html +415 -0
  40. data/doc/CSVDecision/Matchers/Pattern.html +491 -0
  41. data/doc/CSVDecision/Matchers/Proc.html +704 -0
  42. data/doc/CSVDecision/Matchers/Range.html +379 -0
  43. data/doc/CSVDecision/Matchers/Symbol.html +426 -0
  44. data/doc/CSVDecision/Matchers.html +1567 -0
  45. data/doc/CSVDecision/Numeric.html +259 -0
  46. data/doc/CSVDecision/Options.html +443 -0
  47. data/doc/CSVDecision/Parse.html +282 -0
  48. data/doc/CSVDecision/Paths.html +742 -0
  49. data/doc/CSVDecision/Result.html +1200 -0
  50. data/doc/CSVDecision/Scan/InputHashes.html +369 -0
  51. data/doc/CSVDecision/Scan.html +313 -0
  52. data/doc/CSVDecision/ScanRow.html +866 -0
  53. data/doc/CSVDecision/Symbol.html +256 -0
  54. data/doc/CSVDecision/Table.html +1470 -0
  55. data/doc/CSVDecision/TableValidationError.html +143 -0
  56. data/doc/CSVDecision/Validate.html +422 -0
  57. data/doc/CSVDecision.html +621 -0
  58. data/doc/_index.html +471 -0
  59. data/doc/class_list.html +51 -0
  60. data/doc/css/common.css +1 -0
  61. data/doc/css/full_list.css +58 -0
  62. data/doc/css/style.css +499 -0
  63. data/doc/file.README.html +421 -0
  64. data/doc/file_list.html +56 -0
  65. data/doc/frames.html +17 -0
  66. data/doc/index.html +421 -0
  67. data/doc/js/app.js +248 -0
  68. data/doc/js/full_list.js +216 -0
  69. data/doc/js/jquery.js +4 -0
  70. data/doc/method_list.html +1163 -0
  71. data/doc/top-level-namespace.html +110 -0
  72. data/docker-compose.yml +13 -0
  73. data/lib/csv_decision/columns.rb +192 -0
  74. data/lib/csv_decision/data.rb +92 -0
  75. data/lib/csv_decision/decision.rb +196 -0
  76. data/lib/csv_decision/defaults.rb +47 -0
  77. data/lib/csv_decision/dictionary.rb +180 -0
  78. data/lib/csv_decision/header.rb +83 -0
  79. data/lib/csv_decision/index.rb +107 -0
  80. data/lib/csv_decision/input.rb +121 -0
  81. data/lib/csv_decision/load.rb +36 -0
  82. data/lib/csv_decision/matchers/constant.rb +74 -0
  83. data/lib/csv_decision/matchers/function.rb +56 -0
  84. data/lib/csv_decision/matchers/guard.rb +142 -0
  85. data/lib/csv_decision/matchers/numeric.rb +44 -0
  86. data/lib/csv_decision/matchers/pattern.rb +94 -0
  87. data/lib/csv_decision/matchers/range.rb +95 -0
  88. data/lib/csv_decision/matchers/symbol.rb +149 -0
  89. data/lib/csv_decision/matchers.rb +220 -0
  90. data/lib/csv_decision/options.rb +124 -0
  91. data/lib/csv_decision/parse.rb +165 -0
  92. data/lib/csv_decision/paths.rb +78 -0
  93. data/lib/csv_decision/result.rb +204 -0
  94. data/lib/csv_decision/scan.rb +117 -0
  95. data/lib/csv_decision/scan_row.rb +142 -0
  96. data/lib/csv_decision/table.rb +101 -0
  97. data/lib/csv_decision/validate.rb +85 -0
  98. data/lib/csv_decision.rb +45 -0
  99. data/spec/csv_decision/columns_spec.rb +251 -0
  100. data/spec/csv_decision/constant_spec.rb +36 -0
  101. data/spec/csv_decision/data_spec.rb +50 -0
  102. data/spec/csv_decision/decision_spec.rb +19 -0
  103. data/spec/csv_decision/examples_spec.rb +242 -0
  104. data/spec/csv_decision/index_spec.rb +58 -0
  105. data/spec/csv_decision/input_spec.rb +55 -0
  106. data/spec/csv_decision/load_spec.rb +28 -0
  107. data/spec/csv_decision/matchers/function_spec.rb +82 -0
  108. data/spec/csv_decision/matchers/guard_spec.rb +170 -0
  109. data/spec/csv_decision/matchers/numeric_spec.rb +47 -0
  110. data/spec/csv_decision/matchers/pattern_spec.rb +183 -0
  111. data/spec/csv_decision/matchers/range_spec.rb +70 -0
  112. data/spec/csv_decision/matchers/symbol_spec.rb +67 -0
  113. data/spec/csv_decision/options_spec.rb +94 -0
  114. data/spec/csv_decision/parse_spec.rb +44 -0
  115. data/spec/csv_decision/table_spec.rb +683 -0
  116. data/spec/csv_decision_spec.rb +7 -0
  117. data/spec/data/invalid/empty.csv +0 -0
  118. data/spec/data/invalid/invalid_header1.csv +4 -0
  119. data/spec/data/invalid/invalid_header2.csv +4 -0
  120. data/spec/data/invalid/invalid_header3.csv +4 -0
  121. data/spec/data/invalid/invalid_header4.csv +4 -0
  122. data/spec/data/valid/benchmark_regexp.csv +10 -0
  123. data/spec/data/valid/index_example.csv +13 -0
  124. data/spec/data/valid/multi_column_index.csv +10 -0
  125. data/spec/data/valid/multi_column_index2.csv +12 -0
  126. data/spec/data/valid/options_in_file1.csv +5 -0
  127. data/spec/data/valid/options_in_file2.csv +5 -0
  128. data/spec/data/valid/options_in_file3.csv +13 -0
  129. data/spec/data/valid/regular_expressions.csv +11 -0
  130. data/spec/data/valid/simple_constants.csv +5 -0
  131. data/spec/data/valid/simple_example.csv +10 -0
  132. data/spec/data/valid/valid.csv +4 -0
  133. data/spec/spec_helper.rb +106 -0
  134. metadata +352 -0
@@ -0,0 +1,507 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>
7
+ Class: CSVDecision::Matchers::Matcher
8
+
9
+ &mdash; Documentation by YARD 0.9.12
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ pathId = "CSVDecision::Matchers::Matcher";
19
+ relpath = '../../';
20
+ </script>
21
+
22
+
23
+ <script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
24
+
25
+ <script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
26
+
27
+
28
+ </head>
29
+ <body>
30
+ <div class="nav_wrap">
31
+ <iframe id="nav" src="../../class_list.html?1"></iframe>
32
+ <div id="resizer"></div>
33
+ </div>
34
+
35
+ <div id="main" tabindex="-1">
36
+ <div id="header">
37
+ <div id="menu">
38
+
39
+ <a href="../../_index.html">Index (M)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../../CSVDecision.html" title="CSVDecision (module)">CSVDecision</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Matchers.html" title="CSVDecision::Matchers (class)">Matchers</a></span></span>
41
+ &raquo;
42
+ <span class="title">Matcher</span>
43
+
44
+ </div>
45
+
46
+ <div id="search">
47
+
48
+ <a class="full_list_link" id="class_list_link"
49
+ href="../../class_list.html">
50
+
51
+ <svg width="24" height="24">
52
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
+ </svg>
56
+ </a>
57
+
58
+ </div>
59
+ <div class="clear"></div>
60
+ </div>
61
+
62
+ <div id="content"><h1>Class: CSVDecision::Matchers::Matcher
63
+
64
+
65
+ <span class="private note title">Private</span>
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+ <dl>
70
+ <dt>Inherits:</dt>
71
+ <dd>
72
+ <span class="inheritName">Object</span>
73
+
74
+ <ul class="fullTree">
75
+ <li>Object</li>
76
+
77
+ <li class="next">CSVDecision::Matchers::Matcher</li>
78
+
79
+ </ul>
80
+ <a href="#" class="inheritanceTree">show all</a>
81
+
82
+ </dd>
83
+ </dl>
84
+
85
+
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+ <dl>
96
+ <dt>Defined in:</dt>
97
+ <dd>lib/csv_decision/matchers.rb</dd>
98
+ </dl>
99
+
100
+ </div>
101
+
102
+ <h2>Overview</h2><div class="docstring">
103
+ <div class="discussion">
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
+
109
+ <p>Subclass and override <span class='object_link'><a href="#matches%3F-instance_method" title="CSVDecision::Matchers::Matcher#matches? (method)">#matches?</a></span> to implement a custom Matcher class.</p>
110
+
111
+
112
+ </div>
113
+ </div>
114
+ <div class="tags">
115
+
116
+
117
+ </div><div id="subclasses">
118
+ <h2>Direct Known Subclasses</h2>
119
+ <p class="children"><span class='object_link'><a href="Constant.html" title="CSVDecision::Matchers::Constant (class)">Constant</a></span>, <span class='object_link'><a href="Function.html" title="CSVDecision::Matchers::Function (class)">Function</a></span>, <span class='object_link'><a href="Guard.html" title="CSVDecision::Matchers::Guard (class)">Guard</a></span>, <span class='object_link'><a href="Numeric.html" title="CSVDecision::Matchers::Numeric (class)">Numeric</a></span>, <span class='object_link'><a href="Pattern.html" title="CSVDecision::Matchers::Pattern (class)">Pattern</a></span>, <span class='object_link'><a href="Range.html" title="CSVDecision::Matchers::Range (class)">Range</a></span>, <span class='object_link'><a href="Symbol.html" title="CSVDecision::Matchers::Symbol (class)">Symbol</a></span></p>
120
+ </div>
121
+
122
+
123
+
124
+
125
+
126
+
127
+
128
+
129
+ <h2>
130
+ Instance Method Summary
131
+ <small><a href="#" class="summary_toggle">collapse</a></small>
132
+ </h2>
133
+
134
+ <ul class="summary">
135
+
136
+ <li class="public ">
137
+ <span class="summary_signature">
138
+
139
+ <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(_options = nil) &#x21d2; Matcher </a>
140
+
141
+
142
+
143
+ </span>
144
+
145
+
146
+ <span class="note title constructor">constructor</span>
147
+
148
+
149
+
150
+
151
+
152
+ <span class="private note title">private</span>
153
+
154
+
155
+ <span class="summary_desc"><div class='inline'>
156
+ <p>A new instance of Matcher.</p>
157
+ </div></span>
158
+
159
+ </li>
160
+
161
+
162
+ <li class="public ">
163
+ <span class="summary_signature">
164
+
165
+ <a href="#ins%3F-instance_method" title="#ins? (instance method)">#<strong>ins?</strong> &#x21d2; Boolean </a>
166
+
167
+
168
+
169
+ </span>
170
+
171
+
172
+
173
+
174
+
175
+
176
+ <span class="private note title">private</span>
177
+
178
+
179
+ <span class="summary_desc"><div class='inline'>
180
+ <p>Does this matcher apply to output cells?.</p>
181
+ </div></span>
182
+
183
+ </li>
184
+
185
+
186
+ <li class="public ">
187
+ <span class="summary_signature">
188
+
189
+ <a href="#matches%3F-instance_method" title="#matches? (instance method)">#<strong>matches?</strong>(cell) &#x21d2; false, CSVDecision::Proc </a>
190
+
191
+
192
+
193
+ </span>
194
+
195
+
196
+
197
+
198
+
199
+
200
+ <span class="private note title">private</span>
201
+
202
+
203
+ <span class="summary_desc"><div class='inline'>
204
+ <p>Determine if the input cell string is recognised by this Matcher.</p>
205
+ </div></span>
206
+
207
+ </li>
208
+
209
+
210
+ <li class="public ">
211
+ <span class="summary_signature">
212
+
213
+ <a href="#outs%3F-instance_method" title="#outs? (instance method)">#<strong>outs?</strong> &#x21d2; Boolean </a>
214
+
215
+
216
+
217
+ </span>
218
+
219
+
220
+
221
+
222
+
223
+
224
+ <span class="private note title">private</span>
225
+
226
+
227
+ <span class="summary_desc"><div class='inline'>
228
+ <p>Does this matcher apply to output cells?.</p>
229
+ </div></span>
230
+
231
+ </li>
232
+
233
+
234
+ </ul>
235
+
236
+
237
+ <div id="constructor_details" class="method_details_list">
238
+ <h2>Constructor Details</h2>
239
+
240
+ <div class="method_details first">
241
+ <h3 class="signature first" id="initialize-instance_method">
242
+
243
+ #<strong>initialize</strong>(_options = nil) &#x21d2; <tt><span class='object_link'><a href="" title="CSVDecision::Matchers::Matcher (class)">Matcher</a></span></tt>
244
+
245
+
246
+
247
+
248
+
249
+ </h3><div class="docstring">
250
+ <div class="discussion">
251
+ <p class="note private">
252
+ <strong>This method is part of a private API.</strong>
253
+ You should avoid using this method if possible, as it may be removed or be changed in the future.
254
+ </p>
255
+
256
+ <p>Returns a new instance of Matcher</p>
257
+
258
+
259
+ </div>
260
+ </div>
261
+ <div class="tags">
262
+
263
+
264
+ </div><table class="source_code">
265
+ <tr>
266
+ <td>
267
+ <pre class="lines">
268
+
269
+
270
+ 193</pre>
271
+ </td>
272
+ <td>
273
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 193</span>
274
+
275
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid__options'>_options</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
276
+ </td>
277
+ </tr>
278
+ </table>
279
+ </div>
280
+
281
+ </div>
282
+
283
+
284
+ <div id="instance_method_details" class="method_details_list">
285
+ <h2>Instance Method Details</h2>
286
+
287
+
288
+ <div class="method_details first">
289
+ <h3 class="signature first" id="ins?-instance_method">
290
+
291
+ #<strong>ins?</strong> &#x21d2; <tt>Boolean</tt>
292
+
293
+
294
+
295
+
296
+
297
+ </h3><div class="docstring">
298
+ <div class="discussion">
299
+ <p class="note private">
300
+ <strong>This method is part of a private API.</strong>
301
+ You should avoid using this method if possible, as it may be removed or be changed in the future.
302
+ </p>
303
+
304
+ <p>Does this matcher apply to output cells?</p>
305
+
306
+
307
+ </div>
308
+ </div>
309
+ <div class="tags">
310
+
311
+ <p class="tag_title">Returns:</p>
312
+ <ul class="return">
313
+
314
+ <li>
315
+
316
+
317
+ <span class='type'>(<tt>Boolean</tt>)</span>
318
+
319
+
320
+
321
+ &mdash;
322
+ <div class='inline'>
323
+ <p>Return true if this matcher applies to input cells, false otherwise.</p>
324
+ </div>
325
+
326
+ </li>
327
+
328
+ </ul>
329
+
330
+ </div><table class="source_code">
331
+ <tr>
332
+ <td>
333
+ <pre class="lines">
334
+
335
+
336
+ 215
337
+ 216
338
+ 217</pre>
339
+ </td>
340
+ <td>
341
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 215</span>
342
+
343
+ <span class='kw'>def</span> <span class='id identifier rubyid_ins?'>ins?</span>
344
+ <span class='kw'>true</span>
345
+ <span class='kw'>end</span></pre>
346
+ </td>
347
+ </tr>
348
+ </table>
349
+ </div>
350
+
351
+ <div class="method_details ">
352
+ <h3 class="signature " id="matches?-instance_method">
353
+
354
+ #<strong>matches?</strong>(cell) &#x21d2; <tt>false</tt>, <tt>CSVDecision::Proc</tt>
355
+
356
+
357
+
358
+
359
+
360
+ </h3><div class="docstring">
361
+ <div class="discussion">
362
+ <p class="note private">
363
+ <strong>This method is part of a private API.</strong>
364
+ You should avoid using this method if possible, as it may be removed or be changed in the future.
365
+ </p>
366
+
367
+ <p>Determine if the input cell string is recognised by this Matcher.</p>
368
+
369
+
370
+ </div>
371
+ </div>
372
+ <div class="tags">
373
+ <p class="tag_title">Parameters:</p>
374
+ <ul class="param">
375
+
376
+ <li>
377
+
378
+ <span class='name'>cell</span>
379
+
380
+
381
+ <span class='type'>(<tt>String</tt>)</span>
382
+
383
+
384
+
385
+ &mdash;
386
+ <div class='inline'>
387
+ <p>Data row cell.</p>
388
+ </div>
389
+
390
+ </li>
391
+
392
+ </ul>
393
+
394
+ <p class="tag_title">Returns:</p>
395
+ <ul class="return">
396
+
397
+ <li>
398
+
399
+
400
+ <span class='type'>(<tt>false</tt>, <tt>CSVDecision::Proc</tt>)</span>
401
+
402
+
403
+
404
+ &mdash;
405
+ <div class='inline'>
406
+ <p>Returns false if this cell is not a match; otherwise returns the
407
+ <code>CSVDecision::Proc</code> object indicating if this is a constant or
408
+ some type of function.</p>
409
+ </div>
410
+
411
+ </li>
412
+
413
+ </ul>
414
+
415
+ </div><table class="source_code">
416
+ <tr>
417
+ <td>
418
+ <pre class="lines">
419
+
420
+
421
+ 201</pre>
422
+ </td>
423
+ <td>
424
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 201</span>
425
+
426
+ <span class='kw'>def</span> <span class='id identifier rubyid_matches?'>matches?</span><span class='lparen'>(</span><span class='id identifier rubyid_cell'>cell</span><span class='rparen'>)</span><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
427
+ </td>
428
+ </tr>
429
+ </table>
430
+ </div>
431
+
432
+ <div class="method_details ">
433
+ <h3 class="signature " id="outs?-instance_method">
434
+
435
+ #<strong>outs?</strong> &#x21d2; <tt>Boolean</tt>
436
+
437
+
438
+
439
+
440
+
441
+ </h3><div class="docstring">
442
+ <div class="discussion">
443
+ <p class="note private">
444
+ <strong>This method is part of a private API.</strong>
445
+ You should avoid using this method if possible, as it may be removed or be changed in the future.
446
+ </p>
447
+
448
+ <p>Does this matcher apply to output cells?</p>
449
+
450
+
451
+ </div>
452
+ </div>
453
+ <div class="tags">
454
+
455
+ <p class="tag_title">Returns:</p>
456
+ <ul class="return">
457
+
458
+ <li>
459
+
460
+
461
+ <span class='type'>(<tt>Boolean</tt>)</span>
462
+
463
+
464
+
465
+ &mdash;
466
+ <div class='inline'>
467
+ <p>Return true if this matcher applies to output cells, false otherwise.</p>
468
+ </div>
469
+
470
+ </li>
471
+
472
+ </ul>
473
+
474
+ </div><table class="source_code">
475
+ <tr>
476
+ <td>
477
+ <pre class="lines">
478
+
479
+
480
+ 207
481
+ 208
482
+ 209</pre>
483
+ </td>
484
+ <td>
485
+ <pre class="code"><span class="info file"># File 'lib/csv_decision/matchers.rb', line 207</span>
486
+
487
+ <span class='kw'>def</span> <span class='id identifier rubyid_outs?'>outs?</span>
488
+ <span class='kw'>false</span>
489
+ <span class='kw'>end</span></pre>
490
+ </td>
491
+ </tr>
492
+ </table>
493
+ </div>
494
+
495
+ </div>
496
+
497
+ </div>
498
+
499
+ <div id="footer">
500
+ Generated on Sun Feb 11 10:26:08 2018 by
501
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
502
+ 0.9.12 (ruby-2.4.0).
503
+ </div>
504
+
505
+ </div>
506
+ </body>
507
+ </html>