csv_decision 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.codeclimate.yml +2 -1
- data/README.md +2 -2
- data/csv_decision.gemspec +6 -2
- data/doc/CSVDecision/CellValidationError.html +1 -1
- data/doc/CSVDecision/Columns/Dictionary.html +1 -1
- data/doc/CSVDecision/Columns/Entry.html +1 -1
- data/doc/CSVDecision/Columns.html +1 -1
- data/doc/CSVDecision/Constant.html +1 -1
- data/doc/CSVDecision/Data.html +1 -1
- data/doc/CSVDecision/Decide.html +1 -1
- data/doc/CSVDecision/Decision.html +1 -1
- data/doc/CSVDecision/Error.html +1 -1
- data/doc/CSVDecision/FileError.html +1 -1
- data/doc/CSVDecision/Function.html +1 -1
- data/doc/CSVDecision/Header.html +1 -1
- data/doc/CSVDecision/Input.html +1 -1
- data/doc/CSVDecision/Load.html +1 -1
- data/doc/CSVDecision/Matchers/Constant.html +1 -1
- data/doc/CSVDecision/Matchers/Function.html +1 -1
- data/doc/CSVDecision/Matchers/Matcher.html +1 -1
- data/doc/CSVDecision/Matchers/Numeric.html +1 -1
- data/doc/CSVDecision/Matchers/Pattern.html +1 -1
- data/doc/CSVDecision/Matchers/Range.html +1 -1
- data/doc/CSVDecision/Matchers/Symbol.html +1 -1
- data/doc/CSVDecision/Matchers.html +1 -1
- data/doc/CSVDecision/Numeric.html +1 -1
- data/doc/CSVDecision/Options.html +1 -1
- data/doc/CSVDecision/Parse.html +1 -1
- data/doc/CSVDecision/ScanRow.html +1 -1
- data/doc/CSVDecision/Symbol.html +1 -1
- data/doc/CSVDecision/Table.html +1 -1
- data/doc/CSVDecision.html +1 -1
- data/doc/_index.html +1 -1
- data/doc/file.README.html +34 -22
- data/doc/index.html +34 -22
- data/doc/top-level-namespace.html +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e1b5a8bfea227e57ed0e764bf33e5a775a1a3152
|
4
|
+
data.tar.gz: e2d30cf7ac67b04da3a22b48cb27a21134125f10
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b084083ee126ef6e14dd9f9bc482b4770285a35b1925afaeea0c910cb2f8ba5ba3858868a9e30fb2cb9f1def61d91c941917dbc66ba3c887f8834a7a03d67a88
|
7
|
+
data.tar.gz: ee186e950e64c9c47bddc0714ce8aa076a2dd01684c5548b6de21dfb24a0c5c697eefa80c4a42bf34c90500e5d350a28c9d8316053bed7c3945b3117ecb3dda0
|
data/.codeclimate.yml
CHANGED
data/README.md
CHANGED
@@ -16,7 +16,7 @@ It accepts decision tables implemented as a
|
|
16
16
|
which can then be used to execute complex conditional logic against an input hash,
|
17
17
|
producing a decision as an output hash.
|
18
18
|
|
19
|
-
|
19
|
+
### CSV Decision features
|
20
20
|
* Fast decision-time performance (see `benchmark.rb`).
|
21
21
|
* In addition to simple string matching, can match common Ruby constants,
|
22
22
|
regular expressions, numeric comparisons and Ruby-style ranges.
|
@@ -28,7 +28,7 @@ producing a decision as an output hash.
|
|
28
28
|
* Either returns the first matching row as a hash, or accumulates all matches as an
|
29
29
|
array of hashes.
|
30
30
|
|
31
|
-
|
31
|
+
### Planned features
|
32
32
|
`csv_decision` is still a work in progress, and will be enhanced to support
|
33
33
|
the following features:
|
34
34
|
* Input columns may be indexed for faster lookup performance.
|
data/csv_decision.gemspec
CHANGED
@@ -5,11 +5,15 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = 'csv_decision'
|
8
|
-
spec.version = '0.0.
|
8
|
+
spec.version = '0.0.5'
|
9
9
|
spec.authors = ['Brett Vickers']
|
10
10
|
spec.email = ['brett@phillips-vickers.com']
|
11
11
|
spec.description = 'CSV based Ruby decision tables.'
|
12
|
-
spec.summary =
|
12
|
+
spec.summary = <<~DESC
|
13
|
+
CSV Decision implements CSV file based Ruby decision tables. It accepts decision tables implemented as a
|
14
|
+
which can then be used to execute complex conditional logic against an input hash,
|
15
|
+
producing a decision as an output hash.
|
16
|
+
DESC
|
13
17
|
spec.homepage = 'https://github.com/bpvickers/csv_decision.git'
|
14
18
|
spec.license = 'MIT'
|
15
19
|
|
@@ -133,7 +133,7 @@
|
|
133
133
|
</div>
|
134
134
|
|
135
135
|
<div id="footer">
|
136
|
-
Generated on Tue Dec 26
|
136
|
+
Generated on Tue Dec 26 21:20:20 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>
|
@@ -400,7 +400,7 @@ interspersed and need not have unique names.</p>
|
|
400
400
|
</div>
|
401
401
|
|
402
402
|
<div id="footer">
|
403
|
-
Generated on Tue Dec 26
|
403
|
+
Generated on Tue Dec 26 21:20:20 2017 by
|
404
404
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
405
405
|
0.9.12 (ruby-2.3.0).
|
406
406
|
</div>
|
@@ -311,7 +311,7 @@
|
|
311
311
|
</div>
|
312
312
|
|
313
313
|
<div id="footer">
|
314
|
-
Generated on Tue Dec 26
|
314
|
+
Generated on Tue Dec 26 21:20:20 2017 by
|
315
315
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
316
316
|
0.9.12 (ruby-2.3.0).
|
317
317
|
</div>
|
@@ -466,7 +466,7 @@
|
|
466
466
|
</div>
|
467
467
|
|
468
468
|
<div id="footer">
|
469
|
-
Generated on Tue Dec 26
|
469
|
+
Generated on Tue Dec 26 21:20:20 2017 by
|
470
470
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
471
471
|
0.9.12 (ruby-2.3.0).
|
472
472
|
</div>
|
@@ -285,7 +285,7 @@ some type of function.</p>
|
|
285
285
|
</div>
|
286
286
|
|
287
287
|
<div id="footer">
|
288
|
-
Generated on Tue Dec 26
|
288
|
+
Generated on Tue Dec 26 21:20:19 2017 by
|
289
289
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
290
290
|
0.9.12 (ruby-2.3.0).
|
291
291
|
</div>
|
data/doc/CSVDecision/Data.html
CHANGED
@@ -334,7 +334,7 @@ array of arrays. Strips out empty columns/rows and comment cells</p>
|
|
334
334
|
</div>
|
335
335
|
|
336
336
|
<div id="footer">
|
337
|
-
Generated on Tue Dec 26
|
337
|
+
Generated on Tue Dec 26 21:20:19 2017 by
|
338
338
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
339
339
|
0.9.12 (ruby-2.3.0).
|
340
340
|
</div>
|
data/doc/CSVDecision/Decide.html
CHANGED
@@ -424,7 +424,7 @@ hash. Otherwise a copy of the input hash is symbolized.</p>
|
|
424
424
|
</div>
|
425
425
|
|
426
426
|
<div id="footer">
|
427
|
-
Generated on Tue Dec 26
|
427
|
+
Generated on Tue Dec 26 21:20:19 2017 by
|
428
428
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
429
429
|
0.9.12 (ruby-2.3.0).
|
430
430
|
</div>
|
@@ -594,7 +594,7 @@
|
|
594
594
|
</div>
|
595
595
|
|
596
596
|
<div id="footer">
|
597
|
-
Generated on Tue Dec 26
|
597
|
+
Generated on Tue Dec 26 21:20:20 2017 by
|
598
598
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
599
599
|
0.9.12 (ruby-2.3.0).
|
600
600
|
</div>
|
data/doc/CSVDecision/Error.html
CHANGED
@@ -129,7 +129,7 @@
|
|
129
129
|
</div>
|
130
130
|
|
131
131
|
<div id="footer">
|
132
|
-
Generated on Tue Dec 26
|
132
|
+
Generated on Tue Dec 26 21:20:20 2017 by
|
133
133
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
134
134
|
0.9.12 (ruby-2.3.0).
|
135
135
|
</div>
|
@@ -133,7 +133,7 @@
|
|
133
133
|
</div>
|
134
134
|
|
135
135
|
<div id="footer">
|
136
|
-
Generated on Tue Dec 26
|
136
|
+
Generated on Tue Dec 26 21:20:20 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>
|
@@ -219,7 +219,7 @@
|
|
219
219
|
</div>
|
220
220
|
|
221
221
|
<div id="footer">
|
222
|
-
Generated on Tue Dec 26
|
222
|
+
Generated on Tue Dec 26 21:20:19 2017 by
|
223
223
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
224
224
|
0.9.12 (ruby-2.3.0).
|
225
225
|
</div>
|
data/doc/CSVDecision/Header.html
CHANGED
@@ -510,7 +510,7 @@ method name - note any spaces will have been replaced with underscores.</p>
|
|
510
510
|
</div>
|
511
511
|
|
512
512
|
<div id="footer">
|
513
|
-
Generated on Tue Dec 26
|
513
|
+
Generated on Tue Dec 26 21:20:19 2017 by
|
514
514
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
515
515
|
0.9.12 (ruby-2.3.0).
|
516
516
|
</div>
|
data/doc/CSVDecision/Input.html
CHANGED
@@ -295,7 +295,7 @@ column. Defaults to nil if the key is missing in the input hash.</p>
|
|
295
295
|
</div>
|
296
296
|
|
297
297
|
<div id="footer">
|
298
|
-
Generated on Tue Dec 26
|
298
|
+
Generated on Tue Dec 26 21:20:19 2017 by
|
299
299
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
300
300
|
0.9.12 (ruby-2.3.0).
|
301
301
|
</div>
|
data/doc/CSVDecision/Load.html
CHANGED
@@ -215,7 +215,7 @@
|
|
215
215
|
</div>
|
216
216
|
|
217
217
|
<div id="footer">
|
218
|
-
Generated on Tue Dec 26
|
218
|
+
Generated on Tue Dec 26 21:20:19 2017 by
|
219
219
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
220
220
|
0.9.12 (ruby-2.3.0).
|
221
221
|
</div>
|
@@ -232,7 +232,7 @@
|
|
232
232
|
</div>
|
233
233
|
|
234
234
|
<div id="footer">
|
235
|
-
Generated on Tue Dec 26
|
235
|
+
Generated on Tue Dec 26 21:20:20 2017 by
|
236
236
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
237
237
|
0.9.12 (ruby-2.3.0).
|
238
238
|
</div>
|
@@ -332,7 +332,7 @@ some type of function.</p>
|
|
332
332
|
</div>
|
333
333
|
|
334
334
|
<div id="footer">
|
335
|
-
Generated on Tue Dec 26
|
335
|
+
Generated on Tue Dec 26 21:20:20 2017 by
|
336
336
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
337
337
|
0.9.12 (ruby-2.3.0).
|
338
338
|
</div>
|
@@ -315,7 +315,7 @@ some type of function.</p>
|
|
315
315
|
</div>
|
316
316
|
|
317
317
|
<div id="footer">
|
318
|
-
Generated on Tue Dec 26
|
318
|
+
Generated on Tue Dec 26 21:20:20 2017 by
|
319
319
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
320
320
|
0.9.12 (ruby-2.3.0).
|
321
321
|
</div>
|
@@ -267,7 +267,7 @@ some type of function.</p>
|
|
267
267
|
</div>
|
268
268
|
|
269
269
|
<div id="footer">
|
270
|
-
Generated on Tue Dec 26
|
270
|
+
Generated on Tue Dec 26 21:20:20 2017 by
|
271
271
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
272
272
|
0.9.12 (ruby-2.3.0).
|
273
273
|
</div>
|
@@ -590,7 +590,7 @@ some type of function.</p>
|
|
590
590
|
</div>
|
591
591
|
|
592
592
|
<div id="footer">
|
593
|
-
Generated on Tue Dec 26
|
593
|
+
Generated on Tue Dec 26 21:20:20 2017 by
|
594
594
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
595
595
|
0.9.12 (ruby-2.3.0).
|
596
596
|
</div>
|
@@ -403,7 +403,7 @@ some type of function.</p>
|
|
403
403
|
</div>
|
404
404
|
|
405
405
|
<div id="footer">
|
406
|
-
Generated on Tue Dec 26
|
406
|
+
Generated on Tue Dec 26 21:20:20 2017 by
|
407
407
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
408
408
|
0.9.12 (ruby-2.3.0).
|
409
409
|
</div>
|
@@ -270,7 +270,7 @@ some type of function.</p>
|
|
270
270
|
</div>
|
271
271
|
|
272
272
|
<div id="footer">
|
273
|
-
Generated on Tue Dec 26
|
273
|
+
Generated on Tue Dec 26 21:20:20 2017 by
|
274
274
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
275
275
|
0.9.12 (ruby-2.3.0).
|
276
276
|
</div>
|
@@ -1519,7 +1519,7 @@ non-capturing group.</p>
|
|
1519
1519
|
</div>
|
1520
1520
|
|
1521
1521
|
<div id="footer">
|
1522
|
-
Generated on Tue Dec 26
|
1522
|
+
Generated on Tue Dec 26 21:20:20 2017 by
|
1523
1523
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1524
1524
|
0.9.12 (ruby-2.3.0).
|
1525
1525
|
</div>
|
@@ -249,7 +249,7 @@ some type of function.</p>
|
|
249
249
|
</div>
|
250
250
|
|
251
251
|
<div id="footer">
|
252
|
-
Generated on Tue Dec 26
|
252
|
+
Generated on Tue Dec 26 21:20:19 2017 by
|
253
253
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
254
254
|
0.9.12 (ruby-2.3.0).
|
255
255
|
</div>
|
@@ -435,7 +435,7 @@ set.</p>
|
|
435
435
|
</div>
|
436
436
|
|
437
437
|
<div id="footer">
|
438
|
-
Generated on Tue Dec 26
|
438
|
+
Generated on Tue Dec 26 21:20:19 2017 by
|
439
439
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
440
440
|
0.9.12 (ruby-2.3.0).
|
441
441
|
</div>
|
data/doc/CSVDecision/Parse.html
CHANGED
@@ -260,7 +260,7 @@
|
|
260
260
|
</div>
|
261
261
|
|
262
262
|
<div id="footer">
|
263
|
-
Generated on Tue Dec 26
|
263
|
+
Generated on Tue Dec 26 21:20:19 2017 by
|
264
264
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
265
265
|
0.9.12 (ruby-2.3.0).
|
266
266
|
</div>
|
@@ -736,7 +736,7 @@ non-string constant.</p>
|
|
736
736
|
</div>
|
737
737
|
|
738
738
|
<div id="footer">
|
739
|
-
Generated on Tue Dec 26
|
739
|
+
Generated on Tue Dec 26 21:20:20 2017 by
|
740
740
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
741
741
|
0.9.12 (ruby-2.3.0).
|
742
742
|
</div>
|
data/doc/CSVDecision/Symbol.html
CHANGED
@@ -246,7 +246,7 @@ some type of function.</p>
|
|
246
246
|
</div>
|
247
247
|
|
248
248
|
<div id="footer">
|
249
|
-
Generated on Tue Dec 26
|
249
|
+
Generated on Tue Dec 26 21:20:19 2017 by
|
250
250
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
251
251
|
0.9.12 (ruby-2.3.0).
|
252
252
|
</div>
|
data/doc/CSVDecision/Table.html
CHANGED
@@ -1105,7 +1105,7 @@ and last row index given.</p>
|
|
1105
1105
|
</div>
|
1106
1106
|
|
1107
1107
|
<div id="footer">
|
1108
|
-
Generated on Tue Dec 26
|
1108
|
+
Generated on Tue Dec 26 21:20:20 2017 by
|
1109
1109
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1110
1110
|
0.9.12 (ruby-2.3.0).
|
1111
1111
|
</div>
|
data/doc/CSVDecision.html
CHANGED
@@ -642,7 +642,7 @@ table.decide(topic: 'finance', region: 'Europe') #=> team_mem
|
|
642
642
|
</div>
|
643
643
|
|
644
644
|
<div id="footer">
|
645
|
-
Generated on Tue Dec 26
|
645
|
+
Generated on Tue Dec 26 21:20:19 2017 by
|
646
646
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
647
647
|
0.9.12 (ruby-2.3.0).
|
648
648
|
</div>
|
data/doc/_index.html
CHANGED
@@ -400,7 +400,7 @@
|
|
400
400
|
</div>
|
401
401
|
|
402
402
|
<div id="footer">
|
403
|
-
Generated on Tue Dec 26
|
403
|
+
Generated on Tue Dec 26 21:20:18 2017 by
|
404
404
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
405
405
|
0.9.12 (ruby-2.3.0).
|
406
406
|
</div>
|
data/doc/file.README.html
CHANGED
@@ -82,27 +82,39 @@ href="https://en.wikipedia.org/wiki/Comma-separated_values">CSV file</a>,
|
|
82
82
|
which can then be used to execute complex conditional logic against an
|
83
83
|
input hash, producing a decision as an output hash.</p>
|
84
84
|
|
85
|
-
<
|
86
|
-
<
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
85
|
+
<h3 id="label-CSV+Decision+features">CSV Decision features</h3>
|
86
|
+
<ul><li>
|
87
|
+
<p>Fast decision-time performance (see <code>benchmark.rb</code>).</p>
|
88
|
+
</li><li>
|
89
|
+
<p>In addition to simple string matching, can match common Ruby constants,
|
90
|
+
regular expressions, numeric comparisons and Ruby-style ranges.</p>
|
91
|
+
</li><li>
|
92
|
+
<p>Can use column symbols in comparisons for guard conditions – e.g., >
|
93
|
+
:column.</p>
|
94
|
+
</li><li>
|
95
|
+
<p>Accepts data as a file, CSV string or an array of arrays. (For safety all
|
96
|
+
input data is force encoded to UTF-8, and non-ascii strings are converted
|
97
|
+
to empty strings.)</p>
|
98
|
+
</li><li>
|
99
|
+
<p>All CSV cells are parsed for correctness, and helpful error messages
|
100
|
+
generated for bad inputs.</p>
|
101
|
+
</li><li>
|
102
|
+
<p>Either returns the first matching row as a hash, or accumulates all matches
|
103
|
+
as an array of hashes.</p>
|
104
|
+
</li></ul>
|
105
|
+
|
106
|
+
<h3 id="label-Planned+features">Planned features</h3>
|
107
|
+
|
108
|
+
<p><code>csv_decision</code> is still a work in progress, and will be enhanced
|
109
|
+
to support the following features: * Input columns may be indexed for
|
110
|
+
faster lookup performance. * May use functions in the output columns to
|
111
|
+
formulate the final decision. * Input hash values may be conditionally
|
112
|
+
defaulted using a constant or a function call * Use of column symbol
|
113
|
+
references or built-in guard functions in the input columns for matching.
|
114
|
+
* Output columns may use interpolated strings referencing column symbols.
|
115
|
+
* May be extended with user-defined Ruby functions for tailored logic. *
|
116
|
+
Can use post-match guard conditions to filter the results of multi-row
|
117
|
+
decision output.</p>
|
106
118
|
|
107
119
|
<p>### Why use <code>csv_decision</code>?</p>
|
108
120
|
|
@@ -254,7 +266,7 @@ bundle install rspec </code></p>
|
|
254
266
|
</div></div>
|
255
267
|
|
256
268
|
<div id="footer">
|
257
|
-
Generated on Tue Dec 26
|
269
|
+
Generated on Tue Dec 26 21:20:19 2017 by
|
258
270
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
259
271
|
0.9.12 (ruby-2.3.0).
|
260
272
|
</div>
|
data/doc/index.html
CHANGED
@@ -82,27 +82,39 @@ href="https://en.wikipedia.org/wiki/Comma-separated_values">CSV file</a>,
|
|
82
82
|
which can then be used to execute complex conditional logic against an
|
83
83
|
input hash, producing a decision as an output hash.</p>
|
84
84
|
|
85
|
-
<
|
86
|
-
<
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
85
|
+
<h3 id="label-CSV+Decision+features">CSV Decision features</h3>
|
86
|
+
<ul><li>
|
87
|
+
<p>Fast decision-time performance (see <code>benchmark.rb</code>).</p>
|
88
|
+
</li><li>
|
89
|
+
<p>In addition to simple string matching, can match common Ruby constants,
|
90
|
+
regular expressions, numeric comparisons and Ruby-style ranges.</p>
|
91
|
+
</li><li>
|
92
|
+
<p>Can use column symbols in comparisons for guard conditions – e.g., >
|
93
|
+
:column.</p>
|
94
|
+
</li><li>
|
95
|
+
<p>Accepts data as a file, CSV string or an array of arrays. (For safety all
|
96
|
+
input data is force encoded to UTF-8, and non-ascii strings are converted
|
97
|
+
to empty strings.)</p>
|
98
|
+
</li><li>
|
99
|
+
<p>All CSV cells are parsed for correctness, and helpful error messages
|
100
|
+
generated for bad inputs.</p>
|
101
|
+
</li><li>
|
102
|
+
<p>Either returns the first matching row as a hash, or accumulates all matches
|
103
|
+
as an array of hashes.</p>
|
104
|
+
</li></ul>
|
105
|
+
|
106
|
+
<h3 id="label-Planned+features">Planned features</h3>
|
107
|
+
|
108
|
+
<p><code>csv_decision</code> is still a work in progress, and will be enhanced
|
109
|
+
to support the following features: * Input columns may be indexed for
|
110
|
+
faster lookup performance. * May use functions in the output columns to
|
111
|
+
formulate the final decision. * Input hash values may be conditionally
|
112
|
+
defaulted using a constant or a function call * Use of column symbol
|
113
|
+
references or built-in guard functions in the input columns for matching.
|
114
|
+
* Output columns may use interpolated strings referencing column symbols.
|
115
|
+
* May be extended with user-defined Ruby functions for tailored logic. *
|
116
|
+
Can use post-match guard conditions to filter the results of multi-row
|
117
|
+
decision output.</p>
|
106
118
|
|
107
119
|
<p>### Why use <code>csv_decision</code>?</p>
|
108
120
|
|
@@ -254,7 +266,7 @@ bundle install rspec </code></p>
|
|
254
266
|
</div></div>
|
255
267
|
|
256
268
|
<div id="footer">
|
257
|
-
Generated on Tue Dec 26
|
269
|
+
Generated on Tue Dec 26 21:20:19 2017 by
|
258
270
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
259
271
|
0.9.12 (ruby-2.3.0).
|
260
272
|
</div>
|
@@ -100,7 +100,7 @@
|
|
100
100
|
</div>
|
101
101
|
|
102
102
|
<div id="footer">
|
103
|
-
Generated on Tue Dec 26
|
103
|
+
Generated on Tue Dec 26 21:20:19 2017 by
|
104
104
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
105
105
|
0.9.12 (ruby-2.3.0).
|
106
106
|
</div>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: csv_decision
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brett Vickers
|
@@ -314,7 +314,9 @@ rubyforge_project:
|
|
314
314
|
rubygems_version: 2.6.10
|
315
315
|
signing_key:
|
316
316
|
specification_version: 4
|
317
|
-
summary: CSV based Ruby decision tables.
|
317
|
+
summary: CSV Decision implements CSV file based Ruby decision tables. It accepts
|
318
|
+
decision tables implemented as a which can then be used to execute complex conditional
|
319
|
+
logic against an input hash, producing a decision as an output hash.
|
318
320
|
test_files:
|
319
321
|
- spec/csv_decision/columns_spec.rb
|
320
322
|
- spec/csv_decision/constant_spec.rb
|