kharon 0.5.1 → 1.0.0

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 (55) hide show
  1. checksums.yaml +15 -0
  2. data/.gitignore +1 -0
  3. data/.rspec +2 -1
  4. data/Gemfile +1 -10
  5. data/Gemfile.lock +29 -16
  6. data/README.md +135 -26
  7. data/{kharon-0.0.1.gem → dist/kharon-0.0.1.gem} +0 -0
  8. data/{kharon-0.0.2.gem → dist/kharon-0.0.2.gem} +0 -0
  9. data/{kharon-0.0.3.gem → dist/kharon-0.0.3.gem} +0 -0
  10. data/{kharon-0.1.0.gem → dist/kharon-0.1.0.gem} +0 -0
  11. data/{kharon-0.2.0.gem → dist/kharon-0.2.0.gem} +0 -0
  12. data/{kharon-0.3.0.gem → dist/kharon-0.3.0.gem} +0 -0
  13. data/{kharon-0.3.1.gem → dist/kharon-0.3.1.gem} +0 -0
  14. data/{kharon-0.4.0.gem → dist/kharon-0.4.0.gem} +0 -0
  15. data/{kharon-0.5.0.gem → dist/kharon-0.5.0.gem} +0 -0
  16. data/dist/kharon-0.5.1.gem +0 -0
  17. data/doc/Kharon.html +364 -0
  18. data/doc/Kharon/Configuration.html +452 -0
  19. data/doc/Kharon/Errors.html +145 -0
  20. data/doc/Kharon/Errors/Validation.html +436 -0
  21. data/doc/Kharon/Handlers.html +144 -0
  22. data/doc/Kharon/Handlers/Exceptions.html +273 -0
  23. data/doc/Kharon/Handlers/Messages.html +425 -0
  24. data/doc/Kharon/Helpers.html +277 -0
  25. data/doc/Kharon/Validator.html +1962 -0
  26. data/doc/_index.html +187 -0
  27. data/doc/class_list.html +58 -0
  28. data/doc/css/common.css +1 -0
  29. data/doc/css/full_list.css +57 -0
  30. data/doc/css/style.css +339 -0
  31. data/doc/file.README.html +415 -0
  32. data/doc/file.results.html +1578 -0
  33. data/doc/file_list.html +63 -0
  34. data/doc/frames.html +26 -0
  35. data/doc/index.html +415 -0
  36. data/doc/js/app.js +219 -0
  37. data/doc/js/full_list.js +181 -0
  38. data/doc/js/jquery.js +4 -0
  39. data/doc/method_list.html +207 -0
  40. data/doc/top-level-namespace.html +112 -0
  41. data/kharon.gemspec +9 -1
  42. data/lib/kharon.rb +7 -11
  43. data/lib/kharon/errors.rb +7 -0
  44. data/lib/kharon/errors/validation.rb +2 -0
  45. data/lib/kharon/handlers.rb +8 -0
  46. data/lib/kharon/handlers/exceptions.rb +3 -1
  47. data/lib/kharon/handlers/messages.rb +11 -4
  48. data/lib/kharon/validator.rb +17 -5
  49. data/lib/kharon/version.rb +2 -1
  50. data/spec/lib/kharon/handlers/messages_spec.rb +11 -0
  51. data/spec/lib/kharon/validator_spec.rb +6 -0
  52. data/spec/results.html +1506 -0
  53. metadata +140 -20
  54. data/lib/kharon/configuration.rb +0 -28
  55. data/lib/kharon/helpers/validate.rb +0 -15
