env_parser 1.7.1 → 1.7.3
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 +6 -4
- data/Gemfile.lock +85 -52
- data/env_parser.gemspec +19 -12
- data/lib/env_parser/types/base_types.rb +1 -5
- data/lib/env_parser/types/chronology_types.rb +1 -1
- data/lib/env_parser/types/internet_types.rb +1 -0
- data/lib/env_parser/version.rb +1 -1
- data/lib/env_parser.rb +17 -15
- metadata +4 -113
- data/.circleci/config.yml +0 -64
- data/.gitignore +0 -14
- data/.rspec +0 -3
- data/.rubocop.yml +0 -64
- data/.ruby-version +0 -1
- data/.yardopts +0 -1
- data/bin/console +0 -14
- data/bin/setup +0 -8
- data/docs/EnvParser/AutoregisterFileNotFound.html +0 -146
- data/docs/EnvParser/Error.html +0 -140
- data/docs/EnvParser/TypeAlreadyDefined.html +0 -143
- data/docs/EnvParser/TypeAlreadyDefinedError.html +0 -145
- data/docs/EnvParser/Types/BaseTypes.html +0 -179
- data/docs/EnvParser/Types/ChronologyTypes.html +0 -161
- data/docs/EnvParser/Types/InternetTypes.html +0 -173
- data/docs/EnvParser/Types.html +0 -130
- data/docs/EnvParser/UnknownTypeError.html +0 -145
- data/docs/EnvParser/UnparseableAutoregisterSpec.html +0 -146
- data/docs/EnvParser/ValueNotAllowed.html +0 -144
- data/docs/EnvParser/ValueNotAllowedError.html +0 -147
- data/docs/EnvParser/ValueNotConvertibleError.html +0 -145
- data/docs/EnvParser.html +0 -1194
- data/docs/EnvParserTypes/BaseTypes.html +0 -178
- data/docs/EnvParserTypes/ChronologyTypes.html +0 -159
- data/docs/EnvParserTypes/InternetTypes.html +0 -159
- data/docs/EnvParserTypes/TimeTypes.html +0 -158
- data/docs/EnvParserTypes.html +0 -129
- data/docs/_index.html +0 -245
- data/docs/class_list.html +0 -54
- data/docs/css/common.css +0 -1
- data/docs/css/full_list.css +0 -206
- data/docs/css/style.css +0 -1089
- data/docs/file.README.html +0 -334
- data/docs/file_list.html +0 -59
- data/docs/frames.html +0 -22
- data/docs/index.html +0 -334
- data/docs/js/app.js +0 -801
- data/docs/js/full_list.js +0 -334
- data/docs/js/jquery.js +0 -4
- data/docs/method_list.html +0 -94
- data/docs/top-level-namespace.html +0 -112
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9211eb500873c6156af1b61f6415ce93e263cfd7c578c7a56deea92ce164c10f
|
|
4
|
+
data.tar.gz: d350d09557294363bcf3722d4af9ba4f1ccf3b1578cc3307505f0361a536ed9e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: cd41b8937c0b9b59a477d2a82f82ba72e861d8d74362c15e0040c60ae05808d89f31997e4b0a2f738f63ce59e2ece175cce7a43149e9e2bf5a1a02251129f630
|
|
7
|
+
data.tar.gz: 5eeaadde7cc422c1dbb517cfabb80aa27d0804f99c20803a397ba203cede35d8916f1939d99f0201ade5280067bfbf1c5bf2483116fe197c473b960e20ffc994
|
data/Gemfile
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
source 'https://rubygems.org'
|
|
2
|
-
|
|
3
|
-
git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
|
|
4
|
-
|
|
5
|
-
# Specify your gem's dependencies in env_parser.gemspec
|
|
6
2
|
gemspec
|
|
3
|
+
|
|
4
|
+
gem 'irb'
|
|
5
|
+
gem 'rspec', '~> 3'
|
|
6
|
+
gem 'rspec_junit_formatter'
|
|
7
|
+
gem 'rubocop'
|
|
8
|
+
gem 'yard'
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
env_parser (1.
|
|
4
|
+
env_parser (1.7.2)
|
|
5
5
|
activesupport (>= 6.1.0, < 9)
|
|
6
6
|
chronic (~> 0)
|
|
7
7
|
chronic_duration (~> 0)
|
|
@@ -9,7 +9,7 @@ PATH
|
|
|
9
9
|
GEM
|
|
10
10
|
remote: https://rubygems.org/
|
|
11
11
|
specs:
|
|
12
|
-
activesupport (8.1.
|
|
12
|
+
activesupport (8.1.4.1)
|
|
13
13
|
base64
|
|
14
14
|
bigdecimal
|
|
15
15
|
concurrent-ruby (~> 1.0, >= 1.3.1)
|
|
@@ -24,123 +24,156 @@ GEM
|
|
|
24
24
|
uri (>= 0.13.1)
|
|
25
25
|
ast (2.4.3)
|
|
26
26
|
base64 (0.3.0)
|
|
27
|
-
bigdecimal (4.1.
|
|
27
|
+
bigdecimal (4.1.3)
|
|
28
28
|
chronic (0.10.2)
|
|
29
29
|
chronic_duration (0.10.6)
|
|
30
30
|
numerizer (~> 0.1.1)
|
|
31
|
-
concurrent-ruby (1.3.
|
|
31
|
+
concurrent-ruby (1.3.8)
|
|
32
32
|
connection_pool (3.0.2)
|
|
33
33
|
diff-lcs (1.6.2)
|
|
34
34
|
drb (2.2.3)
|
|
35
|
+
erb (6.0.7)
|
|
35
36
|
i18n (1.15.2)
|
|
36
37
|
concurrent-ruby (~> 1.0)
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
io-console (0.9.5)
|
|
39
|
+
irb (1.19.0)
|
|
40
|
+
pp (>= 0.6.0)
|
|
41
|
+
prism (>= 1.3.0)
|
|
42
|
+
rdoc (>= 4.0.0)
|
|
43
|
+
reline (>= 0.4.2)
|
|
44
|
+
json (3.1.0)
|
|
45
|
+
language_server-protocol (3.17.0.6)
|
|
39
46
|
lint_roller (1.1.0)
|
|
40
47
|
logger (1.7.0)
|
|
41
|
-
minitest (6.0
|
|
48
|
+
minitest (6.1.0)
|
|
42
49
|
drb (~> 2.0)
|
|
43
|
-
prism (
|
|
50
|
+
prism (>= 1.5, < 3)
|
|
44
51
|
numerizer (0.1.1)
|
|
45
|
-
parallel (2.
|
|
46
|
-
parser (3.3.
|
|
52
|
+
parallel (2.3.0)
|
|
53
|
+
parser (3.3.13.0)
|
|
47
54
|
ast (~> 2.4.1)
|
|
48
55
|
racc
|
|
49
|
-
|
|
56
|
+
pp (0.6.4)
|
|
57
|
+
prettyprint
|
|
58
|
+
prettyprint (0.2.1)
|
|
59
|
+
prism (2.1.0)
|
|
60
|
+
prism (2.1.0-x86_64-linux-gnu)
|
|
50
61
|
racc (1.8.1)
|
|
51
62
|
rainbow (3.1.1)
|
|
52
|
-
|
|
63
|
+
rbs (4.2.0)
|
|
64
|
+
logger
|
|
65
|
+
prism (>= 1.6.0)
|
|
66
|
+
tsort
|
|
67
|
+
rdoc (8.1.0)
|
|
68
|
+
erb
|
|
69
|
+
prism (>= 1.6.0)
|
|
70
|
+
rbs (>= 4.0.0)
|
|
71
|
+
tsort
|
|
72
|
+
regexp_parser (2.13.1)
|
|
73
|
+
reline (0.7.0)
|
|
74
|
+
io-console (~> 0.5)
|
|
53
75
|
rspec (3.13.2)
|
|
54
76
|
rspec-core (~> 3.13.0)
|
|
55
77
|
rspec-expectations (~> 3.13.0)
|
|
56
78
|
rspec-mocks (~> 3.13.0)
|
|
57
|
-
rspec-core (3.13.
|
|
79
|
+
rspec-core (3.13.7)
|
|
58
80
|
rspec-support (~> 3.13.0)
|
|
59
|
-
rspec-expectations (3.13.
|
|
81
|
+
rspec-expectations (3.13.6)
|
|
60
82
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
61
83
|
rspec-support (~> 3.13.0)
|
|
62
|
-
rspec-mocks (3.13.
|
|
84
|
+
rspec-mocks (3.13.9)
|
|
63
85
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
64
86
|
rspec-support (~> 3.13.0)
|
|
65
|
-
rspec-support (3.13.
|
|
66
|
-
rspec_junit_formatter (0.
|
|
67
|
-
rspec-core (>=
|
|
68
|
-
rubocop (1.
|
|
69
|
-
json (
|
|
87
|
+
rspec-support (3.13.8)
|
|
88
|
+
rspec_junit_formatter (0.8.0)
|
|
89
|
+
rspec-core (>= 3.13, < 4)
|
|
90
|
+
rubocop (1.92.2)
|
|
91
|
+
json (>= 2.3)
|
|
70
92
|
language_server-protocol (~> 3.17.0.2)
|
|
71
93
|
lint_roller (~> 1.1.0)
|
|
72
94
|
parallel (>= 1.10)
|
|
73
95
|
parser (>= 3.3.0.2)
|
|
74
96
|
rainbow (>= 2.2.2, < 4.0)
|
|
75
|
-
regexp_parser (>= 2.
|
|
97
|
+
regexp_parser (>= 2.11.3, < 3.0)
|
|
76
98
|
rubocop-ast (>= 1.49.0, < 2.0)
|
|
77
99
|
ruby-progressbar (~> 1.7)
|
|
78
100
|
unicode-display_width (>= 2.4.0, < 4.0)
|
|
79
|
-
rubocop-ast (1.
|
|
101
|
+
rubocop-ast (1.51.0)
|
|
80
102
|
parser (>= 3.3.7.2)
|
|
81
|
-
prism (
|
|
103
|
+
prism (>= 1.7)
|
|
82
104
|
ruby-progressbar (1.13.0)
|
|
83
105
|
securerandom (0.4.1)
|
|
106
|
+
tsort (0.2.0)
|
|
84
107
|
tzinfo (2.0.6)
|
|
85
108
|
concurrent-ruby (~> 1.0)
|
|
86
|
-
unicode-display_width (3.
|
|
87
|
-
unicode-emoji (~> 4.
|
|
88
|
-
unicode-emoji (4.
|
|
89
|
-
uri (1.1.
|
|
90
|
-
yard (0.9.
|
|
109
|
+
unicode-display_width (3.3.0)
|
|
110
|
+
unicode-emoji (~> 4.3)
|
|
111
|
+
unicode-emoji (4.3.0)
|
|
112
|
+
uri (1.1.2)
|
|
113
|
+
yard (0.9.45)
|
|
91
114
|
|
|
92
115
|
PLATFORMS
|
|
93
116
|
ruby
|
|
94
117
|
x86_64-linux
|
|
95
118
|
|
|
96
119
|
DEPENDENCIES
|
|
97
|
-
bundler (~> 4)
|
|
98
120
|
env_parser!
|
|
121
|
+
irb
|
|
99
122
|
rspec (~> 3)
|
|
100
123
|
rspec_junit_formatter
|
|
101
124
|
rubocop
|
|
102
125
|
yard
|
|
103
126
|
|
|
104
127
|
CHECKSUMS
|
|
105
|
-
activesupport (8.1.
|
|
128
|
+
activesupport (8.1.4.1) sha256=16ac4f341ca65c85a1fcdb8ac73f68891aae9e3c4a6f9c3a27daed8b00017ed7
|
|
106
129
|
ast (2.4.3) sha256=954615157c1d6a382bc27d690d973195e79db7f55e9765ac7c481c60bdb4d383
|
|
107
130
|
base64 (0.3.0) sha256=27337aeabad6ffae05c265c450490628ef3ebd4b67be58257393227588f5a97b
|
|
108
|
-
bigdecimal (4.1.
|
|
131
|
+
bigdecimal (4.1.3) sha256=61ebe1e5e559bdc3cc6f2c0ee7f427321fc838f59611c294356eb04d6e21cf66
|
|
109
132
|
chronic (0.10.2) sha256=766f2fcce6ac3cc152249ed0f2b827770d3e517e2e87c5fba7ed74f4889d2dc3
|
|
110
133
|
chronic_duration (0.10.6) sha256=fac58d4147d3183a40811400380cafcef049f2bb02421d2fd1c6e685fbe8facc
|
|
111
|
-
concurrent-ruby (1.3.
|
|
134
|
+
concurrent-ruby (1.3.8) sha256=b2f1be836e968ccc78ccfce277ea79c72a88633f22306782c16ff23fb415d1e1
|
|
112
135
|
connection_pool (3.0.2) sha256=33fff5ba71a12d2aa26cb72b1db8bba2a1a01823559fb01d29eb74c286e62e0a
|
|
113
136
|
diff-lcs (1.6.2) sha256=9ae0d2cba7d4df3075fe8cd8602a8604993efc0dfa934cff568969efb1909962
|
|
114
137
|
drb (2.2.3) sha256=0b00d6fdb50995fe4a45dea13663493c841112e4068656854646f418fda13373
|
|
115
|
-
env_parser (1.
|
|
138
|
+
env_parser (1.7.2)
|
|
139
|
+
erb (6.0.7) sha256=c5ca6dc25b0ef974a44dc8f59fe847577122483b1968a38dec305c60bf91ee92
|
|
116
140
|
i18n (1.15.2) sha256=00f9eb62412fe593b2a65a97daa75300d37abb8f7202ec748e94b6d46a9dd1b5
|
|
117
|
-
|
|
118
|
-
|
|
141
|
+
io-console (0.9.5) sha256=83dd9bbf4c4680416629245b39cd4212eb5f4d9a4ea91804870c1f6b846414d5
|
|
142
|
+
irb (1.19.0) sha256=55ee56acbdd6c9fe06a2e6909f46a24e5c41f45f16906bab04e8049cf46f1d27
|
|
143
|
+
json (3.1.0) sha256=3ce7ccf8fde58960177a3a756c31f292a4c1e1dedee884547096a5b0604e3bd8
|
|
144
|
+
language_server-protocol (3.17.0.6) sha256=5ef2c0c138f8267e1bc631d3328347d354f96724b0af22f2c79516120443b7f0
|
|
119
145
|
lint_roller (1.1.0) sha256=2c0c845b632a7d172cb849cc90c1bce937a28c5c8ccccb50dfd46a485003cc87
|
|
120
146
|
logger (1.7.0) sha256=196edec7cc44b66cfb40f9755ce11b392f21f7967696af15d274dde7edff0203
|
|
121
|
-
minitest (6.0
|
|
147
|
+
minitest (6.1.0) sha256=ff373595aa8888631e8a5463986a76b3845346ae6d7fa46e139c1633d418076e
|
|
122
148
|
numerizer (0.1.1) sha256=10ec9efec62472b69a3a0e275a18a44baa595ce6e2e4cfc1678d5cb2974c336f
|
|
123
|
-
parallel (2.
|
|
124
|
-
parser (3.3.
|
|
125
|
-
|
|
149
|
+
parallel (2.3.0) sha256=f75a3e904101ce6a1ccb6b8dc800cbafd42166d83330192438dcf29395167a6f
|
|
150
|
+
parser (3.3.13.0) sha256=e02f9b63c2fe05b0c68f692ba4df89b3cb113b663964f75d988fbebfd6c3deca
|
|
151
|
+
pp (0.6.4) sha256=dfcb0fce700c41456265922884f9fe195d7fbb0674a3578e6c0f69588e82b570
|
|
152
|
+
prettyprint (0.2.1) sha256=d555d57ea6d7cf001d4774b693546a6bd88bec1e778ddffb5c60b68ceec4b7d4
|
|
153
|
+
prism (2.1.0) sha256=1c0a7c6dea0e93183390fb123f007564dbe663198e2f86ad87204151147601f3
|
|
154
|
+
prism (2.1.0-x86_64-linux-gnu) sha256=b2b647afce09551e650b8bb3e2fc91d7d73d392a09534ca307ec0d619c33bfd4
|
|
126
155
|
racc (1.8.1) sha256=4a7f6929691dbec8b5209a0b373bc2614882b55fc5d2e447a21aaa691303d62f
|
|
127
156
|
rainbow (3.1.1) sha256=039491aa3a89f42efa1d6dec2fc4e62ede96eb6acd95e52f1ad581182b79bc6a
|
|
128
|
-
|
|
157
|
+
rbs (4.2.0) sha256=51f7b886dcc05bc09e10b901daa6a81829f6adc03101d6ca9ea4aac6103e0674
|
|
158
|
+
rdoc (8.1.0) sha256=befc37880a5cfd36dcb176c748b5fd5ee39dd3536a75e81824e4972ce230f60a
|
|
159
|
+
regexp_parser (2.13.1) sha256=5aedb6b7c35688f51e86eef17a15374dfd287c83f4ca644b2c5f3ec50a33b44b
|
|
160
|
+
reline (0.7.0) sha256=5b012d8e55dbf9d450f12bde2cf7d15ff546ae80b3f8f3b30e570d431815583d
|
|
129
161
|
rspec (3.13.2) sha256=206284a08ad798e61f86d7ca3e376718d52c0bc944626b2349266f239f820587
|
|
130
|
-
rspec-core (3.13.
|
|
131
|
-
rspec-expectations (3.13.
|
|
132
|
-
rspec-mocks (3.13.
|
|
133
|
-
rspec-support (3.13.
|
|
134
|
-
rspec_junit_formatter (0.
|
|
135
|
-
rubocop (1.
|
|
136
|
-
rubocop-ast (1.
|
|
162
|
+
rspec-core (3.13.7) sha256=c64ff16d9788119805cbc6a3f4b6d87cc22417c2d25976a3330de136896b5469
|
|
163
|
+
rspec-expectations (3.13.6) sha256=bf538ca6d367ff5b0d85a87fdb5c0c6038f2cd1308a0eeba07476caa02d22f35
|
|
164
|
+
rspec-mocks (3.13.9) sha256=ea5c7ff3054a6098ca6039aacef80aec69d5a8a3ef80be8fc88337359b672a30
|
|
165
|
+
rspec-support (3.13.8) sha256=e4160030309b7e3e9d9863dfe720a35dfcc577162f5402cd68fc8c5258a0ffd6
|
|
166
|
+
rspec_junit_formatter (0.8.0) sha256=2c505d4a79713d298bc8361532cc3eb3427d9279ffe3f8ceeeeeb72ffc279a20
|
|
167
|
+
rubocop (1.92.2) sha256=14fb31eed143a0dc6f78186c550c1715e81cd38f59d05d1165050e445c1f5382
|
|
168
|
+
rubocop-ast (1.51.0) sha256=0ec311e36b191b3872d909078a35274e962ae97dbce64be6812d145ca59acfcb
|
|
137
169
|
ruby-progressbar (1.13.0) sha256=80fc9c47a9b640d6834e0dc7b3c94c9df37f08cb072b7761e4a71e22cff29b33
|
|
138
170
|
securerandom (0.4.1) sha256=cc5193d414a4341b6e225f0cb4446aceca8e50d5e1888743fac16987638ea0b1
|
|
171
|
+
tsort (0.2.0) sha256=9650a793f6859a43b6641671278f79cfead60ac714148aabe4e3f0060480089f
|
|
139
172
|
tzinfo (2.0.6) sha256=8daf828cc77bcf7d63b0e3bdb6caa47e2272dcfaf4fbfe46f8c3a9df087a829b
|
|
140
|
-
unicode-display_width (3.
|
|
141
|
-
unicode-emoji (4.
|
|
142
|
-
uri (1.1.
|
|
143
|
-
yard (0.9.
|
|
173
|
+
unicode-display_width (3.3.0) sha256=4b7aa66a4b11db50f6f7e98411215cd0dd10eaecb665d36eec5bcacb3fa0b613
|
|
174
|
+
unicode-emoji (4.3.0) sha256=11c02fa73290378c066bb0562cd4c87d8e1b706fbbe0059ca12746a4244de8ce
|
|
175
|
+
uri (1.1.2) sha256=89292e98eabbef6248b0a0ed5e7e398e152f83f17560023a6d94a7f492b169fb
|
|
176
|
+
yard (0.9.45) sha256=52e211493f7cb8a3ebf7e104a25a1e73937a3103092545d34cb88fafebb3dc51
|
|
144
177
|
|
|
145
178
|
BUNDLED WITH
|
|
146
|
-
|
|
179
|
+
2.6.9
|
data/env_parser.gemspec
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
3
|
-
require 'env_parser/version'
|
|
1
|
+
require_relative 'lib/env_parser/version'
|
|
4
2
|
|
|
5
3
|
Gem::Specification.new do |spec|
|
|
6
|
-
spec.required_ruby_version =
|
|
4
|
+
spec.required_ruby_version = '>= 3.4'
|
|
7
5
|
|
|
8
6
|
spec.name = 'env_parser'
|
|
9
7
|
spec.version = EnvParser::VERSION
|
|
@@ -14,19 +12,28 @@ Gem::Specification.new do |spec|
|
|
|
14
12
|
spec.homepage = 'https://github.com/nestor-custodio/env_parser'
|
|
15
13
|
spec.license = 'MIT'
|
|
16
14
|
|
|
17
|
-
spec.files = `git ls-files -z`.split("\x0")
|
|
15
|
+
spec.files = `git ls-files -z`.split("\x0") & Dir['*', 'lib/**/*']
|
|
18
16
|
spec.executables = []
|
|
19
17
|
spec.require_paths = ['lib']
|
|
20
18
|
|
|
21
|
-
|
|
19
|
+
# ---
|
|
20
|
+
|
|
21
|
+
spec.metadata = {
|
|
22
|
+
# See: https://guides.rubygems.org/specification-reference/#metadata
|
|
23
|
+
|
|
24
|
+
# RubyGems.org Security
|
|
25
|
+
#
|
|
26
|
+
'allowed_push_host' => 'https://rubygems.org',
|
|
27
|
+
'rubygems_mfa_required' => 'true',
|
|
28
|
+
|
|
29
|
+
# Metadata-Provided URIs
|
|
30
|
+
#
|
|
31
|
+
'homepage_uri' => spec.homepage
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
# ---
|
|
22
35
|
|
|
23
36
|
spec.add_dependency 'activesupport', ['>= 6.1.0', '< 9']
|
|
24
37
|
spec.add_dependency 'chronic', '~> 0'
|
|
25
38
|
spec.add_dependency 'chronic_duration', '~> 0'
|
|
26
|
-
|
|
27
|
-
spec.add_development_dependency 'bundler', '~> 4'
|
|
28
|
-
spec.add_development_dependency 'rspec', '~> 3'
|
|
29
|
-
spec.add_development_dependency 'rspec_junit_formatter'
|
|
30
|
-
spec.add_development_dependency 'rubocop'
|
|
31
|
-
spec.add_development_dependency 'yard'
|
|
32
39
|
end
|
|
@@ -67,9 +67,6 @@ module EnvParser::Types
|
|
|
67
67
|
# </tbody>
|
|
68
68
|
# </table>
|
|
69
69
|
#
|
|
70
|
-
# Note JSON is parsed using *quirks-mode* (meaning 'true', '25', and 'null' are all considered
|
|
71
|
-
# valid, parseable JSON).
|
|
72
|
-
#
|
|
73
70
|
module BaseTypes
|
|
74
71
|
EnvParser.define_type(:string, if_unset: '') do |value|
|
|
75
72
|
value
|
|
@@ -91,8 +88,7 @@ module EnvParser::Types
|
|
|
91
88
|
EnvParser.define_type(:json, if_unset: nil) do |value|
|
|
92
89
|
require 'json'
|
|
93
90
|
|
|
94
|
-
decoded_json
|
|
95
|
-
{ decoded_json: decoded_json }.with_indifferent_access[:decoded_json]
|
|
91
|
+
{ decoded_json: JSON.parse(value) }.with_indifferent_access[:decoded_json]
|
|
96
92
|
end
|
|
97
93
|
|
|
98
94
|
EnvParser.define_type(:array, if_unset: []) do |value|
|
|
@@ -88,7 +88,7 @@ module EnvParser::Types
|
|
|
88
88
|
# With `raise_exceptions` set, ChronicDuration will fail on the "P" and "T" in ISO8601
|
|
89
89
|
# periods, so we have to check for and remove them.
|
|
90
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*$}
|
|
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*$} # rubocop:disable Layout/LineLength
|
|
92
92
|
value = value.delete 'PT' if value =~ iso_period
|
|
93
93
|
|
|
94
94
|
value = ChronicDuration.parse value, keep_zero: true
|
|
@@ -110,6 +110,7 @@ module EnvParser::Types
|
|
|
110
110
|
|
|
111
111
|
EnvParser.define_type(:version, aliases: :semver, if_unset: nil) do |value|
|
|
112
112
|
# We're using the official semver.org-provided regex.
|
|
113
|
+
#
|
|
113
114
|
semver = %r{^(?<major>0|[1-9]\d*)\.(?<minor>0|[1-9]\d*)\.(?<patch>0|[1-9]\d*)(?:-(?<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?<buildmetadata>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$} # rubocop:disable Layout/LineLength
|
|
114
115
|
|
|
115
116
|
match_data = value.match(semver)
|
data/lib/env_parser/version.rb
CHANGED
data/lib/env_parser.rb
CHANGED
|
@@ -46,10 +46,10 @@ class EnvParser
|
|
|
46
46
|
|
|
47
47
|
given_types = (Array(name) + Array(options[:aliases])).map(&:to_s).map(&:to_sym)
|
|
48
48
|
given_types.each do |type|
|
|
49
|
-
raise(TypeAlreadyDefinedError, "cannot redefine #{type.inspect}") if known_types.
|
|
49
|
+
raise(TypeAlreadyDefinedError, "cannot redefine #{type.inspect}") if known_types.has_key?(type)
|
|
50
50
|
|
|
51
51
|
known_types[type] = {
|
|
52
|
-
parser:
|
|
52
|
+
parser: parser,
|
|
53
53
|
if_unset: options[:if_unset]
|
|
54
54
|
}
|
|
55
55
|
end
|
|
@@ -114,13 +114,13 @@ class EnvParser
|
|
|
114
114
|
value = value.to_s
|
|
115
115
|
|
|
116
116
|
type = known_types[options[:as]]
|
|
117
|
-
raise(ArgumentError, 'missing `as` parameter') unless options.
|
|
117
|
+
raise(ArgumentError, 'missing `as` parameter') unless options.has_key?(:as)
|
|
118
118
|
raise(UnknownTypeError, "invalid `as` parameter: #{options[:as].inspect}") unless type
|
|
119
119
|
|
|
120
|
-
return (options.
|
|
120
|
+
return (options.has_key?(:if_unset) ? options[:if_unset] : type[:if_unset]) if value.blank?
|
|
121
121
|
|
|
122
122
|
value = type[:parser].call(value)
|
|
123
|
-
check_for_set_inclusion(value, set: options[:from_set]) if options.
|
|
123
|
+
check_for_set_inclusion(value, set: options[:from_set]) if options.has_key?(:from_set)
|
|
124
124
|
check_user_defined_validations(value, proc: options[:validated_by], block: validation_block)
|
|
125
125
|
|
|
126
126
|
value
|
|
@@ -188,10 +188,11 @@ class EnvParser
|
|
|
188
188
|
#
|
|
189
189
|
# @raise [ArgumentError]
|
|
190
190
|
#
|
|
191
|
-
def register(name, options = {}, &
|
|
191
|
+
def register(name, options = {}, &)
|
|
192
192
|
# Allow for registering multiple variables simultaneously via a single call.
|
|
193
193
|
if name.is_a? Hash
|
|
194
194
|
raise(ArgumentError, 'cannot register multiple values with one block') if block_given?
|
|
195
|
+
|
|
195
196
|
return register_all(name)
|
|
196
197
|
end
|
|
197
198
|
|
|
@@ -199,22 +200,23 @@ class EnvParser
|
|
|
199
200
|
within = options.fetch(:within, Kernel)
|
|
200
201
|
|
|
201
202
|
named = name
|
|
202
|
-
named = options.fetch(:named, name) if options.
|
|
203
|
+
named = options.fetch(:named, name) if options.has_key? :within
|
|
203
204
|
|
|
204
205
|
# ENV *seems* like a Hash and it does *some* Hash-y things, but it is NOT a Hash and that can
|
|
205
206
|
# bite you in some cases. Making sure we're working with a straight-up Hash saves a lot of
|
|
206
207
|
# sanity checks later on. This is also a good place to make sure we're working with a String
|
|
207
208
|
# key.
|
|
209
|
+
#
|
|
208
210
|
if from == ENV
|
|
209
211
|
from = from.to_h
|
|
210
212
|
name = name.to_s
|
|
211
213
|
end
|
|
212
214
|
|
|
213
215
|
raise ArgumentError, "invalid `from` parameter: #{from.class}" unless from.is_a? Hash
|
|
214
|
-
raise ArgumentError, "invalid `within` parameter: #{within.inspect}" unless within.is_a?
|
|
216
|
+
raise ArgumentError, "invalid `within` parameter: #{within.inspect}" unless within.is_a? Module
|
|
215
217
|
|
|
216
218
|
value = from[name]
|
|
217
|
-
value = parse(value, options, &
|
|
219
|
+
value = parse(value, options, &)
|
|
218
220
|
within.const_set(named.upcase.to_sym, value.dup.freeze)
|
|
219
221
|
|
|
220
222
|
value
|
|
@@ -231,12 +233,12 @@ class EnvParser
|
|
|
231
233
|
#
|
|
232
234
|
def add_env_bindings
|
|
233
235
|
ENV.instance_eval do
|
|
234
|
-
def parse(name, options = {}, &
|
|
235
|
-
EnvParser.parse(self[name.to_s], options, &
|
|
236
|
+
def parse(name, options = {}, &)
|
|
237
|
+
EnvParser.parse(self[name.to_s], options, &)
|
|
236
238
|
end
|
|
237
239
|
|
|
238
|
-
def register(*
|
|
239
|
-
EnvParser.register(*
|
|
240
|
+
def register(*)
|
|
241
|
+
EnvParser.register(*)
|
|
240
242
|
end
|
|
241
243
|
end
|
|
242
244
|
|
|
@@ -265,8 +267,8 @@ class EnvParser
|
|
|
265
267
|
autoregister_spec.deep_symbolize_keys!
|
|
266
268
|
autoregister_spec.transform_values! do |spec|
|
|
267
269
|
sanitized = spec.slice(:as, :named, :within, :if_unset, :from_set)
|
|
268
|
-
sanitized[:as] = sanitized[:as].to_sym if sanitized.
|
|
269
|
-
sanitized[:within] = sanitized[:within].constantize if sanitized.
|
|
270
|
+
sanitized[:as] = sanitized[:as].to_sym if sanitized.has_key? :as
|
|
271
|
+
sanitized[:within] = sanitized[:within].constantize if sanitized.has_key? :within
|
|
270
272
|
|
|
271
273
|
sanitized
|
|
272
274
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: env_parser
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.7.
|
|
4
|
+
version: 1.7.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Nestor Custodio
|
|
@@ -57,128 +57,17 @@ dependencies:
|
|
|
57
57
|
- - "~>"
|
|
58
58
|
- !ruby/object:Gem::Version
|
|
59
59
|
version: '0'
|
|
60
|
-
- !ruby/object:Gem::Dependency
|
|
61
|
-
name: bundler
|
|
62
|
-
requirement: !ruby/object:Gem::Requirement
|
|
63
|
-
requirements:
|
|
64
|
-
- - "~>"
|
|
65
|
-
- !ruby/object:Gem::Version
|
|
66
|
-
version: '4'
|
|
67
|
-
type: :development
|
|
68
|
-
prerelease: false
|
|
69
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
70
|
-
requirements:
|
|
71
|
-
- - "~>"
|
|
72
|
-
- !ruby/object:Gem::Version
|
|
73
|
-
version: '4'
|
|
74
|
-
- !ruby/object:Gem::Dependency
|
|
75
|
-
name: rspec
|
|
76
|
-
requirement: !ruby/object:Gem::Requirement
|
|
77
|
-
requirements:
|
|
78
|
-
- - "~>"
|
|
79
|
-
- !ruby/object:Gem::Version
|
|
80
|
-
version: '3'
|
|
81
|
-
type: :development
|
|
82
|
-
prerelease: false
|
|
83
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
84
|
-
requirements:
|
|
85
|
-
- - "~>"
|
|
86
|
-
- !ruby/object:Gem::Version
|
|
87
|
-
version: '3'
|
|
88
|
-
- !ruby/object:Gem::Dependency
|
|
89
|
-
name: rspec_junit_formatter
|
|
90
|
-
requirement: !ruby/object:Gem::Requirement
|
|
91
|
-
requirements:
|
|
92
|
-
- - ">="
|
|
93
|
-
- !ruby/object:Gem::Version
|
|
94
|
-
version: '0'
|
|
95
|
-
type: :development
|
|
96
|
-
prerelease: false
|
|
97
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
98
|
-
requirements:
|
|
99
|
-
- - ">="
|
|
100
|
-
- !ruby/object:Gem::Version
|
|
101
|
-
version: '0'
|
|
102
|
-
- !ruby/object:Gem::Dependency
|
|
103
|
-
name: rubocop
|
|
104
|
-
requirement: !ruby/object:Gem::Requirement
|
|
105
|
-
requirements:
|
|
106
|
-
- - ">="
|
|
107
|
-
- !ruby/object:Gem::Version
|
|
108
|
-
version: '0'
|
|
109
|
-
type: :development
|
|
110
|
-
prerelease: false
|
|
111
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
112
|
-
requirements:
|
|
113
|
-
- - ">="
|
|
114
|
-
- !ruby/object:Gem::Version
|
|
115
|
-
version: '0'
|
|
116
|
-
- !ruby/object:Gem::Dependency
|
|
117
|
-
name: yard
|
|
118
|
-
requirement: !ruby/object:Gem::Requirement
|
|
119
|
-
requirements:
|
|
120
|
-
- - ">="
|
|
121
|
-
- !ruby/object:Gem::Version
|
|
122
|
-
version: '0'
|
|
123
|
-
type: :development
|
|
124
|
-
prerelease: false
|
|
125
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
126
|
-
requirements:
|
|
127
|
-
- - ">="
|
|
128
|
-
- !ruby/object:Gem::Version
|
|
129
|
-
version: '0'
|
|
130
60
|
email:
|
|
131
61
|
- nestor@custodio.org
|
|
132
62
|
executables: []
|
|
133
63
|
extensions: []
|
|
134
64
|
extra_rdoc_files: []
|
|
135
65
|
files:
|
|
136
|
-
- ".circleci/config.yml"
|
|
137
|
-
- ".gitignore"
|
|
138
|
-
- ".rspec"
|
|
139
|
-
- ".rubocop.yml"
|
|
140
|
-
- ".ruby-version"
|
|
141
|
-
- ".yardopts"
|
|
142
66
|
- Gemfile
|
|
143
67
|
- Gemfile.lock
|
|
144
68
|
- LICENSE.txt
|
|
145
69
|
- README.md
|
|
146
70
|
- Rakefile
|
|
147
|
-
- bin/console
|
|
148
|
-
- bin/setup
|
|
149
|
-
- docs/EnvParser.html
|
|
150
|
-
- docs/EnvParser/AutoregisterFileNotFound.html
|
|
151
|
-
- docs/EnvParser/Error.html
|
|
152
|
-
- docs/EnvParser/TypeAlreadyDefined.html
|
|
153
|
-
- docs/EnvParser/TypeAlreadyDefinedError.html
|
|
154
|
-
- docs/EnvParser/Types.html
|
|
155
|
-
- docs/EnvParser/Types/BaseTypes.html
|
|
156
|
-
- docs/EnvParser/Types/ChronologyTypes.html
|
|
157
|
-
- docs/EnvParser/Types/InternetTypes.html
|
|
158
|
-
- docs/EnvParser/UnknownTypeError.html
|
|
159
|
-
- docs/EnvParser/UnparseableAutoregisterSpec.html
|
|
160
|
-
- docs/EnvParser/ValueNotAllowed.html
|
|
161
|
-
- docs/EnvParser/ValueNotAllowedError.html
|
|
162
|
-
- docs/EnvParser/ValueNotConvertibleError.html
|
|
163
|
-
- docs/EnvParserTypes.html
|
|
164
|
-
- docs/EnvParserTypes/BaseTypes.html
|
|
165
|
-
- docs/EnvParserTypes/ChronologyTypes.html
|
|
166
|
-
- docs/EnvParserTypes/InternetTypes.html
|
|
167
|
-
- docs/EnvParserTypes/TimeTypes.html
|
|
168
|
-
- docs/_index.html
|
|
169
|
-
- docs/class_list.html
|
|
170
|
-
- docs/css/common.css
|
|
171
|
-
- docs/css/full_list.css
|
|
172
|
-
- docs/css/style.css
|
|
173
|
-
- docs/file.README.html
|
|
174
|
-
- docs/file_list.html
|
|
175
|
-
- docs/frames.html
|
|
176
|
-
- docs/index.html
|
|
177
|
-
- docs/js/app.js
|
|
178
|
-
- docs/js/full_list.js
|
|
179
|
-
- docs/js/jquery.js
|
|
180
|
-
- docs/method_list.html
|
|
181
|
-
- docs/top-level-namespace.html
|
|
182
71
|
- env_parser.gemspec
|
|
183
72
|
- lib/env_parser.rb
|
|
184
73
|
- lib/env_parser/autoregister.rb
|
|
@@ -192,7 +81,9 @@ homepage: https://github.com/nestor-custodio/env_parser
|
|
|
192
81
|
licenses:
|
|
193
82
|
- MIT
|
|
194
83
|
metadata:
|
|
84
|
+
allowed_push_host: https://rubygems.org
|
|
195
85
|
rubygems_mfa_required: 'true'
|
|
86
|
+
homepage_uri: https://github.com/nestor-custodio/env_parser
|
|
196
87
|
rdoc_options: []
|
|
197
88
|
require_paths:
|
|
198
89
|
- lib
|
|
@@ -200,7 +91,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
200
91
|
requirements:
|
|
201
92
|
- - ">="
|
|
202
93
|
- !ruby/object:Gem::Version
|
|
203
|
-
version: '3'
|
|
94
|
+
version: '3.4'
|
|
204
95
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
205
96
|
requirements:
|
|
206
97
|
- - ">="
|
data/.circleci/config.yml
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
# Ruby CircleCI 2.0 configuration file
|
|
2
|
-
#
|
|
3
|
-
# Check https://circleci.com/docs/2.0/language-ruby/ for more details
|
|
4
|
-
#
|
|
5
|
-
version: 2.1
|
|
6
|
-
jobs:
|
|
7
|
-
build:
|
|
8
|
-
docker:
|
|
9
|
-
# specify the version you desire here
|
|
10
|
-
- image: cimg/ruby:3.4
|
|
11
|
-
|
|
12
|
-
# Specify service dependencies here if necessary
|
|
13
|
-
# CircleCI maintains a library of pre-built images
|
|
14
|
-
# documented at https://circleci.com/docs/2.0/circleci-images/
|
|
15
|
-
# - image: circleci/postgres:9.4
|
|
16
|
-
|
|
17
|
-
working_directory: ~/repo
|
|
18
|
-
|
|
19
|
-
steps:
|
|
20
|
-
- checkout
|
|
21
|
-
|
|
22
|
-
# Download and cache dependencies
|
|
23
|
-
- restore_cache:
|
|
24
|
-
keys:
|
|
25
|
-
- v1-dependencies-{{ checksum "Gemfile.lock" }}
|
|
26
|
-
# fall back to using the latest cache if no exact match is found
|
|
27
|
-
- v1-dependencies
|
|
28
|
-
|
|
29
|
-
- run:
|
|
30
|
-
name: update bundler
|
|
31
|
-
command: |
|
|
32
|
-
gem install bundler --version $(tail -n 1 ~/repo/Gemfile.lock | tr -d ' ')
|
|
33
|
-
|
|
34
|
-
- run:
|
|
35
|
-
name: install dependencies
|
|
36
|
-
command: |
|
|
37
|
-
bundle config set path vendor/bundle
|
|
38
|
-
bundle install --jobs=$(nproc) --retry=3
|
|
39
|
-
|
|
40
|
-
- save_cache:
|
|
41
|
-
paths:
|
|
42
|
-
- ./vendor/bundle
|
|
43
|
-
key: v1-dependencies-{{ checksum "Gemfile.lock" }}
|
|
44
|
-
|
|
45
|
-
# run tests!
|
|
46
|
-
- run:
|
|
47
|
-
name: run tests
|
|
48
|
-
command: |
|
|
49
|
-
mkdir /tmp/test-results
|
|
50
|
-
TEST_FILES="$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)"
|
|
51
|
-
|
|
52
|
-
bundle exec rspec --format progress \
|
|
53
|
-
--format RspecJunitFormatter \
|
|
54
|
-
--out /tmp/test-results/rspec.xml \
|
|
55
|
-
--format progress \
|
|
56
|
-
-- \
|
|
57
|
-
$TEST_FILES
|
|
58
|
-
|
|
59
|
-
# collect reports
|
|
60
|
-
- store_test_results:
|
|
61
|
-
path: /tmp/test-results
|
|
62
|
-
- store_artifacts:
|
|
63
|
-
path: /tmp/test-results
|
|
64
|
-
destination: test-results
|