env_parser 1.2.0 → 1.3.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.
- checksums.yaml +4 -4
- data/.rubocop.yml +48 -57
- data/Gemfile.lock +19 -1
- data/README.md +214 -125
- data/docs/EnvParser.html +214 -32
- data/docs/EnvParser/AutoregisterFileNotFound.html +144 -0
- data/docs/EnvParser/Error.html +2 -2
- data/docs/EnvParser/TypeAlreadyDefinedError.html +1 -1
- data/docs/EnvParser/Types.html +1 -1
- data/docs/EnvParser/Types/BaseTypes.html +1 -1
- data/docs/EnvParser/Types/ChronologyTypes.html +1 -1
- data/docs/EnvParser/Types/InternetTypes.html +1 -1
- data/docs/EnvParser/UnknownTypeError.html +1 -1
- data/docs/EnvParser/UnparseableAutoregisterSpec.html +144 -0
- data/docs/EnvParser/ValueNotAllowedError.html +1 -1
- data/docs/EnvParser/ValueNotConvertibleError.html +1 -1
- data/docs/_index.html +26 -1
- data/docs/class_list.html +1 -1
- data/docs/file.README.html +296 -169
- data/docs/index.html +296 -169
- data/docs/method_list.html +11 -3
- data/docs/top-level-namespace.html +1 -1
- data/env_parser.gemspec +2 -0
- data/lib/env_parser.rb +47 -3
- data/lib/env_parser/autoregister.rb +3 -0
- data/lib/env_parser/errors.rb +12 -0
- data/lib/env_parser/types/chronology_types.rb +1 -1
- data/lib/env_parser/types/internet_types.rb +2 -2
- data/lib/env_parser/version.rb +1 -1
- metadata +33 -2
data/docs/EnvParser.html
CHANGED
@@ -121,7 +121,7 @@ different data types.</p>
|
|
121
121
|
|
122
122
|
|
123
123
|
|
124
|
-
<strong class="classes">Classes:</strong> <span class='object_link'><a href="EnvParser/Error.html" title="EnvParser::Error (class)">Error</a></span>, <span class='object_link'><a href="EnvParser/TypeAlreadyDefinedError.html" title="EnvParser::TypeAlreadyDefinedError (class)">TypeAlreadyDefinedError</a></span>, <span class='object_link'><a href="EnvParser/UnknownTypeError.html" title="EnvParser::UnknownTypeError (class)">UnknownTypeError</a></span>, <span class='object_link'><a href="EnvParser/ValueNotAllowedError.html" title="EnvParser::ValueNotAllowedError (class)">ValueNotAllowedError</a></span>, <span class='object_link'><a href="EnvParser/ValueNotConvertibleError.html" title="EnvParser::ValueNotConvertibleError (class)">ValueNotConvertibleError</a></span>
|
124
|
+
<strong class="classes">Classes:</strong> <span class='object_link'><a href="EnvParser/AutoregisterFileNotFound.html" title="EnvParser::AutoregisterFileNotFound (class)">AutoregisterFileNotFound</a></span>, <span class='object_link'><a href="EnvParser/Error.html" title="EnvParser::Error (class)">Error</a></span>, <span class='object_link'><a href="EnvParser/TypeAlreadyDefinedError.html" title="EnvParser::TypeAlreadyDefinedError (class)">TypeAlreadyDefinedError</a></span>, <span class='object_link'><a href="EnvParser/UnknownTypeError.html" title="EnvParser::UnknownTypeError (class)">UnknownTypeError</a></span>, <span class='object_link'><a href="EnvParser/UnparseableAutoregisterSpec.html" title="EnvParser::UnparseableAutoregisterSpec (class)">UnparseableAutoregisterSpec</a></span>, <span class='object_link'><a href="EnvParser/ValueNotAllowedError.html" title="EnvParser::ValueNotAllowedError (class)">ValueNotAllowedError</a></span>, <span class='object_link'><a href="EnvParser/ValueNotConvertibleError.html" title="EnvParser::ValueNotConvertibleError (class)">ValueNotConvertibleError</a></span>
|
125
125
|
|
126
126
|
|
127
127
|
</p>
|
@@ -134,10 +134,26 @@ different data types.</p>
|
|
134
134
|
|
135
135
|
<dl class="constants">
|
136
136
|
|
137
|
+
<dt id="AUTOREGISTER_FILE-constant" class="">AUTOREGISTER_FILE =
|
138
|
+
<div class="docstring">
|
139
|
+
<div class="discussion">
|
140
|
+
|
141
|
+
<p>The default filename to use for <span class='object_link'><a href="#autoregister-class_method" title="EnvParser.autoregister (method)">autoregister</a></span> requests.</p>
|
142
|
+
|
143
|
+
|
144
|
+
</div>
|
145
|
+
</div>
|
146
|
+
<div class="tags">
|
147
|
+
|
148
|
+
|
149
|
+
</div>
|
150
|
+
</dt>
|
151
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>.env_parser.yml</span><span class='tstring_end'>'</span></span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span></pre></dd>
|
152
|
+
|
137
153
|
<dt id="VERSION-constant" class="">VERSION =
|
138
154
|
|
139
155
|
</dt>
|
140
|
-
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>1.
|
156
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>1.3.0</span><span class='tstring_end'>'</span></span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span></pre></dd>
|
141
157
|
|
142
158
|
</dl>
|
143
159
|
|
@@ -177,6 +193,31 @@ different data types.</p>
|
|
177
193
|
<p>Creates ENV bindings for <span class='object_link'><a href="#parse-class_method" title="EnvParser.parse (method)">EnvParser.parse</a></span> and <span class='object_link'><a href="#register-class_method" title="EnvParser.register (method)">EnvParser.register</a></span> proxy methods.</p>
|
178
194
|
</div></span>
|
179
195
|
|
196
|
+
</li>
|
197
|
+
|
198
|
+
|
199
|
+
<li class="public ">
|
200
|
+
<span class="summary_signature">
|
201
|
+
|
202
|
+
<a href="#autoregister-class_method" title="autoregister (class method)">.<strong>autoregister</strong>(filename = nil) ⇒ Hash </a>
|
203
|
+
|
204
|
+
|
205
|
+
|
206
|
+
</span>
|
207
|
+
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
|
216
|
+
<span class="summary_desc"><div class='inline'>
|
217
|
+
<p>Reads an “autoregister” file and registers the ENV constants defined
|
218
|
+
therein.</p>
|
219
|
+
</div></span>
|
220
|
+
|
180
221
|
</li>
|
181
222
|
|
182
223
|
|
@@ -312,9 +353,6 @@ is equivalent to <a href="'XYZ'">EnvParser.parse(ENV</a>, …)</p>
|
|
312
353
|
<pre class="lines">
|
313
354
|
|
314
355
|
|
315
|
-
216
|
316
|
-
217
|
317
|
-
218
|
318
356
|
219
|
319
357
|
220
|
320
358
|
221
|
@@ -324,10 +362,13 @@ is equivalent to <a href="'XYZ'">EnvParser.parse(ENV</a>, …)</p>
|
|
324
362
|
225
|
325
363
|
226
|
326
364
|
227
|
327
|
-
228
|
365
|
+
228
|
366
|
+
229
|
367
|
+
230
|
368
|
+
231</pre>
|
328
369
|
</td>
|
329
370
|
<td>
|
330
|
-
<pre class="code"><span class="info file"># File 'lib/env_parser.rb', line
|
371
|
+
<pre class="code"><span class="info file"># File 'lib/env_parser.rb', line 219</span>
|
331
372
|
|
332
373
|
<span class='kw'>def</span> <span class='id identifier rubyid_add_env_bindings'>add_env_bindings</span>
|
333
374
|
<span class='const'>ENV</span><span class='period'>.</span><span class='id identifier rubyid_instance_eval'>instance_eval</span> <span class='kw'>do</span>
|
@@ -345,6 +386,151 @@ is equivalent to <a href="'XYZ'">EnvParser.parse(ENV</a>, …)</p>
|
|
345
386
|
</td>
|
346
387
|
</tr>
|
347
388
|
</table>
|
389
|
+
</div>
|
390
|
+
|
391
|
+
<div class="method_details ">
|
392
|
+
<h3 class="signature " id="autoregister-class_method">
|
393
|
+
|
394
|
+
.<strong>autoregister</strong>(filename = nil) ⇒ <tt>Hash</tt>
|
395
|
+
|
396
|
+
|
397
|
+
|
398
|
+
|
399
|
+
|
400
|
+
</h3><div class="docstring">
|
401
|
+
<div class="discussion">
|
402
|
+
|
403
|
+
<p>Reads an “autoregister” file and registers the ENV constants defined
|
404
|
+
therein.</p>
|
405
|
+
|
406
|
+
<p>The “autoregister” file is read, parsed as YAML, sanitized for use as a
|
407
|
+
parameter to <span class='object_link'>register_all</span>, and then passed along for processing. The
|
408
|
+
return value from that <span class='object_link'>register_all</span> call is passed through.</p>
|
409
|
+
|
410
|
+
|
411
|
+
</div>
|
412
|
+
</div>
|
413
|
+
<div class="tags">
|
414
|
+
<p class="tag_title">Parameters:</p>
|
415
|
+
<ul class="param">
|
416
|
+
|
417
|
+
<li>
|
418
|
+
|
419
|
+
<span class='name'>filename</span>
|
420
|
+
|
421
|
+
|
422
|
+
<span class='type'>(<tt>String</tt>)</span>
|
423
|
+
|
424
|
+
|
425
|
+
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
426
|
+
|
427
|
+
|
428
|
+
—
|
429
|
+
<div class='inline'>
|
430
|
+
<p>A path for the autoregister file to parse and process. Defaults to
|
431
|
+
<span class='object_link'><a href="#AUTOREGISTER_FILE-constant" title="EnvParser::AUTOREGISTER_FILE (constant)">AUTOREGISTER_FILE</a></span> if unset.</p>
|
432
|
+
</div>
|
433
|
+
|
434
|
+
</li>
|
435
|
+
|
436
|
+
</ul>
|
437
|
+
|
438
|
+
<p class="tag_title">Returns:</p>
|
439
|
+
<ul class="return">
|
440
|
+
|
441
|
+
<li>
|
442
|
+
|
443
|
+
|
444
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
445
|
+
|
446
|
+
|
447
|
+
|
448
|
+
—
|
449
|
+
<div class='inline'>
|
450
|
+
<p>The return value from the <span class='object_link'>register_all</span> call that handles the actual
|
451
|
+
registration.</p>
|
452
|
+
</div>
|
453
|
+
|
454
|
+
</li>
|
455
|
+
|
456
|
+
</ul>
|
457
|
+
<p class="tag_title">Raises:</p>
|
458
|
+
<ul class="raise">
|
459
|
+
|
460
|
+
<li>
|
461
|
+
|
462
|
+
|
463
|
+
<span class='type'>(<tt><span class='object_link'><a href="EnvParser/AutoregisterFileNotFound.html" title="EnvParser::AutoregisterFileNotFound (class)">EnvParser::AutoregisterFileNotFound</a></span></tt>, <tt><span class='object_link'><a href="EnvParser/UnparseableAutoregisterSpec.html" title="EnvParser::UnparseableAutoregisterSpec (class)">EnvParser::UnparseableAutoregisterSpec</a></span></tt>)</span>
|
464
|
+
|
465
|
+
|
466
|
+
|
467
|
+
</li>
|
468
|
+
|
469
|
+
</ul>
|
470
|
+
|
471
|
+
</div><table class="source_code">
|
472
|
+
<tr>
|
473
|
+
<td>
|
474
|
+
<pre class="lines">
|
475
|
+
|
476
|
+
|
477
|
+
248
|
478
|
+
249
|
479
|
+
250
|
480
|
+
251
|
481
|
+
252
|
482
|
+
253
|
483
|
+
254
|
484
|
+
255
|
485
|
+
256
|
486
|
+
257
|
487
|
+
258
|
488
|
+
259
|
489
|
+
260
|
490
|
+
261
|
491
|
+
262
|
492
|
+
263
|
493
|
+
264
|
494
|
+
265
|
495
|
+
266
|
496
|
+
267
|
497
|
+
268
|
498
|
+
269
|
499
|
+
270
|
500
|
+
271
|
501
|
+
272</pre>
|
502
|
+
</td>
|
503
|
+
<td>
|
504
|
+
<pre class="code"><span class="info file"># File 'lib/env_parser.rb', line 248</span>
|
505
|
+
|
506
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_autoregister'>autoregister</span><span class='lparen'>(</span><span class='id identifier rubyid_filename'><span class='object_link'><a href="top-level-namespace.html#filename-instance_method" title="#filename (method)">filename</a></span></span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
507
|
+
<span class='id identifier rubyid_filename'><span class='object_link'><a href="top-level-namespace.html#filename-instance_method" title="#filename (method)">filename</a></span></span> <span class='op'>||=</span> <span class='const'><span class='object_link'><a href="#AUTOREGISTER_FILE-constant" title="EnvParser::AUTOREGISTER_FILE (constant)">AUTOREGISTER_FILE</a></span></span>
|
508
|
+
<span class='id identifier rubyid_autoregister_spec'>autoregister_spec</span> <span class='op'>=</span> <span class='const'>Psych</span><span class='period'>.</span><span class='id identifier rubyid_load_file'>load_file</span><span class='lparen'>(</span><span class='id identifier rubyid_filename'><span class='object_link'><a href="top-level-namespace.html#filename-instance_method" title="#filename (method)">filename</a></span></span><span class='rparen'>)</span>
|
509
|
+
|
510
|
+
<span class='id identifier rubyid_autoregister_spec'>autoregister_spec</span><span class='period'>.</span><span class='id identifier rubyid_deep_symbolize_keys!'>deep_symbolize_keys!</span>
|
511
|
+
<span class='id identifier rubyid_autoregister_spec'>autoregister_spec</span><span class='period'>.</span><span class='id identifier rubyid_transform_values!'>transform_values!</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_spec'>spec</span><span class='op'>|</span>
|
512
|
+
<span class='id identifier rubyid_sanitized'>sanitized</span> <span class='op'>=</span> <span class='id identifier rubyid_spec'>spec</span><span class='period'>.</span><span class='id identifier rubyid_slice'>slice</span><span class='lparen'>(</span><span class='symbol'>:as</span><span class='comma'>,</span> <span class='symbol'>:within</span><span class='comma'>,</span> <span class='symbol'>:if_unset</span><span class='comma'>,</span> <span class='symbol'>:from_set</span><span class='rparen'>)</span>
|
513
|
+
<span class='id identifier rubyid_sanitized'>sanitized</span><span class='lbracket'>[</span><span class='symbol'>:as</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_sanitized'>sanitized</span><span class='lbracket'>[</span><span class='symbol'>:as</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span> <span class='kw'>if</span> <span class='id identifier rubyid_sanitized'>sanitized</span><span class='period'>.</span><span class='id identifier rubyid_key?'>key?</span> <span class='symbol'>:as</span>
|
514
|
+
<span class='id identifier rubyid_sanitized'>sanitized</span><span class='lbracket'>[</span><span class='symbol'>:within</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_sanitized'>sanitized</span><span class='lbracket'>[</span><span class='symbol'>:within</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_constantize'>constantize</span> <span class='kw'>if</span> <span class='id identifier rubyid_sanitized'>sanitized</span><span class='period'>.</span><span class='id identifier rubyid_key?'>key?</span> <span class='symbol'>:within</span>
|
515
|
+
|
516
|
+
<span class='id identifier rubyid_sanitized'>sanitized</span>
|
517
|
+
<span class='kw'>end</span>
|
518
|
+
|
519
|
+
<span class='id identifier rubyid_register_all'>register_all</span> <span class='id identifier rubyid_autoregister_spec'>autoregister_spec</span>
|
520
|
+
|
521
|
+
<span class='comment'>## Psych raises an Errno::ENOENT on file-not-found.
|
522
|
+
</span><span class='comment'>##
|
523
|
+
</span><span class='kw'>rescue</span> <span class='const'>Errno</span><span class='op'>::</span><span class='const'>ENOENT</span>
|
524
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='const'><span class='object_link'><a href="" title="EnvParser (class)">EnvParser</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="EnvParser/AutoregisterFileNotFound.html" title="EnvParser::AutoregisterFileNotFound (class)">AutoregisterFileNotFound</a></span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>%(</span><span class='tstring_content'>file not found: "</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_filename'><span class='object_link'><a href="top-level-namespace.html#filename-instance_method" title="#filename (method)">filename</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>"</span><span class='tstring_end'>)</span></span>
|
525
|
+
|
526
|
+
<span class='comment'>## Psych raises a Psych::SyntaxError on unparseable YAML.
|
527
|
+
</span><span class='comment'>##
|
528
|
+
</span><span class='kw'>rescue</span> <span class='const'>Psych</span><span class='op'>::</span><span class='const'>SyntaxError</span> <span class='op'>=></span> <span class='id identifier rubyid_e'>e</span>
|
529
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='const'><span class='object_link'><a href="" title="EnvParser (class)">EnvParser</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="EnvParser/UnparseableAutoregisterSpec.html" title="EnvParser::UnparseableAutoregisterSpec (class)">UnparseableAutoregisterSpec</a></span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>malformed YAML in spec file: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
530
|
+
<span class='kw'>end</span></pre>
|
531
|
+
</td>
|
532
|
+
</tr>
|
533
|
+
</table>
|
348
534
|
</div>
|
349
535
|
|
350
536
|
<div class="method_details ">
|
@@ -514,11 +700,6 @@ block should raise an <span class='object_link'><a href="EnvParser/ValueNotConve
|
|
514
700
|
<pre class="lines">
|
515
701
|
|
516
702
|
|
517
|
-
39
|
518
|
-
40
|
519
|
-
41
|
520
|
-
42
|
521
|
-
43
|
522
703
|
44
|
523
704
|
45
|
524
705
|
46
|
@@ -528,10 +709,15 @@ block should raise an <span class='object_link'><a href="EnvParser/ValueNotConve
|
|
528
709
|
50
|
529
710
|
51
|
530
711
|
52
|
531
|
-
53
|
712
|
+
53
|
713
|
+
54
|
714
|
+
55
|
715
|
+
56
|
716
|
+
57
|
717
|
+
58</pre>
|
532
718
|
</td>
|
533
719
|
<td>
|
534
|
-
<pre class="code"><span class="info file"># File 'lib/env_parser.rb', line
|
720
|
+
<pre class="code"><span class="info file"># File 'lib/env_parser.rb', line 44</span>
|
535
721
|
|
536
722
|
<span class='kw'>def</span> <span class='id identifier rubyid_define_type'>define_type</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_parser'>parser</span><span class='rparen'>)</span>
|
537
723
|
<span class='id identifier rubyid_raise'>raise</span><span class='lparen'>(</span><span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>no parsing block given</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='kw'>unless</span> <span class='id identifier rubyid_block_given?'>block_given?</span>
|
@@ -750,11 +936,6 @@ pass.</strong></p>
|
|
750
936
|
<pre class="lines">
|
751
937
|
|
752
938
|
|
753
|
-
107
|
754
|
-
108
|
755
|
-
109
|
756
|
-
110
|
757
|
-
111
|
758
939
|
112
|
759
940
|
113
|
760
941
|
114
|
@@ -765,10 +946,15 @@ pass.</strong></p>
|
|
765
946
|
119
|
766
947
|
120
|
767
948
|
121
|
768
|
-
122
|
949
|
+
122
|
950
|
+
123
|
951
|
+
124
|
952
|
+
125
|
953
|
+
126
|
954
|
+
127</pre>
|
769
955
|
</td>
|
770
956
|
<td>
|
771
|
-
<pre class="code"><span class="info file"># File 'lib/env_parser.rb', line
|
957
|
+
<pre class="code"><span class="info file"># File 'lib/env_parser.rb', line 112</span>
|
772
958
|
|
773
959
|
<span class='kw'>def</span> <span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_validation_block'>validation_block</span><span class='rparen'>)</span>
|
774
960
|
<span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='const'>ENV</span><span class='lbracket'>[</span><span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='rbracket'>]</span> <span class='kw'>if</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span> <span class='const'>Symbol</span>
|
@@ -1003,11 +1189,6 @@ each value needing validation must give its own “validated_by” Proc.</p>
|
|
1003
1189
|
<pre class="lines">
|
1004
1190
|
|
1005
1191
|
|
1006
|
-
173
|
1007
|
-
174
|
1008
|
-
175
|
1009
|
-
176
|
1010
|
-
177
|
1011
1192
|
178
|
1012
1193
|
179
|
1013
1194
|
180
|
@@ -1035,10 +1216,13 @@ each value needing validation must give its own “validated_by” Proc.</p>
|
|
1035
1216
|
202
|
1036
1217
|
203
|
1037
1218
|
204
|
1038
|
-
205
|
1219
|
+
205
|
1220
|
+
206
|
1221
|
+
207
|
1222
|
+
208</pre>
|
1039
1223
|
</td>
|
1040
1224
|
<td>
|
1041
|
-
<pre class="code"><span class="info file"># File 'lib/env_parser.rb', line
|
1225
|
+
<pre class="code"><span class="info file"># File 'lib/env_parser.rb', line 178</span>
|
1042
1226
|
|
1043
1227
|
<span class='kw'>def</span> <span class='id identifier rubyid_register'>register</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_validation_block'>validation_block</span><span class='rparen'>)</span>
|
1044
1228
|
<span class='comment'>## Allow for registering multiple variables simultaneously via a single call.
|
@@ -1059,9 +1243,7 @@ each value needing validation must give its own “validated_by” Proc.</p>
|
|
1059
1243
|
<span class='id identifier rubyid_name'>name</span> <span class='op'>=</span> <span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
|
1060
1244
|
<span class='kw'>end</span>
|
1061
1245
|
|
1062
|
-
<span class='kw'>unless</span> <span class='id identifier rubyid_from'>from</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span> <span class='const'>Hash</span>
|
1063
|
-
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>invalid `from` parameter: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_from'>from</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
1064
|
-
<span class='kw'>end</span>
|
1246
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>invalid `from` parameter: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_from'>from</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_from'>from</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span> <span class='const'>Hash</span>
|
1065
1247
|
|
1066
1248
|
<span class='kw'>unless</span> <span class='id identifier rubyid_within'>within</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Module</span><span class='rparen'>)</span> <span class='op'>||</span> <span class='id identifier rubyid_within'>within</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Class</span><span class='rparen'>)</span>
|
1067
1249
|
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>invalid `within` parameter: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_within'>within</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
@@ -1083,7 +1265,7 @@ each value needing validation must give its own “validated_by” Proc.</p>
|
|
1083
1265
|
</div>
|
1084
1266
|
|
1085
1267
|
<div id="footer">
|
1086
|
-
Generated on
|
1268
|
+
Generated on Sun Nov 3 21:30:37 2019 by
|
1087
1269
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1088
1270
|
0.9.20 (ruby-2.4.2).
|
1089
1271
|
</div>
|
@@ -0,0 +1,144 @@
|
|
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
|
+
Exception: EnvParser::AutoregisterFileNotFound
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.20
|
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 = "EnvParser::AutoregisterFileNotFound";
|
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 (A)</a> »
|
40
|
+
<span class='title'><span class='object_link'><a href="../EnvParser.html" title="EnvParser (class)">EnvParser</a></span></span>
|
41
|
+
»
|
42
|
+
<span class="title">AutoregisterFileNotFound</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>Exception: EnvParser::AutoregisterFileNotFound
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
<dl>
|
70
|
+
<dt>Inherits:</dt>
|
71
|
+
<dd>
|
72
|
+
<span class="inheritName"><span class='object_link'><a href="Error.html" title="EnvParser::Error (class)">Error</a></span></span>
|
73
|
+
|
74
|
+
<ul class="fullTree">
|
75
|
+
<li>Object</li>
|
76
|
+
|
77
|
+
<li class="next">StandardError</li>
|
78
|
+
|
79
|
+
<li class="next"><span class='object_link'><a href="Error.html" title="EnvParser::Error (class)">Error</a></span></li>
|
80
|
+
|
81
|
+
<li class="next">EnvParser::AutoregisterFileNotFound</li>
|
82
|
+
|
83
|
+
</ul>
|
84
|
+
<a href="#" class="inheritanceTree">show all</a>
|
85
|
+
|
86
|
+
</dd>
|
87
|
+
</dl>
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
<dl>
|
100
|
+
<dt>Defined in:</dt>
|
101
|
+
<dd>lib/env_parser/errors.rb</dd>
|
102
|
+
</dl>
|
103
|
+
|
104
|
+
</div>
|
105
|
+
|
106
|
+
<h2>Overview</h2><div class="docstring">
|
107
|
+
<div class="discussion">
|
108
|
+
|
109
|
+
<p>Error class used to indicate a missing auto-registration spec file (used by
|
110
|
+
the “autoregister” feature).</p>
|
111
|
+
|
112
|
+
|
113
|
+
</div>
|
114
|
+
</div>
|
115
|
+
<div class="tags">
|
116
|
+
|
117
|
+
|
118
|
+
</div>
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
</div>
|
135
|
+
|
136
|
+
<div id="footer">
|
137
|
+
Generated on Sun Nov 3 21:30:37 2019 by
|
138
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
139
|
+
0.9.20 (ruby-2.4.2).
|
140
|
+
</div>
|
141
|
+
|
142
|
+
</div>
|
143
|
+
</body>
|
144
|
+
</html>
|