@@ -0,0 +1,273 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>
7
+ Class: Kharon::Handlers::Exceptions
8
+
9
+ &mdash; Documentation by YARD 0.8.7.6
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
+ hasFrames = window.top.frames.main ? true : false;
19
+ relpath = '../../';
20
+ framesUrl = "../../frames.html#!Kharon/Handlers/Exceptions.html";
21
+ </script>
22
+
23
+
24
+ <script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
25
+
26
+ <script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
27
+
28
+
29
+ </head>
30
+ <body>
31
+ <div id="header">
32
+ <div id="menu">
33
+
34
+ <a href="../../_index.html">Index (E)</a> &raquo;
35
+ <span class='title'><span class='object_link'><a href="../../Kharon.html" title="Kharon (module)">Kharon</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Handlers.html" title="Kharon::Handlers (module)">Handlers</a></span></span>
36
+ &raquo;
37
+ <span class="title">Exceptions</span>
38
+
39
+
40
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
41
+ </div>
42
+
43
+ <div id="search">
44
+
45
+ <a class="full_list_link" id="class_list_link"
46
+ href="../../class_list.html">
47
+ Class List
48
+ </a>
49
+
50
+ <a class="full_list_link" id="method_list_link"
51
+ href="../../method_list.html">
52
+ Method List
53
+ </a>
54
+
55
+ <a class="full_list_link" id="file_list_link"
56
+ href="../../file_list.html">
57
+ File List
58
+ </a>
59
+
60
+ </div>
61
+ <div class="clear"></div>
62
+ </div>
63
+
64
+ <iframe id="search_frame"></iframe>
65
+
66
+ <div id="content"><h1>Class: Kharon::Handlers::Exceptions
67
+
68
+
69
+
70
+ </h1>
71
+
72
+ <dl class="box">
73
+
74
+ <dt class="r1">Inherits:</dt>
75
+ <dd class="r1">
76
+ <span class="inheritName">Object</span>
77
+
78
+ <ul class="fullTree">
79
+ <li>Object</li>
80
+
81
+ <li class="next">Kharon::Handlers::Exceptions</li>
82
+
83
+ </ul>
84
+ <a href="#" class="inheritanceTree">show all</a>
85
+
86
+ </dd>
87
+
88
+
89
+
90
+
91
+
92
+
93
+ <dt class="r2">Includes:</dt>
94
+ <dd class="r2">Singleton</dd>
95
+
96
+
97
+
98
+
99
+
100
+ <dt class="r1 last">Defined in:</dt>
101
+ <dd class="r1 last">lib/kharon/handlers/exceptions.rb</dd>
102
+
103
+ </dl>
104
+ <div class="clear"></div>
105
+
106
+ <h2>Overview</h2><div class="docstring">
107
+ <div class="discussion">
108
+
109
+ <p>Errors handler that raises exception as soon as a problem is encountered
110
+ during validation.</p>
111
+
112
+
113
+ </div>
114
+ </div>
115
+ <div class="tags">
116
+
117
+ <p class="tag_title">Author:</p>
118
+ <ul class="author">
119
+
120
+ <li>
121
+
122
+
123
+
124
+
125
+
126
+ <div class='inline'>
127
+ <p>Vincent Courtois &lt;courtois.vincent@outlook.com&gt;</p>
128
+ </div>
129
+
130
+ </li>
131
+
132
+ </ul>
133
+
134
+ </div>
135
+
136
+
137
+
138
+
139
+
140
+
141
+
142
+ <h2>
143
+ Instance Method Summary
144
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
145
+ </h2>
146
+
147
+ <ul class="summary">
148
+
149
+ <li class="public ">
150
+ <span class="summary_signature">
151
+
152
+ <a href="#report_error-instance_method" title="#report_error (instance method)">- (Object) <strong>report_error</strong>(error_hash) </a>
153
+
154
+
155
+
156
+ </span>
157
+
158
+
159
+
160
+
161
+
162
+
163
+
164
+
165
+
166
+ <span class="summary_desc"><div class='inline'>
167
+ <p>Method used to report an error by raising the correct type of exception.</p>
168
+ </div></span>
169
+
170
+ </li>
171
+
172
+
173
+ </ul>
174
+
175
+
176
+
177
+
178
+
179
+ <div id="instance_method_details" class="method_details_list">
180
+ <h2>Instance Method Details</h2>
181
+
182
+
183
+ <div class="method_details first">
184
+ <h3 class="signature first" id="report_error-instance_method">
185
+
186
+ - (<tt>Object</tt>) <strong>report_error</strong>(error_hash)
187
+
188
+
189
+
190
+
191
+
192
+ </h3><div class="docstring">
193
+ <div class="discussion">
194
+
195
+ <p>Method used to report an error by raising the correct type of exception.</p>
196
+
197
+
198
+ </div>
199
+ </div>
200
+ <div class="tags">
201
+ <p class="tag_title">Parameters:</p>
202
+ <ul class="param">
203
+
204
+ <li>
205
+
206
+ <span class='name'>error_hash</span>
207
+
208
+
209
+ <span class='type'>(<tt>Hash</tt>)</span>
210
+
211
+
212
+
213
+ &mdash;
214
+ <div class='inline'>
215
+ <p>a Hash describing the error.</p>
216
+ </div>
217
+
218
+ </li>
219
+
220
+ </ul>
221
+
222
+ <p class="tag_title">Raises:</p>
223
+ <ul class="raise">
224
+
225
+ <li>
226
+
227
+
228
+ <span class='type'>(<tt><span class='object_link'><a href="../Errors/Validation.html" title="Kharon::Errors::Validation (class)">Kharon::Errors::Validation</a></span></tt>)</span>
229
+
230
+
231
+
232
+ &mdash;
233
+ <div class='inline'>
234
+ <p>the exception raised when an error is encountered.</p>
235
+ </div>
236
+
237
+ </li>
238
+
239
+ </ul>
240
+
241
+ </div><table class="source_code">
242
+ <tr>
243
+ <td>
244
+ <pre class="lines">
245
+
246
+
247
+ 14
248
+ 15
249
+ 16</pre>
250
+ </td>
251
+ <td>
252
+ <pre class="code"><span class="info file"># File 'lib/kharon/handlers/exceptions.rb', line 14</span>
253
+
254
+ <span class='kw'>def</span> <span class='id identifier rubyid_report_error'>report_error</span><span class='lparen'>(</span><span class='id identifier rubyid_error_hash'>error_hash</span><span class='rparen'>)</span>
255
+ <span class='id identifier rubyid_raise'>raise</span> <span class='const'>Kharon</span><span class='op'>::</span><span class='const'>Errors</span><span class='op'>::</span><span class='const'>Validation</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_error_hash'>error_hash</span><span class='rparen'>)</span>
256
+ <span class='kw'>end</span></pre>
257
+ </td>
258
+ </tr>
259
+ </table>
260
+ </div>
261
+
262
+ </div>
263
+
264
+ </div>
265
+
266
+ <div id="footer">
267
+ Generated on Tue Sep 15 10:54:08 2015 by
268
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
269
+ 0.8.7.6 (ruby-1.9.3).
270
+ </div>
271
+
272
+ </body>
273
+ </html>
@@ -0,0 +1,425 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>
7
+ Class: Kharon::Handlers::Messages
8
+
9
+ &mdash; Documentation by YARD 0.8.7.6
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
+ hasFrames = window.top.frames.main ? true : false;
19
+ relpath = '../../';
20
+ framesUrl = "../../frames.html#!Kharon/Handlers/Messages.html";
21
+ </script>
22
+
23
+
24
+ <script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
25
+
26
+ <script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
27
+
28
+
29
+ </head>
30
+ <body>
31
+ <div id="header">
32
+ <div id="menu">
33
+
34
+ <a href="../../_index.html">Index (M)</a> &raquo;
35
+ <span class='title'><span class='object_link'><a href="../../Kharon.html" title="Kharon (module)">Kharon</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Handlers.html" title="Kharon::Handlers (module)">Handlers</a></span></span>
36
+ &raquo;
37
+ <span class="title">Messages</span>
38
+
39
+
40
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
41
+ </div>
42
+
43
+ <div id="search">
44
+
45
+ <a class="full_list_link" id="class_list_link"
46
+ href="../../class_list.html">
47
+ Class List
48
+ </a>
49
+
50
+ <a class="full_list_link" id="method_list_link"
51
+ href="../../method_list.html">
52
+ Method List
53
+ </a>
54
+
55
+ <a class="full_list_link" id="file_list_link"
56
+ href="../../file_list.html">
57
+ File List
58
+ </a>
59
+
60
+ </div>
61
+ <div class="clear"></div>
62
+ </div>
63
+
64
+ <iframe id="search_frame"></iframe>
65
+
66
+ <div id="content"><h1>Class: Kharon::Handlers::Messages
67
+
68
+
69
+
70
+ </h1>
71
+
72
+ <dl class="box">
73
+
74
+ <dt class="r1">Inherits:</dt>
75
+ <dd class="r1">
76
+ <span class="inheritName">Object</span>
77
+
78
+ <ul class="fullTree">
79
+ <li>Object</li>
80
+
81
+ <li class="next">Kharon::Handlers::Messages</li>
82
+
83
+ </ul>
84
+ <a href="#" class="inheritanceTree">show all</a>
85
+
86
+ </dd>
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+ <dt class="r2 last">Defined in:</dt>
97
+ <dd class="r2 last">lib/kharon/handlers/messages.rb</dd>
98
+
99
+ </dl>
100
+ <div class="clear"></div>
101
+
102
+ <h2>Overview</h2><div class="docstring">
103
+ <div class="discussion">
104
+
105
+ <p>Errors handler that stores each problem encountered during validation.</p>
106
+
107
+
108
+ </div>
109
+ </div>
110
+ <div class="tags">
111
+
112
+ <p class="tag_title">Author:</p>
113
+ <ul class="author">
114
+
115
+ <li>
116
+
117
+
118
+
119
+
120
+
121
+ <div class='inline'>
122
+ <p>Vincent Courtois &lt;courtois.vincent@outlook.com&gt;</p>
123
+ </div>
124
+
125
+ </li>
126
+
127
+ </ul>
128
+
129
+ </div>
130
+
131
+
132
+
133
+
134
+
135
+
136
+
137
+ <h2>
138
+ Instance Method Summary
139
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
140
+ </h2>
141
+
142
+ <ul class="summary">
143
+
144
+ <li class="public ">
145
+ <span class="summary_signature">
146
+
147
+ <a href="#errors-instance_method" title="#errors (instance method)">- (Array) <strong>errors</strong> </a>
148
+
149
+
150
+
151
+ </span>
152
+
153
+
154
+
155
+
156
+
157
+
158
+
159
+
160
+
161
+ <span class="summary_desc"><div class='inline'>
162
+ <p>Getter for the errors, cloning it so no error can be added from outside of
163
+ the report_error method.</p>
164
+ </div></span>
165
+
166
+ </li>
167
+
168
+
169
+ <li class="public ">
170
+ <span class="summary_signature">
171
+
172
+ <a href="#initialize-instance_method" title="#initialize (instance method)">- (Messages) <strong>initialize</strong> </a>
173
+
174
+
175
+
176
+ </span>
177
+
178
+
179
+ <span class="note title constructor">constructor</span>
180
+
181
+
182
+
183
+
184
+
185
+
186
+
187
+
188
+ <span class="summary_desc"><div class='inline'>
189
+ <p>Constructor of the class, initializing the errors array.</p>
190
+ </div></span>
191
+
192
+ </li>
193
+
194
+
195
+ <li class="public ">
196
+ <span class="summary_signature">
197
+
198
+ <a href="#report_error-instance_method" title="#report_error (instance method)">- (Kharon::Handlers::Messages) <strong>report_error</strong>(error_hash) </a>
199
+
200
+
201
+
202
+ </span>
203
+
204
+
205
+
206
+
207
+
208
+
209
+
210
+
211
+
212
+ <span class="summary_desc"><div class='inline'>
213
+ <p>Method used to report an error by storing it in an array.</p>
214
+ </div></span>
215
+
216
+ </li>
217
+
218
+
219
+ </ul>
220
+
221
+
222
+ <div id="constructor_details" class="method_details_list">
223
+ <h2>Constructor Details</h2>
224
+
225
+ <div class="method_details first">
226
+ <h3 class="signature first" id="initialize-instance_method">
227
+
228
+ - (<tt><span class='object_link'><a href="" title="Kharon::Handlers::Messages (class)">Messages</a></span></tt>) <strong>initialize</strong>
229
+
230
+
231
+
232
+
233
+
234
+ </h3><div class="docstring">
235
+ <div class="discussion">
236
+
237
+ <p>Constructor of the class, initializing the errors array.</p>
238
+
239
+
240
+ </div>
241
+ </div>
242
+ <div class="tags">
243
+
244
+
245
+ </div><table class="source_code">
246
+ <tr>
247
+ <td>
248
+ <pre class="lines">
249
+
250
+
251
+ 9
252
+ 10
253
+ 11</pre>
254
+ </td>
255
+ <td>
256
+ <pre class="code"><span class="info file"># File 'lib/kharon/handlers/messages.rb', line 9</span>
257
+
258
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span>
259
+ <span class='ivar'>@errors</span> <span class='op'>=</span> <span class='const'>Array</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
260
+ <span class='kw'>end</span></pre>
261
+ </td>
262
+ </tr>
263
+ </table>
264
+ </div>
265
+
266
+ </div>
267
+
268
+
269
+ <div id="instance_method_details" class="method_details_list">
270
+ <h2>Instance Method Details</h2>
271
+
272
+
273
+ <div class="method_details first">
274
+ <h3 class="signature first" id="errors-instance_method">
275
+
276
+ - (<tt>Array</tt>) <strong>errors</strong>
277
+
278
+
279
+
280
+
281
+
282
+ </h3><div class="docstring">
283
+ <div class="discussion">
284
+
285
+ <p>Getter for the errors, cloning it so no error can be added from outside of
286
+ the report_error method</p>
287
+
288
+
289
+ </div>
290
+ </div>
291
+ <div class="tags">
292
+
293
+ <p class="tag_title">Returns:</p>
294
+ <ul class="return">
295
+
296
+ <li>
297
+
298
+
299
+ <span class='type'>(<tt>Array</tt>)</span>
300
+
301
+
302
+
303
+ &mdash;
304
+ <div class='inline'>
305
+ <p>the array of errors.</p>
306
+ </div>
307
+
308
+ </li>
309
+
310
+ </ul>
311
+
312
+ </div><table class="source_code">
313
+ <tr>
314
+ <td>
315
+ <pre class="lines">
316
+
317
+
318
+ 23
319
+ 24
320
+ 25</pre>
321
+ </td>
322
+ <td>
323
+ <pre class="code"><span class="info file"># File 'lib/kharon/handlers/messages.rb', line 23</span>
324
+
325
+ <span class='kw'>def</span> <span class='id identifier rubyid_errors'>errors</span>
326
+ <span class='ivar'>@errors</span><span class='period'>.</span><span class='id identifier rubyid_clone'>clone</span>
327
+ <span class='kw'>end</span></pre>
328
+ </td>
329
+ </tr>
330
+ </table>
331
+ </div>
332
+
333
+ <div class="method_details ">
334
+ <h3 class="signature " id="report_error-instance_method">
335
+
336
+ - (<tt><span class='object_link'><a href="" title="Kharon::Handlers::Messages (class)">Kharon::Handlers::Messages</a></span></tt>) <strong>report_error</strong>(error_hash)
337
+
338
+
339
+
340
+
341
+
342
+ </h3><div class="docstring">
343
+ <div class="discussion">
344
+
345
+ <p>Method used to report an error by storing it in an array.</p>
346
+
347
+
348
+ </div>
349
+ </div>
350
+ <div class="tags">
351
+ <p class="tag_title">Parameters:</p>
352
+ <ul class="param">
353
+
354
+ <li>
355
+
356
+ <span class='name'>error_hash</span>
357
+
358
+
359
+ <span class='type'>(<tt>Hash</tt>)</span>
360
+
361
+
362
+
363
+ &mdash;
364
+ <div class='inline'>
365
+ <p>a Hash describing the error.</p>
366
+ </div>
367
+
368
+ </li>
369
+
370
+ </ul>
371
+
372
+ <p class="tag_title">Returns:</p>
373
+ <ul class="return">
374
+
375
+ <li>
376
+
377
+
378
+ <span class='type'>(<tt><span class='object_link'><a href="" title="Kharon::Handlers::Messages (class)">Kharon::Handlers::Messages</a></span></tt>)</span>
379
+
380
+
381
+
382
+ &mdash;
383
+ <div class='inline'>
384
+ <p>the errors handler after insertion, so several calls can be chained.</p>
385
+ </div>
386
+
387
+ </li>
388
+
389
+ </ul>
390
+
391
+ </div><table class="source_code">
392
+ <tr>
393
+ <td>
394
+ <pre class="lines">
395
+
396
+
397
+ 16
398
+ 17
399
+ 18
400
+ 19</pre>
401
+ </td>
402
+ <td>
403
+ <pre class="code"><span class="info file"># File 'lib/kharon/handlers/messages.rb', line 16</span>
404
+
405
+ <span class='kw'>def</span> <span class='id identifier rubyid_report_error'>report_error</span><span class='lparen'>(</span><span class='id identifier rubyid_error_hash'>error_hash</span><span class='rparen'>)</span>
406
+ <span class='ivar'>@errors</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span><span class='lparen'>(</span><span class='id identifier rubyid_error_hash'>error_hash</span><span class='rparen'>)</span>
407
+ <span class='kw'>self</span>
408
+ <span class='kw'>end</span></pre>
409
+ </td>
410
+ </tr>
411
+ </table>
412
+ </div>
413
+
414
+ </div>
415
+
416
+ </div>
417
+
418
+ <div id="footer">
419
+ Generated on Tue Sep 15 10:54:08 2015 by
420
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
421
+ 0.8.7.6 (ruby-1.9.3).
422
+ </div>
423
+
424
+ </body>
425
+ </html>