kharon 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +5 -13
  2. data/{.rspec → .rspec.old} +0 -0
  3. data/Gemfile +1 -0
  4. data/Gemfile.lock +12 -4
  5. data/dist/kharon-1.1.0.gem +0 -0
  6. data/doc/Kharon.html +384 -6
  7. data/doc/Kharon/Errors.html +1 -1
  8. data/doc/Kharon/Errors/Validation.html +1 -1
  9. data/doc/Kharon/Handlers.html +1 -1
  10. data/doc/Kharon/Handlers/Exceptions.html +1 -1
  11. data/doc/Kharon/Handlers/Messages.html +1 -1
  12. data/doc/Kharon/Processor.html +425 -0
  13. data/doc/Kharon/Processors.html +144 -0
  14. data/doc/Kharon/Processors/ArrayProcessor.html +429 -0
  15. data/doc/Kharon/Processors/BooleanProcessor.html +306 -0
  16. data/doc/Kharon/Processors/BoxProcessor.html +440 -0
  17. data/doc/Kharon/Processors/DateProcessor.html +306 -0
  18. data/doc/Kharon/Processors/DatetimeProcessor.html +306 -0
  19. data/doc/Kharon/Processors/EmailProcessor.html +307 -0
  20. data/doc/Kharon/Processors/HashProcessor.html +431 -0
  21. data/doc/Kharon/Processors/IntegerProcessor.html +441 -0
  22. data/doc/Kharon/Processors/NumericProcessor.html +463 -0
  23. data/doc/Kharon/Processors/SSIDProcessor.html +307 -0
  24. data/doc/Kharon/Processors/TextProcessor.html +430 -0
  25. data/doc/Kharon/Validate.html +17 -5
  26. data/doc/Kharon/Validator.html +198 -1194
  27. data/doc/_index.html +159 -1
  28. data/doc/class_list.html +1 -1
  29. data/doc/file.README.html +15 -4
  30. data/doc/index.html +15 -4
  31. data/doc/method_list.html +135 -39
  32. data/doc/top-level-namespace.html +1 -1
  33. data/kharon.gemspec +4 -2
  34. data/lib/kharon.rb +32 -2
  35. data/lib/kharon/processor.rb +162 -0
  36. data/lib/kharon/processors.rb +6 -0
  37. data/lib/kharon/processors/array_processor.rb +30 -0
  38. data/lib/kharon/processors/boolean_processor.rb +31 -0
  39. data/lib/kharon/processors/box_processor.rb +63 -0
  40. data/lib/kharon/processors/date_processor.rb +21 -0
  41. data/lib/kharon/processors/datetime_processor.rb +21 -0
  42. data/lib/kharon/processors/email_processor.rb +21 -0
  43. data/lib/kharon/processors/hash_processor.rb +31 -0
  44. data/lib/kharon/processors/integer_processor.rb +55 -0
  45. data/lib/kharon/processors/numeric_processor.rb +66 -0
  46. data/lib/kharon/processors/ssid_processor.rb +21 -0
  47. data/lib/kharon/processors/text_processor.rb +30 -0
  48. data/lib/kharon/validate.rb +1 -1
  49. data/lib/kharon/validator.rb +26 -390
  50. data/lib/kharon/version.rb +1 -1
  51. data/spec/results.html +5277 -321
  52. metadata +69 -28
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- ZWM0YTEzZTQ2MTZjOGMxMTQzMTVkMDFhZWNjOTljMTFkY2QxNTQyMA==
5
- data.tar.gz: !binary |-
6
- OWVmZTUzOTZmNGQxNmE0NmIxZGNhZTcyZDI5YzM1Njc4NDQ3YTYyZg==
2
+ SHA1:
3
+ metadata.gz: 72ad455aa693040f1b2dd6b0f3b17defcdd8d05a
4
+ data.tar.gz: 834352d82a931e1f6dee16a55c95c66b6cc0f8ba
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- OWQwNjQ5ZDZmZWE4NzdkZDY5NDg1ZmY1Y2UwNGYyMjhjYzlmZjk2YjM1OWQx
10
- ZmE1MjFhOTFhODg5NmE2YjE1MDkxZTQ2NjdhNDhiY2Y5M2E0ZGE2ZDQ1ZDRj
11
- YzY1MjZhMWIxZDQyODIzODU5NDZhOWI4NGIzNWYyYjFlMGVjODQ=
12
- data.tar.gz: !binary |-
13
- YTIxNDI4N2I3NTMyOTBlZTIxOTkyNDkzOTM3NTI0NDk2ZDU2OGUxMzhkNmIw
14
- MGEwMGNkZDY3NzkzZGYwNGQ5YmM2OTY4NGIyYzA0ZDQxOGViODRkODkyN2Ey
15
- MWRiMjAyNDE3YTI2MWQxYjYyOTVhM2U3MzBjYmI3MDJhY2Y4YTY=
6
+ metadata.gz: a2596bfe8aec697ab31758c8a665d31168c695952bba24618c0de8b286c97e20d008fe62c18e3e97eb3887cab2925046d88bef0609b78185e7fede845105fcb0
7
+ data.tar.gz: d2487f81bb9c5f485f094f4c3b1148939d9ec5e665aaf09989fb3124b741777735cacb6748429fa10b53c3bdda50e630f281cf3abe8829bf1f5f0a073d81ff9c
File without changes
data/Gemfile CHANGED
@@ -1 +1,2 @@
1
+ source "https://rubygems.org"
1
2
  gemspec
