env_parser 1.1.0 → 1.2.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/Gemfile.lock +13 -7
- data/README.md +3 -2
- data/docs/EnvParser/Error.html +3 -3
- data/docs/EnvParser/TypeAlreadyDefinedError.html +3 -3
- data/docs/EnvParser/Types/BaseTypes.html +178 -0
- data/docs/EnvParser/Types/ChronologyTypes.html +159 -0
- data/docs/EnvParser/Types/InternetTypes.html +159 -0
- data/docs/EnvParser/Types.html +129 -0
- data/docs/EnvParser/UnknownTypeError.html +3 -3
- data/docs/EnvParser/ValueNotAllowedError.html +3 -3
- data/docs/EnvParser/ValueNotConvertibleError.html +3 -3
- data/docs/EnvParser.html +21 -13
- data/docs/EnvParserTypes/BaseTypes.html +3 -3
- data/docs/EnvParserTypes/ChronologyTypes.html +159 -0
- data/docs/EnvParserTypes/InternetTypes.html +3 -3
- data/docs/EnvParserTypes/TimeTypes.html +158 -0
- data/docs/EnvParserTypes.html +5 -5
- data/docs/_index.html +29 -12
- data/docs/class_list.html +1 -1
- data/docs/css/style.css +4 -7
- data/docs/file.README.html +8 -5
- data/docs/frames.html +1 -1
- data/docs/index.html +8 -5
- data/docs/js/app.js +55 -0
- data/docs/top-level-namespace.html +3 -5
- data/env_parser.gemspec +2 -0
- data/lib/env_parser/types/base_types.rb +3 -2
- data/lib/env_parser/types/chronology_types.rb +104 -0
- data/lib/env_parser/types/{internet.rb → internet_types.rb} +1 -1
- data/lib/env_parser/version.rb +1 -1
- data/lib/env_parser.rb +2 -2
- metadata +38 -3
data/docs/_index.html
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
<meta charset="utf-8">
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
6
|
<title>
|
7
|
-
Documentation by YARD 0.9.
|
7
|
+
Documentation by YARD 0.9.20
|
8
8
|
|
9
9
|
</title>
|
10
10
|
|
@@ -52,7 +52,7 @@
|
|
52
52
|
<div class="clear"></div>
|
53
53
|
</div>
|
54
54
|
|
55
|
-
<div id="content"><h1 class="noborder title">Documentation by YARD 0.9.
|
55
|
+
<div id="content"><h1 class="noborder title">Documentation by YARD 0.9.20</h1>
|
56
56
|
<div id="listing">
|
57
57
|
<h1 class="alphaindex">Alphabetic Index</h1>
|
58
58
|
|
@@ -83,9 +83,9 @@
|
|
83
83
|
<ul>
|
84
84
|
|
85
85
|
<li>
|
86
|
-
<span class='object_link'><a href="
|
86
|
+
<span class='object_link'><a href="EnvParser/Types/BaseTypes.html" title="EnvParser::Types::BaseTypes (module)">BaseTypes</a></span>
|
87
87
|
|
88
|
-
<small>(
|
88
|
+
<small>(EnvParser::Types)</small>
|
89
89
|
|
90
90
|
</li>
|
91
91
|
|
@@ -93,17 +93,27 @@
|
|
93
93
|
</ul>
|
94
94
|
|
95
95
|
|
96
|
-
<ul id="
|
97
|
-
<li class="letter">
|
96
|
+
<ul id="alpha_C" class="alpha">
|
97
|
+
<li class="letter">C</li>
|
98
98
|
<ul>
|
99
99
|
|
100
100
|
<li>
|
101
|
-
<span class='object_link'><a href="EnvParser.html" title="EnvParser (
|
101
|
+
<span class='object_link'><a href="EnvParser/Types/ChronologyTypes.html" title="EnvParser::Types::ChronologyTypes (module)">ChronologyTypes</a></span>
|
102
|
+
|
103
|
+
<small>(EnvParser::Types)</small>
|
102
104
|
|
103
105
|
</li>
|
104
106
|
|
107
|
+
</ul>
|
108
|
+
</ul>
|
109
|
+
|
110
|
+
|
111
|
+
<ul id="alpha_E" class="alpha">
|
112
|
+
<li class="letter">E</li>
|
113
|
+
<ul>
|
114
|
+
|
105
115
|
<li>
|
106
|
-
<span class='object_link'><a href="
|
116
|
+
<span class='object_link'><a href="EnvParser.html" title="EnvParser (class)">EnvParser</a></span>
|
107
117
|
|
108
118
|
</li>
|
109
119
|
|
@@ -123,9 +133,9 @@
|
|
123
133
|
<ul>
|
124
134
|
|
125
135
|
<li>
|
126
|
-
<span class='object_link'><a href="
|
136
|
+
<span class='object_link'><a href="EnvParser/Types/InternetTypes.html" title="EnvParser::Types::InternetTypes (module)">InternetTypes</a></span>
|
127
137
|
|
128
|
-
<small>(
|
138
|
+
<small>(EnvParser::Types)</small>
|
129
139
|
|
130
140
|
</li>
|
131
141
|
|
@@ -144,6 +154,13 @@
|
|
144
154
|
|
145
155
|
</li>
|
146
156
|
|
157
|
+
<li>
|
158
|
+
<span class='object_link'><a href="EnvParser/Types.html" title="EnvParser::Types (module)">Types</a></span>
|
159
|
+
|
160
|
+
<small>(EnvParser)</small>
|
161
|
+
|
162
|
+
</li>
|
163
|
+
|
147
164
|
</ul>
|
148
165
|
</ul>
|
149
166
|
|
@@ -193,9 +210,9 @@
|
|
193
210
|
</div>
|
194
211
|
|
195
212
|
<div id="footer">
|
196
|
-
Generated on Mon
|
213
|
+
Generated on Mon Oct 21 00:33:12 2019 by
|
197
214
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
198
|
-
0.9.
|
215
|
+
0.9.20 (ruby-2.4.2).
|
199
216
|
</div>
|
200
217
|
|
201
218
|
</div>
|
data/docs/class_list.html
CHANGED
@@ -43,7 +43,7 @@
|
|
43
43
|
|
44
44
|
<ul id="full_list" class="class">
|
45
45
|
<li id="object_" class="odd"><div class="item" style="padding-left:30px"><span class='object_link'><a href="top-level-namespace.html" title="Top Level Namespace (root)">Top Level Namespace</a></span></div></li>
|
46
|
-
<li id='object_EnvParser' class='even'><div class='item' style='padding-left:30px'><a class='toggle'></a> <span class='object_link'><a href="EnvParser.html" title="EnvParser (class)">EnvParser</a></span> < Object<small class='search_info'>Top Level Namespace</small></div><ul><li id='object_EnvParser::Error' class='collapsed odd'><div class='item' style='padding-left:45px'><span class='object_link'><a href="EnvParser/Error.html" title="EnvParser::Error (class)">Error</a></span> < StandardError<small class='search_info'>EnvParser</small></div></li><li id='object_EnvParser::TypeAlreadyDefinedError' class='collapsed even'><div class='item' style='padding-left:45px'><span class='object_link'><a href="EnvParser/TypeAlreadyDefinedError.html" title="EnvParser::TypeAlreadyDefinedError (class)">TypeAlreadyDefinedError</a></span> < Error<small class='search_info'>EnvParser</small></div></li><li id='object_EnvParser::
|
46
|
+
<li id='object_EnvParser' class='even'><div class='item' style='padding-left:30px'><a class='toggle'></a> <span class='object_link'><a href="EnvParser.html" title="EnvParser (class)">EnvParser</a></span> < Object<small class='search_info'>Top Level Namespace</small></div><ul><li id='object_EnvParser::Error' class='collapsed odd'><div class='item' style='padding-left:45px'><span class='object_link'><a href="EnvParser/Error.html" title="EnvParser::Error (class)">Error</a></span> < StandardError<small class='search_info'>EnvParser</small></div></li><li id='object_EnvParser::TypeAlreadyDefinedError' class='collapsed even'><div class='item' style='padding-left:45px'><span class='object_link'><a href="EnvParser/TypeAlreadyDefinedError.html" title="EnvParser::TypeAlreadyDefinedError (class)">TypeAlreadyDefinedError</a></span> < Error<small class='search_info'>EnvParser</small></div></li><li id='object_EnvParser::Types' class='collapsed odd'><div class='item' style='padding-left:45px'><a class='toggle'></a> <span class='object_link'><a href="EnvParser/Types.html" title="EnvParser::Types (module)">Types</a></span><small class='search_info'>EnvParser</small></div><ul><li id='object_EnvParser::Types::BaseTypes' class='collapsed'><div class='item' style='padding-left:60px'><span class='object_link'><a href="EnvParser/Types/BaseTypes.html" title="EnvParser::Types::BaseTypes (module)">BaseTypes</a></span><small class='search_info'>EnvParser::Types</small></div></li><li id='object_EnvParser::Types::ChronologyTypes' class='collapsed'><div class='item' style='padding-left:60px'><span class='object_link'><a href="EnvParser/Types/ChronologyTypes.html" title="EnvParser::Types::ChronologyTypes (module)">ChronologyTypes</a></span><small class='search_info'>EnvParser::Types</small></div></li><li id='object_EnvParser::Types::InternetTypes' class='collapsed'><div class='item' style='padding-left:60px'><span class='object_link'><a href="EnvParser/Types/InternetTypes.html" title="EnvParser::Types::InternetTypes (module)">InternetTypes</a></span><small class='search_info'>EnvParser::Types</small></div></li></ul></li><li id='object_EnvParser::UnknownTypeError' class='collapsed even'><div class='item' style='padding-left:45px'><span class='object_link'><a href="EnvParser/UnknownTypeError.html" title="EnvParser::UnknownTypeError (class)">UnknownTypeError</a></span> < Error<small class='search_info'>EnvParser</small></div></li><li id='object_EnvParser::ValueNotAllowedError' class='collapsed odd'><div class='item' style='padding-left:45px'><span class='object_link'><a href="EnvParser/ValueNotAllowedError.html" title="EnvParser::ValueNotAllowedError (class)">ValueNotAllowedError</a></span> < Error<small class='search_info'>EnvParser</small></div></li><li id='object_EnvParser::ValueNotConvertibleError' class='collapsed even'><div class='item' style='padding-left:45px'><span class='object_link'><a href="EnvParser/ValueNotConvertibleError.html" title="EnvParser::ValueNotConvertibleError (class)">ValueNotConvertibleError</a></span> < Error<small class='search_info'>EnvParser</small></div></li></ul></li>
|
47
47
|
|
48
48
|
</ul>
|
49
49
|
</div>
|
data/docs/css/style.css
CHANGED
@@ -245,6 +245,7 @@ ul.toplevel { list-style: none; padding-left: 0; font-size: 1.1em; }
|
|
245
245
|
|
246
246
|
dl.constants { margin-left: 10px; }
|
247
247
|
dl.constants dt { font-weight: bold; font-size: 1.1em; margin-bottom: 5px; }
|
248
|
+
dl.constants.compact dt { display: inline-block; font-weight: normal }
|
248
249
|
dl.constants dd { width: 75%; white-space: pre; font-family: monospace; margin-bottom: 18px; }
|
249
250
|
dl.constants .docstring .note:first-child { margin-top: 5px; }
|
250
251
|
|
@@ -326,13 +327,9 @@ ul.summary a, ul.summary a:visited {
|
|
326
327
|
text-decoration: none; font-size: 1.1em;
|
327
328
|
}
|
328
329
|
ul.summary li { margin-bottom: 5px; }
|
329
|
-
.
|
330
|
-
padding: 4px 8px;
|
331
|
-
background: #f8f8f8;
|
332
|
-
border: 1px solid #f0f0f0;
|
333
|
-
border-radius: 5px;
|
334
|
-
}
|
330
|
+
.summary_signature { padding: 4px 8px; background: #f8f8f8; border: 1px solid #f0f0f0; border-radius: 5px; }
|
335
331
|
.summary_signature:hover { background: #CFEBFF; border-color: #A4CCDA; cursor: pointer; }
|
332
|
+
.summary_signature.deprecated { background: #ffe5e5; border-color: #e9dada; }
|
336
333
|
ul.summary.compact li { display: inline-block; margin: 0px 5px 0px 0px; line-height: 2.6em;}
|
337
334
|
ul.summary.compact .summary_signature { padding: 5px 7px; padding-right: 4px; }
|
338
335
|
#content .summary_signature:hover a,
|
@@ -485,7 +482,7 @@ pre.code .rubyid_nth_ref { color: #6D79DE; }
|
|
485
482
|
pre.code .regexp, .dregexp { color: #036A07; }
|
486
483
|
pre.code a { border-bottom: 1px dotted #bbf; }
|
487
484
|
/* inline code */
|
488
|
-
|
485
|
+
*:not(pre) > code {
|
489
486
|
padding: 1px 3px 1px 3px;
|
490
487
|
border: 1px solid #E1E1E8;
|
491
488
|
background: #F7F7F9;
|
data/docs/file.README.html
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
File: README
|
8
8
|
|
9
|
-
— Documentation by YARD 0.9.
|
9
|
+
— Documentation by YARD 0.9.20
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -209,7 +209,7 @@ the documentation for modules listed under EnvParserTypes</a>.</p>
|
|
209
209
|
|
210
210
|
<span class='comment'>## And if the value is not allowed...
|
211
211
|
</span>
|
212
|
-
<span class='const'><span class='object_link'><a href="EnvParser.html" title="EnvParser (class)">EnvParser</a></span></span><span class='period'>.</span><span class='id identifier rubyid_parse'><span class='object_link'><a href="EnvParser.html#parse-class_method" title="EnvParser.parse (method)">parse</a></span></span> <span class='symbol'>:NEGATIVE_NUMBER</span><span class='comma'>,</span> <span class='label'>as:</span> <span class='symbol'>:integer</span><span class='comma'>,</span> <span class='label'>from_set:</span> <span class='lparen'>(</span><span class='int'>1</span><span class='op'>..</span><span class='int'>5</span><span class='rparen'>)</span> <span class='comment'>## => raises EnvParser::
|
212
|
+
<span class='const'><span class='object_link'><a href="EnvParser.html" title="EnvParser (class)">EnvParser</a></span></span><span class='period'>.</span><span class='id identifier rubyid_parse'><span class='object_link'><a href="EnvParser.html#parse-class_method" title="EnvParser.parse (method)">parse</a></span></span> <span class='symbol'>:NEGATIVE_NUMBER</span><span class='comma'>,</span> <span class='label'>as:</span> <span class='symbol'>:integer</span><span class='comma'>,</span> <span class='label'>from_set:</span> <span class='lparen'>(</span><span class='int'>1</span><span class='op'>..</span><span class='int'>5</span><span class='rparen'>)</span> <span class='comment'>## => raises EnvParser::ValueNotAllowedError
|
213
213
|
</span>
|
214
214
|
|
215
215
|
|
@@ -222,7 +222,7 @@ the documentation for modules listed under EnvParserTypes</a>.</p>
|
|
222
222
|
<span class='comment'>## ... but a block will also do the trick!
|
223
223
|
</span>
|
224
224
|
<span class='const'><span class='object_link'><a href="EnvParser.html" title="EnvParser (class)">EnvParser</a></span></span><span class='period'>.</span><span class='id identifier rubyid_parse'><span class='object_link'><a href="EnvParser.html#parse-class_method" title="EnvParser.parse (method)">parse</a></span></span><span class='lparen'>(</span><span class='symbol'>:MUST_BE_LOWERCASE</span><span class='comma'>,</span> <span class='label'>as:</span> <span class='symbol'>:string</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_value'>value</span><span class='op'>|</span> <span class='id identifier rubyid_value'>value</span> <span class='op'>==</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_downcase'>downcase</span> <span class='rbrace'>}</span>
|
225
|
-
<span class='const'><span class='object_link'><a href="EnvParser.html" title="EnvParser (class)">EnvParser</a></span></span><span class='period'>.</span><span class='id identifier rubyid_parse'><span class='object_link'><a href="EnvParser.html#parse-class_method" title="EnvParser.parse (method)">parse</a></span></span><span class='lparen'>(</span><span class='symbol'>:CONNECTION_RETRIES</span><span class='comma'>,</span> <span class='label'>as:</span> <span class='symbol'>:integer</span><span class='comma'>,</span> <span class='op'>&</span><span class='symbol'>:
|
225
|
+
<span class='const'><span class='object_link'><a href="EnvParser.html" title="EnvParser (class)">EnvParser</a></span></span><span class='period'>.</span><span class='id identifier rubyid_parse'><span class='object_link'><a href="EnvParser.html#parse-class_method" title="EnvParser.parse (method)">parse</a></span></span><span class='lparen'>(</span><span class='symbol'>:CONNECTION_RETRIES</span><span class='comma'>,</span> <span class='label'>as:</span> <span class='symbol'>:integer</span><span class='comma'>,</span> <span class='op'>&</span><span class='symbol'>:positive?</span><span class='rparen'>)</span>
|
226
226
|
</code></pre>
|
227
227
|
<hr>
|
228
228
|
|
@@ -270,6 +270,9 @@ the repo docs for the full EnvParser documentation.</a></p>
|
|
270
270
|
|
271
271
|
<p>Additional features/options coming in the future:</p>
|
272
272
|
<ul><li>
|
273
|
+
<p>Allow for a “.env_parser” file where you can easily type-check and/or
|
274
|
+
register (as constants) any ENV variables you like.</p>
|
275
|
+
</li><li>
|
273
276
|
<p>Continue to round out the “as” type selection as ideas come to mind,
|
274
277
|
suggestions are made, and pull requests are submitted.</p>
|
275
278
|
</li></ul>
|
@@ -296,9 +299,9 @@ href="https://opensource.org/licenses/MIT">MIT License</a>.</p>
|
|
296
299
|
</div></div>
|
297
300
|
|
298
301
|
<div id="footer">
|
299
|
-
Generated on Mon
|
302
|
+
Generated on Mon Oct 21 00:33:12 2019 by
|
300
303
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
301
|
-
0.9.
|
304
|
+
0.9.20 (ruby-2.4.2).
|
302
305
|
</div>
|
303
306
|
|
304
307
|
</div>
|
data/docs/frames.html
CHANGED
data/docs/index.html
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
File: README
|
8
8
|
|
9
|
-
— Documentation by YARD 0.9.
|
9
|
+
— Documentation by YARD 0.9.20
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -209,7 +209,7 @@ the documentation for modules listed under EnvParserTypes</a>.</p>
|
|
209
209
|
|
210
210
|
<span class='comment'>## And if the value is not allowed...
|
211
211
|
</span>
|
212
|
-
<span class='const'><span class='object_link'><a href="EnvParser.html" title="EnvParser (class)">EnvParser</a></span></span><span class='period'>.</span><span class='id identifier rubyid_parse'><span class='object_link'><a href="EnvParser.html#parse-class_method" title="EnvParser.parse (method)">parse</a></span></span> <span class='symbol'>:NEGATIVE_NUMBER</span><span class='comma'>,</span> <span class='label'>as:</span> <span class='symbol'>:integer</span><span class='comma'>,</span> <span class='label'>from_set:</span> <span class='lparen'>(</span><span class='int'>1</span><span class='op'>..</span><span class='int'>5</span><span class='rparen'>)</span> <span class='comment'>## => raises EnvParser::
|
212
|
+
<span class='const'><span class='object_link'><a href="EnvParser.html" title="EnvParser (class)">EnvParser</a></span></span><span class='period'>.</span><span class='id identifier rubyid_parse'><span class='object_link'><a href="EnvParser.html#parse-class_method" title="EnvParser.parse (method)">parse</a></span></span> <span class='symbol'>:NEGATIVE_NUMBER</span><span class='comma'>,</span> <span class='label'>as:</span> <span class='symbol'>:integer</span><span class='comma'>,</span> <span class='label'>from_set:</span> <span class='lparen'>(</span><span class='int'>1</span><span class='op'>..</span><span class='int'>5</span><span class='rparen'>)</span> <span class='comment'>## => raises EnvParser::ValueNotAllowedError
|
213
213
|
</span>
|
214
214
|
|
215
215
|
|
@@ -222,7 +222,7 @@ the documentation for modules listed under EnvParserTypes</a>.</p>
|
|
222
222
|
<span class='comment'>## ... but a block will also do the trick!
|
223
223
|
</span>
|
224
224
|
<span class='const'><span class='object_link'><a href="EnvParser.html" title="EnvParser (class)">EnvParser</a></span></span><span class='period'>.</span><span class='id identifier rubyid_parse'><span class='object_link'><a href="EnvParser.html#parse-class_method" title="EnvParser.parse (method)">parse</a></span></span><span class='lparen'>(</span><span class='symbol'>:MUST_BE_LOWERCASE</span><span class='comma'>,</span> <span class='label'>as:</span> <span class='symbol'>:string</span><span class='rparen'>)</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_value'>value</span><span class='op'>|</span> <span class='id identifier rubyid_value'>value</span> <span class='op'>==</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_downcase'>downcase</span> <span class='rbrace'>}</span>
|
225
|
-
<span class='const'><span class='object_link'><a href="EnvParser.html" title="EnvParser (class)">EnvParser</a></span></span><span class='period'>.</span><span class='id identifier rubyid_parse'><span class='object_link'><a href="EnvParser.html#parse-class_method" title="EnvParser.parse (method)">parse</a></span></span><span class='lparen'>(</span><span class='symbol'>:CONNECTION_RETRIES</span><span class='comma'>,</span> <span class='label'>as:</span> <span class='symbol'>:integer</span><span class='comma'>,</span> <span class='op'>&</span><span class='symbol'>:
|
225
|
+
<span class='const'><span class='object_link'><a href="EnvParser.html" title="EnvParser (class)">EnvParser</a></span></span><span class='period'>.</span><span class='id identifier rubyid_parse'><span class='object_link'><a href="EnvParser.html#parse-class_method" title="EnvParser.parse (method)">parse</a></span></span><span class='lparen'>(</span><span class='symbol'>:CONNECTION_RETRIES</span><span class='comma'>,</span> <span class='label'>as:</span> <span class='symbol'>:integer</span><span class='comma'>,</span> <span class='op'>&</span><span class='symbol'>:positive?</span><span class='rparen'>)</span>
|
226
226
|
</code></pre>
|
227
227
|
<hr>
|
228
228
|
|
@@ -270,6 +270,9 @@ the repo docs for the full EnvParser documentation.</a></p>
|
|
270
270
|
|
271
271
|
<p>Additional features/options coming in the future:</p>
|
272
272
|
<ul><li>
|
273
|
+
<p>Allow for a “.env_parser” file where you can easily type-check and/or
|
274
|
+
register (as constants) any ENV variables you like.</p>
|
275
|
+
</li><li>
|
273
276
|
<p>Continue to round out the “as” type selection as ideas come to mind,
|
274
277
|
suggestions are made, and pull requests are submitted.</p>
|
275
278
|
</li></ul>
|
@@ -296,9 +299,9 @@ href="https://opensource.org/licenses/MIT">MIT License</a>.</p>
|
|
296
299
|
</div></div>
|
297
300
|
|
298
301
|
<div id="footer">
|
299
|
-
Generated on Mon
|
302
|
+
Generated on Mon Oct 21 00:33:12 2019 by
|
300
303
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
301
|
-
0.9.
|
304
|
+
0.9.20 (ruby-2.4.2).
|
302
305
|
</div>
|
303
306
|
|
304
307
|
</div>
|
data/docs/js/app.js
CHANGED
@@ -120,6 +120,49 @@ function summaryToggle() {
|
|
120
120
|
} else { localStorage.summaryCollapsed = "expand"; }
|
121
121
|
}
|
122
122
|
|
123
|
+
function constantSummaryToggle() {
|
124
|
+
$('.constants_summary_toggle').click(function(e) {
|
125
|
+
e.preventDefault();
|
126
|
+
localStorage.summaryCollapsed = $(this).text();
|
127
|
+
$('.constants_summary_toggle').each(function() {
|
128
|
+
$(this).text($(this).text() == "collapse" ? "expand" : "collapse");
|
129
|
+
var next = $(this).parent().parent().nextAll('dl.constants').first();
|
130
|
+
if (next.hasClass('compact')) {
|
131
|
+
next.toggle();
|
132
|
+
next.nextAll('dl.constants').first().toggle();
|
133
|
+
}
|
134
|
+
else if (next.hasClass('constants')) {
|
135
|
+
var list = $('<dl class="constants compact" />');
|
136
|
+
list.html(next.html());
|
137
|
+
list.find('dt').each(function() {
|
138
|
+
$(this).addClass('summary_signature');
|
139
|
+
$(this).text( $(this).text().split('=')[0]);
|
140
|
+
if ($(this).has(".deprecated").length) {
|
141
|
+
$(this).addClass('deprecated');
|
142
|
+
};
|
143
|
+
});
|
144
|
+
// Add the value of the constant as "Tooltip" to the summary object
|
145
|
+
list.find('pre.code').each(function() {
|
146
|
+
console.log($(this).parent());
|
147
|
+
var dt_element = $(this).parent().prev();
|
148
|
+
var tooltip = $(this).text();
|
149
|
+
if (dt_element.hasClass("deprecated")) {
|
150
|
+
tooltip = 'Deprecated. ' + tooltip;
|
151
|
+
};
|
152
|
+
dt_element.attr('title', tooltip);
|
153
|
+
});
|
154
|
+
list.find('.docstring, .tags, dd').remove();
|
155
|
+
next.before(list);
|
156
|
+
next.toggle();
|
157
|
+
}
|
158
|
+
});
|
159
|
+
return false;
|
160
|
+
});
|
161
|
+
if (localStorage.summaryCollapsed == "collapse") {
|
162
|
+
$('.constants_summary_toggle').first().click();
|
163
|
+
} else { localStorage.summaryCollapsed = "expand"; }
|
164
|
+
}
|
165
|
+
|
123
166
|
function generateTOC() {
|
124
167
|
if ($('#filecontents').length === 0) return;
|
125
168
|
var _toc = $('<ol class="top"></ol>');
|
@@ -232,6 +275,16 @@ function mainFocus() {
|
|
232
275
|
setTimeout(function() { $('#main').focus(); }, 10);
|
233
276
|
}
|
234
277
|
|
278
|
+
function navigationChange() {
|
279
|
+
// This works around the broken anchor navigation with the YARD template.
|
280
|
+
window.onpopstate = function() {
|
281
|
+
var hash = window.location.hash;
|
282
|
+
if (hash !== '' && $(hash)[0]) {
|
283
|
+
$(hash)[0].scrollIntoView();
|
284
|
+
}
|
285
|
+
};
|
286
|
+
}
|
287
|
+
|
235
288
|
$(document).ready(function() {
|
236
289
|
navResizer();
|
237
290
|
navExpander();
|
@@ -241,8 +294,10 @@ $(document).ready(function() {
|
|
241
294
|
searchFrameButtons();
|
242
295
|
linkSummaries();
|
243
296
|
summaryToggle();
|
297
|
+
constantSummaryToggle();
|
244
298
|
generateTOC();
|
245
299
|
mainFocus();
|
300
|
+
navigationChange();
|
246
301
|
});
|
247
302
|
|
248
303
|
})();
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Top Level Namespace
|
8
8
|
|
9
|
-
— Documentation by YARD 0.9.
|
9
|
+
— Documentation by YARD 0.9.20
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -82,8 +82,6 @@
|
|
82
82
|
<p class="children">
|
83
83
|
|
84
84
|
|
85
|
-
<strong class="modules">Modules:</strong> <span class='object_link'><a href="EnvParserTypes.html" title="EnvParserTypes (module)">EnvParserTypes</a></span>
|
86
|
-
|
87
85
|
|
88
86
|
|
89
87
|
<strong class="classes">Classes:</strong> <span class='object_link'><a href="EnvParser.html" title="EnvParser (class)">EnvParser</a></span>
|
@@ -180,9 +178,9 @@
|
|
180
178
|
</div>
|
181
179
|
|
182
180
|
<div id="footer">
|
183
|
-
Generated on Mon
|
181
|
+
Generated on Mon Oct 21 00:33:12 2019 by
|
184
182
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
185
|
-
0.9.
|
183
|
+
0.9.20 (ruby-2.4.2).
|
186
184
|
</div>
|
187
185
|
|
188
186
|
</div>
|
data/env_parser.gemspec
CHANGED
@@ -3,7 +3,7 @@ require 'env_parser'
|
|
3
3
|
## The parent module for all EnvParser type definition modules.
|
4
4
|
## Exists only for documentation's sake.
|
5
5
|
##
|
6
|
-
module
|
6
|
+
module EnvParser::Types
|
7
7
|
## Defines types for primitive classes, adding the following:
|
8
8
|
##
|
9
9
|
## <table>
|
@@ -67,7 +67,8 @@ module EnvParserTypes
|
|
67
67
|
## </tbody>
|
68
68
|
## </table>
|
69
69
|
##
|
70
|
-
## Note JSON is parsed using *quirks-mode* (meaning 'true', '25', and 'null' are all considered
|
70
|
+
## Note JSON is parsed using *quirks-mode* (meaning 'true', '25', and 'null' are all considered
|
71
|
+
## valid, parseable JSON).
|
71
72
|
##
|
72
73
|
module BaseTypes
|
73
74
|
EnvParser.define_type(:string, if_unset: '') do |value|
|
@@ -0,0 +1,104 @@
|
|
1
|
+
require 'env_parser'
|
2
|
+
|
3
|
+
## The parent module for all EnvParser type definition modules.
|
4
|
+
## Exists only for documentation's sake.
|
5
|
+
##
|
6
|
+
module EnvParser::Types
|
7
|
+
## Defines types for date/time-related values, adding the following:
|
8
|
+
##
|
9
|
+
## <table>
|
10
|
+
## <tbody>
|
11
|
+
## <tr>
|
12
|
+
## <th><code>:as</code> value</th>
|
13
|
+
## <th>type returned</th>
|
14
|
+
## <th>default</th>
|
15
|
+
## <th>notes</th>
|
16
|
+
## </tr>
|
17
|
+
## </tbody>
|
18
|
+
## <tbody>
|
19
|
+
## <tr>
|
20
|
+
## <td>:date</td>
|
21
|
+
## <td>Date</td>
|
22
|
+
## <td><code>nil</code></td>
|
23
|
+
## <td>
|
24
|
+
## A natural language or ISO8601-parseable date.
|
25
|
+
## <br />
|
26
|
+
## Actual interpretation of the value is handled by the *chronic* gem.
|
27
|
+
## </td>
|
28
|
+
## </tr>
|
29
|
+
## <tr>
|
30
|
+
## <td>:time / :datetime</td>
|
31
|
+
## <td>Time</td>
|
32
|
+
## <td><code>nil</code></td>
|
33
|
+
## <td>
|
34
|
+
## A natural language or ISO8601-parseable date and time.
|
35
|
+
## <br />
|
36
|
+
## Actual interpretation of the value is handled by the *chronic* gem.
|
37
|
+
## </td>
|
38
|
+
## </tr>
|
39
|
+
## <tr>
|
40
|
+
## <td>:duration</td>
|
41
|
+
## <td>Numeric</td>
|
42
|
+
## <td><code>nil</code></td>
|
43
|
+
## <td>
|
44
|
+
## A natural language or ISO8601-parseable period.
|
45
|
+
## <br />
|
46
|
+
## Value returned is the number of seconds in the given period.
|
47
|
+
## <br />
|
48
|
+
## Actual interpretation of the value is handled by the *chronic_duration* gem.
|
49
|
+
## </td>
|
50
|
+
## </tr>
|
51
|
+
## </tbody>
|
52
|
+
## </table>
|
53
|
+
##
|
54
|
+
module ChronologyTypes
|
55
|
+
EnvParser.define_type(:date, if_unset: nil) do |value|
|
56
|
+
require 'chronic'
|
57
|
+
|
58
|
+
begin
|
59
|
+
value = Chronic.parse value, guess: :begin
|
60
|
+
raise StandardError unless value.is_a? Time
|
61
|
+
rescue StandardError
|
62
|
+
raise EnvParser::ValueNotConvertibleError, 'non-date value'
|
63
|
+
end
|
64
|
+
|
65
|
+
value.to_date
|
66
|
+
end
|
67
|
+
|
68
|
+
EnvParser.define_type(:time, aliases: :datetime, if_unset: nil) do |value|
|
69
|
+
require 'chronic'
|
70
|
+
|
71
|
+
begin
|
72
|
+
value = Chronic.parse value, guess: :begin
|
73
|
+
raise StandardError unless value.is_a? Time
|
74
|
+
rescue StandardError
|
75
|
+
raise EnvParser::ValueNotConvertibleError, 'non-time value'
|
76
|
+
end
|
77
|
+
|
78
|
+
value
|
79
|
+
end
|
80
|
+
|
81
|
+
EnvParser.define_type(:duration, if_unset: nil) do |value|
|
82
|
+
require 'chronic_duration'
|
83
|
+
|
84
|
+
begin
|
85
|
+
original_raise_setting = ChronicDuration.raise_exceptions
|
86
|
+
ChronicDuration.raise_exceptions = true
|
87
|
+
|
88
|
+
## With `raise_exceptions` set, ChronicDuration will fail on the "P" and "T" in ISO8601
|
89
|
+
## periods, so we have to check for and remove them.
|
90
|
+
##
|
91
|
+
iso_period = %r{^\s*P(?:[0-9.]Y)?(?:[0-9.]M)?(?:[0-9.]W)?(?:[0-9.]D)?(?:T(?:[0-9.]H)?(?:[0-9.]M)?(?:[0-9.]S)?)?\s*$}
|
92
|
+
value = value.delete 'PT' if value =~ iso_period
|
93
|
+
|
94
|
+
value = ChronicDuration.parse value, keep_zero: true
|
95
|
+
rescue StandardError
|
96
|
+
raise EnvParser::ValueNotConvertibleError, 'non-duration value'
|
97
|
+
ensure
|
98
|
+
ChronicDuration.raise_exceptions = original_raise_setting
|
99
|
+
end
|
100
|
+
|
101
|
+
value
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
@@ -3,7 +3,7 @@ require 'env_parser'
|
|
3
3
|
## The parent module for all EnvParser type definition modules.
|
4
4
|
## Exists only for documentation's sake.
|
5
5
|
##
|
6
|
-
module
|
6
|
+
module EnvParser::Types
|
7
7
|
## Defines types for internet-related values, adding the following:
|
8
8
|
##
|
9
9
|
## <table>
|
data/lib/env_parser/version.rb
CHANGED
data/lib/env_parser.rb
CHANGED
@@ -189,7 +189,7 @@ class EnvParser
|
|
189
189
|
name = name.to_s
|
190
190
|
end
|
191
191
|
|
192
|
-
unless from.is_a?
|
192
|
+
unless from.is_a? Hash
|
193
193
|
raise ArgumentError, "invalid `from` parameter: #{from.class}"
|
194
194
|
end
|
195
195
|
|
@@ -288,7 +288,7 @@ class EnvParser
|
|
288
288
|
## @raise [ArgumentError]
|
289
289
|
##
|
290
290
|
def register_all(list)
|
291
|
-
raise(ArgumentError, "invalid 'list' parameter type: #{list.class}") unless list.is_a?
|
291
|
+
raise(ArgumentError, "invalid 'list' parameter type: #{list.class}") unless list.is_a? Hash
|
292
292
|
|
293
293
|
list.to_a.each_with_object({}) do |tuple, output|
|
294
294
|
output[tuple.first] = register(tuple.first, tuple.second)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: env_parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nestor Custodio
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-10-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -80,6 +80,34 @@ dependencies:
|
|
80
80
|
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: 5.0.0
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: chronic
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: chronic_duration
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
83
111
|
description:
|
84
112
|
email:
|
85
113
|
- sakimorix@gmail.com
|
@@ -105,13 +133,19 @@ files:
|
|
105
133
|
- docs/EnvParser/Error.html
|
106
134
|
- docs/EnvParser/TypeAlreadyDefined.html
|
107
135
|
- docs/EnvParser/TypeAlreadyDefinedError.html
|
136
|
+
- docs/EnvParser/Types.html
|
137
|
+
- docs/EnvParser/Types/BaseTypes.html
|
138
|
+
- docs/EnvParser/Types/ChronologyTypes.html
|
139
|
+
- docs/EnvParser/Types/InternetTypes.html
|
108
140
|
- docs/EnvParser/UnknownTypeError.html
|
109
141
|
- docs/EnvParser/ValueNotAllowed.html
|
110
142
|
- docs/EnvParser/ValueNotAllowedError.html
|
111
143
|
- docs/EnvParser/ValueNotConvertibleError.html
|
112
144
|
- docs/EnvParserTypes.html
|
113
145
|
- docs/EnvParserTypes/BaseTypes.html
|
146
|
+
- docs/EnvParserTypes/ChronologyTypes.html
|
114
147
|
- docs/EnvParserTypes/InternetTypes.html
|
148
|
+
- docs/EnvParserTypes/TimeTypes.html
|
115
149
|
- docs/_index.html
|
116
150
|
- docs/class_list.html
|
117
151
|
- docs/css/common.css
|
@@ -131,7 +165,8 @@ files:
|
|
131
165
|
- lib/env_parser/errors.rb
|
132
166
|
- lib/env_parser/types.rb
|
133
167
|
- lib/env_parser/types/base_types.rb
|
134
|
-
- lib/env_parser/types/
|
168
|
+
- lib/env_parser/types/chronology_types.rb
|
169
|
+
- lib/env_parser/types/internet_types.rb
|
135
170
|
- lib/env_parser/version.rb
|
136
171
|
homepage: https://github.com/nestor-custodio/env_parser
|
137
172
|
licenses:
|