config_default 0.2.4 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/main.yml +1 -1
- data/CHANGELOG.md +21 -0
- data/Gemfile.lock +179 -138
- data/README.md +3 -3
- data/lib/config_default/init.rb +20 -3
- data/lib/config_default/struct.rb +2 -6
- data/lib/config_default/version.rb +1 -1
- data/lib/config_default.rb +4 -9
- metadata +3 -5
- data/lib/config_default/rails_application_configuration_extension.rb +0 -11
- data/lib/config_default/rails_application_extension.rb +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3ee450c0ba68badbd9918f55242afccc8c61368591c3f430cc42fc6ddc84d3ad
|
4
|
+
data.tar.gz: a6d5aa218bdf39fd65a6b19c223b196e5358327aaf7011529c31673b236a8cd2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be3a0b8ce4621dad804e5d767d9da31170c35044712caf503320d584b25fd1430c3fa6e7140f3a02a6cc161370dfa3397d306e2bdb00d73ab6c73a7fa7da2383
|
7
|
+
data.tar.gz: b17ceb5c71b2c2dc054ced8496392cebcf9846ff72961ee1b3df2872f27cfed2ef1e2ca099b38e51ec036f3102a9eea5f512a61cd34382698f14709298e8b84c
|
data/.github/workflows/main.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,24 @@
|
|
1
|
+
## 0.2.5
|
2
|
+
|
3
|
+
- Remove `attributes` keyword.
|
4
|
+
- Development dependency gems upgrade.
|
5
|
+
|
6
|
+
## 0.2.4
|
7
|
+
|
8
|
+
- Avoid `symbolize_keys' for nil:NilClass error.
|
9
|
+
|
10
|
+
## 0.2.3
|
11
|
+
|
12
|
+
- Moving to ArgumentError for better semantics.
|
13
|
+
|
14
|
+
## 0.2.1
|
15
|
+
|
16
|
+
- Better rails monkey path apply. Rails extension classes without namespace.
|
17
|
+
|
18
|
+
## 0.2.0
|
19
|
+
|
20
|
+
- New gem version with better code organization.
|
21
|
+
|
1
22
|
## 0.1.2
|
2
23
|
|
3
24
|
- Move config struct option definition from `#method_missing` to `#define_singleton_method`
|
data/Gemfile.lock
CHANGED
@@ -1,214 +1,255 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
config_default (0.
|
4
|
+
config_default (0.3.0)
|
5
5
|
activesupport (>= 6)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
actioncable (7.
|
11
|
-
actionpack (= 7.
|
12
|
-
activesupport (= 7.
|
10
|
+
actioncable (7.1.1)
|
11
|
+
actionpack (= 7.1.1)
|
12
|
+
activesupport (= 7.1.1)
|
13
13
|
nio4r (~> 2.0)
|
14
14
|
websocket-driver (>= 0.6.1)
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
15
|
+
zeitwerk (~> 2.6)
|
16
|
+
actionmailbox (7.1.1)
|
17
|
+
actionpack (= 7.1.1)
|
18
|
+
activejob (= 7.1.1)
|
19
|
+
activerecord (= 7.1.1)
|
20
|
+
activestorage (= 7.1.1)
|
21
|
+
activesupport (= 7.1.1)
|
21
22
|
mail (>= 2.7.1)
|
22
23
|
net-imap
|
23
24
|
net-pop
|
24
25
|
net-smtp
|
25
|
-
actionmailer (7.
|
26
|
-
actionpack (= 7.
|
27
|
-
actionview (= 7.
|
28
|
-
activejob (= 7.
|
29
|
-
activesupport (= 7.
|
26
|
+
actionmailer (7.1.1)
|
27
|
+
actionpack (= 7.1.1)
|
28
|
+
actionview (= 7.1.1)
|
29
|
+
activejob (= 7.1.1)
|
30
|
+
activesupport (= 7.1.1)
|
30
31
|
mail (~> 2.5, >= 2.5.4)
|
31
32
|
net-imap
|
32
33
|
net-pop
|
33
34
|
net-smtp
|
34
|
-
rails-dom-testing (~> 2.
|
35
|
-
actionpack (7.
|
36
|
-
actionview (= 7.
|
37
|
-
activesupport (= 7.
|
38
|
-
|
35
|
+
rails-dom-testing (~> 2.2)
|
36
|
+
actionpack (7.1.1)
|
37
|
+
actionview (= 7.1.1)
|
38
|
+
activesupport (= 7.1.1)
|
39
|
+
nokogiri (>= 1.8.5)
|
40
|
+
rack (>= 2.2.4)
|
41
|
+
rack-session (>= 1.0.1)
|
39
42
|
rack-test (>= 0.6.3)
|
40
|
-
rails-dom-testing (~> 2.
|
41
|
-
rails-html-sanitizer (~> 1.
|
42
|
-
actiontext (7.
|
43
|
-
actionpack (= 7.
|
44
|
-
activerecord (= 7.
|
45
|
-
activestorage (= 7.
|
46
|
-
activesupport (= 7.
|
43
|
+
rails-dom-testing (~> 2.2)
|
44
|
+
rails-html-sanitizer (~> 1.6)
|
45
|
+
actiontext (7.1.1)
|
46
|
+
actionpack (= 7.1.1)
|
47
|
+
activerecord (= 7.1.1)
|
48
|
+
activestorage (= 7.1.1)
|
49
|
+
activesupport (= 7.1.1)
|
47
50
|
globalid (>= 0.6.0)
|
48
51
|
nokogiri (>= 1.8.5)
|
49
|
-
actionview (7.
|
50
|
-
activesupport (= 7.
|
52
|
+
actionview (7.1.1)
|
53
|
+
activesupport (= 7.1.1)
|
51
54
|
builder (~> 3.1)
|
52
|
-
erubi (~> 1.
|
53
|
-
rails-dom-testing (~> 2.
|
54
|
-
rails-html-sanitizer (~> 1.
|
55
|
-
activejob (7.
|
56
|
-
activesupport (= 7.
|
55
|
+
erubi (~> 1.11)
|
56
|
+
rails-dom-testing (~> 2.2)
|
57
|
+
rails-html-sanitizer (~> 1.6)
|
58
|
+
activejob (7.1.1)
|
59
|
+
activesupport (= 7.1.1)
|
57
60
|
globalid (>= 0.3.6)
|
58
|
-
activemodel (7.
|
59
|
-
activesupport (= 7.
|
60
|
-
activerecord (7.
|
61
|
-
activemodel (= 7.
|
62
|
-
activesupport (= 7.
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
61
|
+
activemodel (7.1.1)
|
62
|
+
activesupport (= 7.1.1)
|
63
|
+
activerecord (7.1.1)
|
64
|
+
activemodel (= 7.1.1)
|
65
|
+
activesupport (= 7.1.1)
|
66
|
+
timeout (>= 0.4.0)
|
67
|
+
activestorage (7.1.1)
|
68
|
+
actionpack (= 7.1.1)
|
69
|
+
activejob (= 7.1.1)
|
70
|
+
activerecord (= 7.1.1)
|
71
|
+
activesupport (= 7.1.1)
|
68
72
|
marcel (~> 1.0)
|
69
|
-
|
70
|
-
|
73
|
+
activesupport (7.1.1)
|
74
|
+
base64
|
75
|
+
bigdecimal
|
71
76
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
77
|
+
connection_pool (>= 2.2.5)
|
78
|
+
drb
|
72
79
|
i18n (>= 1.6, < 2)
|
73
80
|
minitest (>= 5.1)
|
81
|
+
mutex_m
|
74
82
|
tzinfo (~> 2.0)
|
75
83
|
ast (2.4.2)
|
84
|
+
base64 (0.1.1)
|
85
|
+
bigdecimal (3.1.4)
|
76
86
|
builder (3.2.4)
|
77
87
|
coderay (1.1.3)
|
78
|
-
concurrent-ruby (1.
|
88
|
+
concurrent-ruby (1.2.2)
|
89
|
+
connection_pool (2.4.1)
|
79
90
|
crass (1.0.6)
|
91
|
+
date (3.3.3)
|
80
92
|
diff-lcs (1.5.0)
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
93
|
+
drb (2.1.1)
|
94
|
+
ruby2_keywords
|
95
|
+
erubi (1.12.0)
|
96
|
+
globalid (1.2.1)
|
97
|
+
activesupport (>= 6.1)
|
98
|
+
i18n (1.14.1)
|
86
99
|
concurrent-ruby (~> 1.0)
|
87
|
-
|
100
|
+
io-console (0.6.0)
|
101
|
+
irb (1.8.3)
|
102
|
+
rdoc
|
103
|
+
reline (>= 0.3.8)
|
104
|
+
json (2.6.3)
|
105
|
+
loofah (2.21.4)
|
88
106
|
crass (~> 1.0.2)
|
89
|
-
nokogiri (>= 1.
|
90
|
-
mail (2.
|
107
|
+
nokogiri (>= 1.12.0)
|
108
|
+
mail (2.8.1)
|
91
109
|
mini_mime (>= 0.1.1)
|
110
|
+
net-imap
|
111
|
+
net-pop
|
112
|
+
net-smtp
|
92
113
|
marcel (1.0.2)
|
93
114
|
method_source (1.0.0)
|
94
|
-
mini_mime (1.1.
|
95
|
-
minitest (5.
|
96
|
-
|
97
|
-
|
115
|
+
mini_mime (1.1.5)
|
116
|
+
minitest (5.20.0)
|
117
|
+
mutex_m (0.1.2)
|
118
|
+
net-imap (0.4.3)
|
119
|
+
date
|
98
120
|
net-protocol
|
99
|
-
|
100
|
-
net-pop (0.1.1)
|
101
|
-
digest
|
121
|
+
net-pop (0.1.2)
|
102
122
|
net-protocol
|
123
|
+
net-protocol (0.2.1)
|
103
124
|
timeout
|
104
|
-
net-
|
105
|
-
timeout
|
106
|
-
net-smtp (0.3.1)
|
107
|
-
digest
|
125
|
+
net-smtp (0.4.0)
|
108
126
|
net-protocol
|
109
|
-
|
110
|
-
|
111
|
-
|
127
|
+
nio4r (2.5.9)
|
128
|
+
nokogiri (1.15.4-arm64-darwin)
|
129
|
+
racc (~> 1.4)
|
130
|
+
nokogiri (1.15.4-x86_64-darwin)
|
112
131
|
racc (~> 1.4)
|
113
|
-
nokogiri (1.
|
132
|
+
nokogiri (1.15.4-x86_64-linux)
|
114
133
|
racc (~> 1.4)
|
115
|
-
parallel (1.
|
116
|
-
parser (3.
|
134
|
+
parallel (1.23.0)
|
135
|
+
parser (3.2.2.4)
|
117
136
|
ast (~> 2.4.1)
|
118
|
-
|
137
|
+
racc
|
138
|
+
pry (0.14.2)
|
119
139
|
coderay (~> 1.1)
|
120
140
|
method_source (~> 1.0)
|
121
|
-
|
122
|
-
|
123
|
-
|
141
|
+
psych (5.1.1.1)
|
142
|
+
stringio
|
143
|
+
racc (1.7.1)
|
144
|
+
rack (3.0.8)
|
145
|
+
rack-session (2.0.0)
|
146
|
+
rack (>= 3.0.0)
|
147
|
+
rack-test (2.1.0)
|
124
148
|
rack (>= 1.3)
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
149
|
+
rackup (2.1.0)
|
150
|
+
rack (>= 3)
|
151
|
+
webrick (~> 1.8)
|
152
|
+
rails (7.1.1)
|
153
|
+
actioncable (= 7.1.1)
|
154
|
+
actionmailbox (= 7.1.1)
|
155
|
+
actionmailer (= 7.1.1)
|
156
|
+
actionpack (= 7.1.1)
|
157
|
+
actiontext (= 7.1.1)
|
158
|
+
actionview (= 7.1.1)
|
159
|
+
activejob (= 7.1.1)
|
160
|
+
activemodel (= 7.1.1)
|
161
|
+
activerecord (= 7.1.1)
|
162
|
+
activestorage (= 7.1.1)
|
163
|
+
activesupport (= 7.1.1)
|
137
164
|
bundler (>= 1.15.0)
|
138
|
-
railties (= 7.
|
139
|
-
rails-dom-testing (2.0
|
140
|
-
activesupport (>=
|
165
|
+
railties (= 7.1.1)
|
166
|
+
rails-dom-testing (2.2.0)
|
167
|
+
activesupport (>= 5.0.0)
|
168
|
+
minitest
|
141
169
|
nokogiri (>= 1.6)
|
142
|
-
rails-html-sanitizer (1.
|
143
|
-
loofah (~> 2.
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
170
|
+
rails-html-sanitizer (1.6.0)
|
171
|
+
loofah (~> 2.21)
|
172
|
+
nokogiri (~> 1.14)
|
173
|
+
railties (7.1.1)
|
174
|
+
actionpack (= 7.1.1)
|
175
|
+
activesupport (= 7.1.1)
|
176
|
+
irb
|
177
|
+
rackup (>= 1.0.0)
|
148
178
|
rake (>= 12.2)
|
149
|
-
thor (~> 1.0)
|
150
|
-
zeitwerk (~> 2.
|
179
|
+
thor (~> 1.0, >= 1.2.2)
|
180
|
+
zeitwerk (~> 2.6)
|
151
181
|
rainbow (3.1.1)
|
152
|
-
rake (13.0
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
rspec
|
160
|
-
rspec-
|
161
|
-
|
182
|
+
rake (13.1.0)
|
183
|
+
rdoc (6.5.0)
|
184
|
+
psych (>= 4.0.0)
|
185
|
+
regexp_parser (2.8.2)
|
186
|
+
reline (0.3.9)
|
187
|
+
io-console (~> 0.5)
|
188
|
+
rexml (3.2.6)
|
189
|
+
rspec (3.12.0)
|
190
|
+
rspec-core (~> 3.12.0)
|
191
|
+
rspec-expectations (~> 3.12.0)
|
192
|
+
rspec-mocks (~> 3.12.0)
|
193
|
+
rspec-core (3.12.2)
|
194
|
+
rspec-support (~> 3.12.0)
|
195
|
+
rspec-expectations (3.12.3)
|
162
196
|
diff-lcs (>= 1.2.0, < 2.0)
|
163
|
-
rspec-support (~> 3.
|
164
|
-
rspec-mocks (3.
|
197
|
+
rspec-support (~> 3.12.0)
|
198
|
+
rspec-mocks (3.12.6)
|
165
199
|
diff-lcs (>= 1.2.0, < 2.0)
|
166
|
-
rspec-support (~> 3.
|
167
|
-
rspec-support (3.
|
168
|
-
rubocop (1.
|
200
|
+
rspec-support (~> 3.12.0)
|
201
|
+
rspec-support (3.12.1)
|
202
|
+
rubocop (1.50.2)
|
203
|
+
json (~> 2.3)
|
169
204
|
parallel (~> 1.10)
|
170
|
-
parser (>= 3.
|
205
|
+
parser (>= 3.2.0.0)
|
171
206
|
rainbow (>= 2.2.2, < 4.0)
|
172
207
|
regexp_parser (>= 1.8, < 3.0)
|
173
208
|
rexml (>= 3.2.5, < 4.0)
|
174
|
-
rubocop-ast (>= 1.
|
209
|
+
rubocop-ast (>= 1.28.0, < 2.0)
|
175
210
|
ruby-progressbar (~> 1.7)
|
176
|
-
unicode-display_width (>=
|
177
|
-
rubocop-ast (1.
|
178
|
-
parser (>= 3.
|
179
|
-
rubocop-
|
180
|
-
rubocop (~> 1.
|
181
|
-
|
182
|
-
rubocop
|
211
|
+
unicode-display_width (>= 2.4.0, < 3.0)
|
212
|
+
rubocop-ast (1.30.0)
|
213
|
+
parser (>= 3.2.1.0)
|
214
|
+
rubocop-capybara (2.19.0)
|
215
|
+
rubocop (~> 1.41)
|
216
|
+
rubocop-config-umbrellio (1.50.0.85)
|
217
|
+
rubocop (~> 1.50.0)
|
218
|
+
rubocop-performance (~> 1.17.0)
|
219
|
+
rubocop-rails (~> 2.19.0)
|
183
220
|
rubocop-rake (~> 0.6.0)
|
184
|
-
rubocop-rspec (~> 2.
|
221
|
+
rubocop-rspec (~> 2.20.0)
|
185
222
|
rubocop-sequel (~> 0.3.3)
|
186
|
-
rubocop-performance (1.
|
223
|
+
rubocop-performance (1.17.1)
|
187
224
|
rubocop (>= 1.7.0, < 2.0)
|
188
225
|
rubocop-ast (>= 0.4.0)
|
189
|
-
rubocop-rails (2.
|
226
|
+
rubocop-rails (2.19.1)
|
190
227
|
activesupport (>= 4.2.0)
|
191
228
|
rack (>= 1.1)
|
192
|
-
rubocop (>= 1.
|
229
|
+
rubocop (>= 1.33.0, < 2.0)
|
193
230
|
rubocop-rake (0.6.0)
|
194
231
|
rubocop (~> 1.0)
|
195
|
-
rubocop-rspec (2.
|
196
|
-
rubocop (~> 1.
|
232
|
+
rubocop-rspec (2.20.0)
|
233
|
+
rubocop (~> 1.33)
|
234
|
+
rubocop-capybara (~> 2.17)
|
197
235
|
rubocop-sequel (0.3.4)
|
198
236
|
rubocop (~> 1.0)
|
199
|
-
ruby-progressbar (1.
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
237
|
+
ruby-progressbar (1.13.0)
|
238
|
+
ruby2_keywords (0.0.5)
|
239
|
+
stringio (3.0.8)
|
240
|
+
thor (1.3.0)
|
241
|
+
timeout (0.4.0)
|
242
|
+
tzinfo (2.0.6)
|
204
243
|
concurrent-ruby (~> 1.0)
|
205
|
-
unicode-display_width (2.
|
206
|
-
|
244
|
+
unicode-display_width (2.5.0)
|
245
|
+
webrick (1.8.1)
|
246
|
+
websocket-driver (0.7.6)
|
207
247
|
websocket-extensions (>= 0.1.0)
|
208
248
|
websocket-extensions (0.1.5)
|
209
|
-
zeitwerk (2.6.
|
249
|
+
zeitwerk (2.6.12)
|
210
250
|
|
211
251
|
PLATFORMS
|
252
|
+
arm64-darwin-22
|
212
253
|
x86_64-darwin-20
|
213
254
|
x86_64-darwin-21
|
214
255
|
x86_64-linux
|
@@ -222,4 +263,4 @@ DEPENDENCIES
|
|
222
263
|
rubocop-config-umbrellio
|
223
264
|
|
224
265
|
BUNDLED WITH
|
225
|
-
2.
|
266
|
+
2.4.19
|
data/README.md
CHANGED
@@ -33,11 +33,11 @@ end
|
|
33
33
|
```
|
34
34
|
|
35
35
|
If you want to implement Rails monkey patches for `Rails.application.config_for` and ability to
|
36
|
-
separate `database.yml` file you need to apply `#
|
36
|
+
separate `database.yml` file you need to apply `#init_rails_patch!` method in your
|
37
37
|
`application.yml` file before application initialization.
|
38
38
|
|
39
39
|
```ruby
|
40
|
-
ConfigDefault.
|
40
|
+
ConfigDefault.init_rails_patch!
|
41
41
|
```
|
42
42
|
|
43
43
|
## Usage
|
@@ -170,7 +170,7 @@ Here an example of creation struct object on the fly:
|
|
170
170
|
|
171
171
|
```ruby
|
172
172
|
config_on_the_fly = { first: { second: { third: "option" } } }
|
173
|
-
config = ConfigDefault::Struct.new(
|
173
|
+
config = ConfigDefault::Struct.new(config_on_the_fly, recursive: true)
|
174
174
|
config.first.to_hash
|
175
175
|
# => { "second" => { "third" => "option" } }
|
176
176
|
config.first.second.third
|
data/lib/config_default/init.rb
CHANGED
@@ -1,12 +1,29 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
module ConfigDefault::RailsApplicationConfigurationPatch
|
4
|
+
def load_database_yaml
|
5
|
+
ConfigDefault.load(:database, key: nil)
|
6
|
+
end
|
7
|
+
|
8
|
+
def database_configuration
|
9
|
+
load_database_yaml
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
module ConfigDefault::RailsApplicationPatch
|
14
|
+
def config_for(name, env: Rails.env)
|
15
|
+
data = ConfigDefault.load(name, key: env, deep_symbolize_keys: true)
|
16
|
+
ActiveSupport::OrderedOptions.new.merge(data)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
3
20
|
module ConfigDefault::Init
|
4
21
|
extend self
|
5
22
|
|
6
|
-
def
|
23
|
+
def init_rails_patch!
|
7
24
|
return unless Object.const_defined?(:Rails)
|
8
25
|
|
9
|
-
Rails::Application.prepend(ConfigDefault::
|
10
|
-
Rails::Application::Configuration.prepend(ConfigDefault::
|
26
|
+
Rails::Application.prepend(ConfigDefault::RailsApplicationPatch)
|
27
|
+
Rails::Application::Configuration.prepend(ConfigDefault::RailsApplicationConfigurationPatch)
|
11
28
|
end
|
12
29
|
end
|
@@ -3,7 +3,7 @@
|
|
3
3
|
class ConfigDefault::Struct
|
4
4
|
RESERVED_METHODS = %i[method_missing respond_to_missing? to_hash].freeze
|
5
5
|
|
6
|
-
def initialize(attributes
|
6
|
+
def initialize(attributes, recursive: false, allow_nil: false)
|
7
7
|
@attributes = ActiveSupport::HashWithIndifferentAccess.new(attributes)
|
8
8
|
@allow_nil = allow_nil
|
9
9
|
@recursive = recursive
|
@@ -47,11 +47,7 @@ class ConfigDefault::Struct
|
|
47
47
|
|
48
48
|
@attributes.each do |key, value|
|
49
49
|
next unless value.is_a?(Hash)
|
50
|
-
@attributes[key] = self.class.new(
|
51
|
-
attributes: value,
|
52
|
-
recursive: @recursive,
|
53
|
-
allow_nil: @allow_nil,
|
54
|
-
)
|
50
|
+
@attributes[key] = self.class.new(value, recursive: @recursive, allow_nil: @allow_nil)
|
55
51
|
end
|
56
52
|
end
|
57
53
|
|
data/lib/config_default.rb
CHANGED
@@ -6,8 +6,6 @@ require "config_default/version"
|
|
6
6
|
require "config_default/config"
|
7
7
|
require "config_default/init"
|
8
8
|
require "config_default/struct"
|
9
|
-
require "config_default/rails_application_extension"
|
10
|
-
require "config_default/rails_application_configuration_extension"
|
11
9
|
|
12
10
|
module ConfigDefault
|
13
11
|
extend self
|
@@ -20,8 +18,8 @@ module ConfigDefault
|
|
20
18
|
yield(config) if block_given?
|
21
19
|
end
|
22
20
|
|
23
|
-
def
|
24
|
-
ConfigDefault::Init.
|
21
|
+
def init_rails_patch!
|
22
|
+
ConfigDefault::Init.init_rails_patch!
|
25
23
|
end
|
26
24
|
|
27
25
|
def load(name, key: Rails.env, symbolize_keys: false, deep_symbolize_keys: false)
|
@@ -50,10 +48,7 @@ module ConfigDefault
|
|
50
48
|
end
|
51
49
|
|
52
50
|
def load_struct(name, key: Rails.env, recursive: false, allow_nil: false)
|
53
|
-
|
54
|
-
|
55
|
-
recursive: recursive,
|
56
|
-
allow_nil: allow_nil,
|
57
|
-
)
|
51
|
+
attributes = load(name, key: key)
|
52
|
+
ConfigDefault::Struct.new(attributes, recursive: recursive, allow_nil: allow_nil)
|
58
53
|
end
|
59
54
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: config_default
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stepan Kirushkin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-10-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -47,8 +47,6 @@ files:
|
|
47
47
|
- lib/config_default.rb
|
48
48
|
- lib/config_default/config.rb
|
49
49
|
- lib/config_default/init.rb
|
50
|
-
- lib/config_default/rails_application_configuration_extension.rb
|
51
|
-
- lib/config_default/rails_application_extension.rb
|
52
50
|
- lib/config_default/struct.rb
|
53
51
|
- lib/config_default/version.rb
|
54
52
|
homepage: https://github.com/skirushkin/config_default
|
@@ -73,7 +71,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
73
71
|
- !ruby/object:Gem::Version
|
74
72
|
version: '0'
|
75
73
|
requirements: []
|
76
|
-
rubygems_version: 3.
|
74
|
+
rubygems_version: 3.4.19
|
77
75
|
signing_key:
|
78
76
|
specification_version: 4
|
79
77
|
summary: A simple way to manage default and env configuration in Rails.
|