@@ -1,14 +1,20 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- kharon (1.0.0)
5
- bson (~> 2.2, >= 2.2.2)
4
+ kharon (1.1.0)
5
+ bson (>= 4.2.1)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- bson (2.3.0)
10
+ bson (4.2.2)
11
+ coderay (1.1.0)
11
12
  diff-lcs (1.2.5)
13
+ method_source (0.8.2)
14
+ pry (0.10.3)
15
+ coderay (~> 1.1.0)
16
+ method_source (~> 0.8.1)
17
+ slop (~> 3.4)
12
18
  rack (1.6.1)
13
19
  rack-test (0.6.2)
14
20
  rack (>= 1.0)
@@ -26,6 +32,7 @@ GEM
26
32
  rspec-mocks (3.1.3)
27
33
  rspec-support (~> 3.1.0)
28
34
  rspec-support (3.1.2)
35
+ slop (3.6.0)
29
36
  yard (0.8.7.6)
30
37
 
31
38
  PLATFORMS
@@ -34,6 +41,7 @@ PLATFORMS
34
41
  DEPENDENCIES
35
42
  bundler (~> 1.8)
36
43
  kharon!
44
+ pry
37
45
  rack-test (~> 0.6.2)
38
46
  rake (~> 10.0)
39
47
  redcarpet (= 3.3.1)
@@ -41,4 +49,4 @@ DEPENDENCIES
41
49
  yard (~> 0.8)
42
50
 
43
51
  BUNDLED WITH
44
- 1.12.3
52
+ 1.14.6
Binary file
@@ -80,7 +80,7 @@
80
80
 
81
81
  <dt class="r1 last">Defined in:</dt>
82
82
  <dd class="r1 last">lib/kharon.rb<span class="defines">,<br />
83
- lib/kharon/errors.rb,<br /> lib/kharon/version.rb,<br /> lib/kharon/validate.rb,<br /> lib/kharon/handlers.rb,<br /> lib/kharon/validator.rb,<br /> lib/kharon/errors/validation.rb,<br /> lib/kharon/handlers/messages.rb,<br /> lib/kharon/handlers/exceptions.rb</span>
83
+ lib/kharon/errors.rb,<br /> lib/kharon/version.rb,<br /> lib/kharon/validate.rb,<br /> lib/kharon/handlers.rb,<br /> lib/kharon/processor.rb,<br /> lib/kharon/validator.rb,<br /> lib/kharon/processors.rb,<br /> lib/kharon/handlers/messages.rb,<br /> lib/kharon/errors/validation.rb,<br /> lib/kharon/handlers/exceptions.rb,<br /> lib/kharon/processors/box_processor.rb,<br /> lib/kharon/processors/ssid_processor.rb,<br /> lib/kharon/processors/date_processor.rb,<br /> lib/kharon/processors/text_processor.rb,<br /> lib/kharon/processors/hash_processor.rb,<br /> lib/kharon/processors/email_processor.rb,<br /> lib/kharon/processors/array_processor.rb,<br /> lib/kharon/processors/boolean_processor.rb,<br /> lib/kharon/processors/integer_processor.rb,<br /> lib/kharon/processors/numeric_processor.rb,<br /> lib/kharon/processors/datetime_processor.rb</span>
84
84
  </dd>
85
85
 
86
86
  </dl>
@@ -117,11 +117,11 @@
117
117
  <p class="children">
118
118
 
119
119
 
120
- <strong class="modules">Modules:</strong> <span class='object_link'><a href="Kharon/Errors.html" title="Kharon::Errors (module)">Errors</a></span>, <span class='object_link'><a href="Kharon/Handlers.html" title="Kharon::Handlers (module)">Handlers</a></span>, <span class='object_link'><a href="Kharon/Validate.html" title="Kharon::Validate (module)">Validate</a></span>
120
+ <strong class="modules">Modules:</strong> <span class='object_link'><a href="Kharon/Errors.html" title="Kharon::Errors (module)">Errors</a></span>, <span class='object_link'><a href="Kharon/Handlers.html" title="Kharon::Handlers (module)">Handlers</a></span>, <span class='object_link'><a href="Kharon/Processors.html" title="Kharon::Processors (module)">Processors</a></span>, <span class='object_link'><a href="Kharon/Validate.html" title="Kharon::Validate (module)">Validate</a></span>
121
121
 
122
122
 
123
123
 
124
- <strong class="classes">Classes:</strong> <span class='object_link'><a href="Kharon/Validator.html" title="Kharon::Validator (class)">Validator</a></span>
124
+ <strong class="classes">Classes:</strong> <span class='object_link'><a href="Kharon/Processor.html" title="Kharon::Processor (class)">Processor</a></span>, <span class='object_link'><a href="Kharon/Validator.html" title="Kharon::Validator (class)">Validator</a></span>
125
125
 
126
126
 
127
127
  </p>
@@ -144,13 +144,18 @@
144
144
 
145
145
  </div>
146
146
  </dt>
147
- <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>1.0.0</span><span class='tstring_end'>&quot;</span></span></pre></dd>
147
+ <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>1.1.0</span><span class='tstring_end'>&quot;</span></span></pre></dd>
148
148
 
149
149
  <dt id="use_exceptions-classvariable" class="">@@use_exceptions =
150
150
 
151
151
  </dt>
152
152
  <dd><pre class="code"><span class='kw'>true</span></pre></dd>
153
153
 
154
+ <dt id="processors-classvariable" class="">@@processors =
155
+
156
+ </dt>
157
+ <dd><pre class="code"><span class='lbrace'>{</span><span class='rbrace'>}</span></pre></dd>
158
+
154
159
  </dl>
155
160
 
156
161
 
@@ -171,6 +176,30 @@
171
176
  <li class="public ">
172
177
  <span class="summary_signature">
173
178
 
179
+ <a href="#add_processor-class_method" title="add_processor (class method)">+ (Object) <strong>add_processor</strong>(name, classname) </a>
180
+
181
+
182
+
183
+ </span>
184
+
185
+
186
+
187
+
188
+
189
+
190
+
191
+
192
+
193
+ <span class="summary_desc"><div class='inline'>
194
+ <p>Adds a processor class to the list of processors.</p>
195
+ </div></span>
196
+
197
+ </li>
198
+
199
+
200
+ <li class="public ">
201
+ <span class="summary_signature">
202
+
174
203
  <a href="#errors_handler-class_method" title="errors_handler (class method)">+ (Object) <strong>errors_handler</strong> </a>
175
204
 
176
205
 
@@ -189,6 +218,78 @@
189
218
  <p>Returns the current error handler, defined by if you use exceptions or not.</p>
190
219
  </div></span>
191
220
 
221
+ </li>
222
+
223
+
224
+ <li class="public ">
225
+ <span class="summary_signature">
226
+
227
+ <a href="#has_processor%3F-class_method" title="has_processor? (class method)">+ (Boolean) <strong>has_processor?</strong>(name) </a>
228
+
229
+
230
+
231
+ </span>
232
+
233
+
234
+
235
+
236
+
237
+
238
+
239
+
240
+
241
+ <span class="summary_desc"><div class='inline'>
242
+ <p>Checks if a processor currently exists in the system.</p>
243
+ </div></span>
244
+
245
+ </li>
246
+
247
+
248
+ <li class="public ">
249
+ <span class="summary_signature">
250
+
251
+ <a href="#processors-class_method" title="processors (class method)">+ (Hash) <strong>processors</strong> </a>
252
+
253
+
254
+
255
+ </span>
256
+
257
+
258
+
259
+
260
+
261
+
262
+
263
+
264
+
265
+ <span class="summary_desc"><div class='inline'>
266
+ <p>Getter for the list of processors.</p>
267
+ </div></span>
268
+
269
+ </li>
270
+
271
+
272
+ <li class="public ">
273
+ <span class="summary_signature">
274
+
275
+ <a href="#remove_processor-class_method" title="remove_processor (class method)">+ (Object) <strong>remove_processor</strong>(name) </a>
276
+
277
+
278
+
279
+ </span>
280
+
281
+
282
+
283
+
284
+
285
+
286
+
287
+
288
+
289
+ <span class="summary_desc"><div class='inline'>
290
+ <p>Removes a processor from the list of available processors.</p>
291
+ </div></span>
292
+
192
293
  </li>
193
294
 
194
295
 
@@ -227,7 +328,85 @@ stores error messages.</p>
227
328
 
228
329
 
229
330
  <div class="method_details first">
230
- <h3 class="signature first" id="errors_handler-class_method">
331
+ <h3 class="signature first" id="add_processor-class_method">
332
+
333
+ + (<tt>Object</tt>) <strong>add_processor</strong>(name, classname)
334
+
335
+
336
+
337
+
338
+
339
+ </h3><div class="docstring">
340
+ <div class="discussion">
341
+
342
+ <p>Adds a processor class to the list of processors.</p>
343
+
344
+
345
+ </div>
346
+ </div>
347
+ <div class="tags">
348
+ <p class="tag_title">Parameters:</p>
349
+ <ul class="param">
350
+
351
+ <li>
352
+
353
+ <span class='name'>name</span>
354
+
355
+
356
+ <span class='type'>(<tt>Symbol</tt>)</span>
357
+
358
+
359
+
360
+ &mdash;
361
+ <div class='inline'>
362
+ <p>the name of the stored processor to retrieve it after. It will be the
363
+ method you call to process a data with that processor.</p>
364
+ </div>
365
+
366
+ </li>
367
+
368
+ <li>
369
+
370
+ <span class='name'>classname</span>
371
+
372
+
373
+ <span class='type'>(<tt>Class</tt>)</span>
374
+
375
+
376
+
377
+ &mdash;
378
+ <div class='inline'>
379
+ <p>the class object for the processor to be instanciated later.</p>
380
+ </div>
381
+
382
+ </li>
383
+
384
+ </ul>
385
+
386
+
387
+ </div><table class="source_code">
388
+ <tr>
389
+ <td>
390
+ <pre class="lines">
391
+
392
+
393
+ 24
394
+ 25
395
+ 26</pre>
396
+ </td>
397
+ <td>
398
+ <pre class="code"><span class="info file"># File 'lib/kharon.rb', line 24</span>
399
+
400
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_add_processor'>add_processor</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_classname'>classname</span><span class='rparen'>)</span>
401
+ <span class='cvar'>@@processors</span><span class='lbracket'>[</span><span class='id identifier rubyid_name'>name</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_classname'>classname</span> <span class='kw'>if</span> <span class='id identifier rubyid_classname'>classname</span><span class='period'>.</span><span class='id identifier rubyid_ancestors'>ancestors</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span> <span class='const'>Kharon</span><span class='op'>::</span><span class='const'>Processor</span>
402
+ <span class='kw'>end</span></pre>
403
+ </td>
404
+ </tr>
405
+ </table>
406
+ </div>
407
+
408
+ <div class="method_details ">
409
+ <h3 class="signature " id="errors_handler-class_method">
231
410
 
232
411
  + (<tt>Object</tt>) <strong>errors_handler</strong>
233
412
 
@@ -284,6 +463,205 @@ instance of Kharon::Handlers::Messages else.</p>
284
463
  </td>
285
464
  </tr>
286
465
  </table>
466
+ </div>
467
+
468
+ <div class="method_details ">
469
+ <h3 class="signature " id="has_processor?-class_method">
470
+
471
+ + (<tt>Boolean</tt>) <strong>has_processor?</strong>(name)
472
+
473
+
474
+
475
+
476
+
477
+ </h3><div class="docstring">
478
+ <div class="discussion">
479
+
480
+ <p>Checks if a processor currently exists in the system.</p>
481
+
482
+
483
+ </div>
484
+ </div>
485
+ <div class="tags">
486
+ <p class="tag_title">Parameters:</p>
487
+ <ul class="param">
488
+
489
+ <li>
490
+
491
+ <span class='name'>name</span>
492
+
493
+
494
+ <span class='type'>(<tt>String</tt>)</span>
495
+
496
+
497
+
498
+ &mdash;
499
+ <div class='inline'>
500
+ <p>the name of the processor to check the existence.</p>
501
+ </div>
502
+
503
+ </li>
504
+
505
+ </ul>
506
+
507
+ <p class="tag_title">Returns:</p>
508
+ <ul class="return">
509
+
510
+ <li>
511
+
512
+
513
+ <span class='type'>(<tt>Boolean</tt>)</span>
514
+
515
+
516
+
517
+ &mdash;
518
+ <div class='inline'>
519
+ <p>TRUE if the processor exists, FALSE if not.</p>
520
+ </div>
521
+
522
+ </li>
523
+
524
+ </ul>
525
+
526
+ </div><table class="source_code">
527
+ <tr>
528
+ <td>
529
+ <pre class="lines">
530
+
531
+
532
+ 43
533
+ 44
534
+ 45</pre>
535
+ </td>
536
+ <td>
537
+ <pre class="code"><span class="info file"># File 'lib/kharon.rb', line 43</span>
538
+
539
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_has_processor?'>has_processor?</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
540
+ <span class='cvar'>@@processors</span><span class='period'>.</span><span class='id identifier rubyid_keys'>keys</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
541
+ <span class='kw'>end</span></pre>
542
+ </td>
543
+ </tr>
544
+ </table>
545
+ </div>
546
+
547
+ <div class="method_details ">
548
+ <h3 class="signature " id="processors-class_method">
549
+
550
+ + (<tt>Hash</tt>) <strong>processors</strong>
551
+
552
+
553
+
554
+
555
+
556
+ </h3><div class="docstring">
557
+ <div class="discussion">
558
+
559
+ <p>Getter for the list of processors.</p>
560
+
561
+
562
+ </div>
563
+ </div>
564
+ <div class="tags">
565
+
566
+ <p class="tag_title">Returns:</p>
567
+ <ul class="return">
568
+
569
+ <li>
570
+
571
+
572
+ <span class='type'>(<tt>Hash</tt>)</span>
573
+
574
+
575
+
576
+ &mdash;
577
+ <div class='inline'>
578
+ <p>the list of processors currently available.</p>
579
+ </div>
580
+
581
+ </li>
582
+
583
+ </ul>
584
+
585
+ </div><table class="source_code">
586
+ <tr>
587
+ <td>
588
+ <pre class="lines">
589
+
590
+
591
+ 36
592
+ 37
593
+ 38</pre>
594
+ </td>
595
+ <td>
596
+ <pre class="code"><span class="info file"># File 'lib/kharon.rb', line 36</span>
597
+
598
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_processors'>processors</span>
599
+ <span class='cvar'>@@processors</span>
600
+ <span class='kw'>end</span></pre>
601
+ </td>
602
+ </tr>
603
+ </table>
604
+ </div>
605
+
606
+ <div class="method_details ">
607
+ <h3 class="signature " id="remove_processor-class_method">
608
+
609
+ + (<tt>Object</tt>) <strong>remove_processor</strong>(name)
610
+
611
+
612
+
613
+
614
+
615
+ </h3><div class="docstring">
616
+ <div class="discussion">
617
+
618
+ <p>Removes a processor from the list of available processors.</p>
619
+
620
+
621
+ </div>
622
+ </div>
623
+ <div class="tags">
624
+ <p class="tag_title">Parameters:</p>
625
+ <ul class="param">
626
+
627
+ <li>
628
+
629
+ <span class='name'>name</span>
630
+
631
+
632
+ <span class='type'>(<tt>Symbol</tt>)</span>
633
+
634
+
635
+
636
+ &mdash;
637
+ <div class='inline'>
638
+ <p>the name (key) of the processor to delete.</p>
639
+ </div>
640
+
641
+ </li>
642
+
643
+ </ul>
644
+
645
+
646
+ </div><table class="source_code">
647
+ <tr>
648
+ <td>
649
+ <pre class="lines">
650
+
651
+
652
+ 30
653
+ 31
654
+ 32</pre>
655
+ </td>
656
+ <td>
657
+ <pre class="code"><span class="info file"># File 'lib/kharon.rb', line 30</span>
658
+
659
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_remove_processor'>remove_processor</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
660
+ <span class='cvar'>@@processors</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_has_processor?'>has_processor?</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
661
+ <span class='kw'>end</span></pre>
662
+ </td>
663
+ </tr>
664
+ </table>
287
665
  </div>
288
666
 
289
667
  <div class="method_details ">
@@ -355,7 +733,7 @@ stores error messages.</p>
355
733
  </div>
356
734
 
357
735
  <div id="footer">
358
- Generated on Tue May 17 11:54:24 2016 by
736
+ Generated on Thu Jun 2 16:20:55 2016 by
359
737
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
360
738
  0.8.7.6 (ruby-1.9.3).
361
739
  </div>