config_default 0.3.0 → 0.3.2
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 → ci.yml} +19 -2
- data/.rubocop.yml +1 -0
- data/CHANGELOG.md +15 -0
- data/Gemfile.lock +134 -123
- data/README.md +6 -5
- data/lib/config_default/{init.rb → rails_patch.rb} +2 -2
- data/lib/config_default/version.rb +1 -1
- data/lib/config_default.rb +4 -4
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9c957f780b6cc5bd9c0f02e4464bc39de39bef79e7ffe8aaf74a1c656013a271
|
4
|
+
data.tar.gz: 3d74c4af84249765e0df536b80bd788a46df2e3572127560f308771bf0a987c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a87866e4a1fe147620ed030130398a08e746f8b9a860c690ecd63112cfa7d63928cd726ec784cf552ce586bddaaa900231760af4e645f44d2b4da2a2fefcfbd
|
7
|
+
data.tar.gz: a5c8644094054c45a958654e7478649e918dec2133d7a91d12097455ac231f22c0491264cc4a445d2fff4610d7200c75d948a7091ebba87d62d54f01e1c8ef34
|
@@ -1,4 +1,4 @@
|
|
1
|
-
name:
|
1
|
+
name: CI
|
2
2
|
|
3
3
|
on:
|
4
4
|
push:
|
@@ -24,7 +24,7 @@ jobs:
|
|
24
24
|
|
25
25
|
strategy:
|
26
26
|
matrix:
|
27
|
-
ruby: [
|
27
|
+
ruby: [3.0, 3.1, 3.2, 3.3]
|
28
28
|
|
29
29
|
steps:
|
30
30
|
- uses: actions/checkout@v2
|
@@ -34,3 +34,20 @@ jobs:
|
|
34
34
|
bundler-cache: true
|
35
35
|
- name: Run rspec
|
36
36
|
run: bundle exec rspec
|
37
|
+
|
38
|
+
release:
|
39
|
+
runs-on: ubuntu-latest
|
40
|
+
|
41
|
+
environment: release
|
42
|
+
|
43
|
+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
|
44
|
+
|
45
|
+
steps:
|
46
|
+
- uses: actions/checkout@v3
|
47
|
+
|
48
|
+
- name: Release Gem
|
49
|
+
uses: skirushkin/publish-rubygems-action@main
|
50
|
+
env:
|
51
|
+
RUBYGEMS_API_KEY: ${{secrets.RUBYGEMS_API_KEY}}
|
52
|
+
GIT_EMAIL: stepan.kirushkin@gmail.com
|
53
|
+
GIT_NAME: Stepan Kirushkin
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,18 @@
|
|
1
|
+
## 0.3.2
|
2
|
+
|
3
|
+
- Move patches to RailsPatch Module.
|
4
|
+
- Introduce `#apply_rails_patch!`
|
5
|
+
|
6
|
+
## 0.3.1
|
7
|
+
|
8
|
+
- Automate CI release
|
9
|
+
|
10
|
+
## 0.3.0
|
11
|
+
|
12
|
+
- Rename Extension to Patch and move to Init Module.
|
13
|
+
- Update various gems.
|
14
|
+
- Rails 7.1 support check.
|
15
|
+
|
1
16
|
## 0.2.5
|
2
17
|
|
3
18
|
- Remove `attributes` keyword.
|
data/Gemfile.lock
CHANGED
@@ -1,76 +1,77 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
config_default (0.3.
|
4
|
+
config_default (0.3.2)
|
5
5
|
activesupport (>= 6)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
actioncable (7.1.
|
11
|
-
actionpack (= 7.1.
|
12
|
-
activesupport (= 7.1.
|
10
|
+
actioncable (7.1.3.3)
|
11
|
+
actionpack (= 7.1.3.3)
|
12
|
+
activesupport (= 7.1.3.3)
|
13
13
|
nio4r (~> 2.0)
|
14
14
|
websocket-driver (>= 0.6.1)
|
15
15
|
zeitwerk (~> 2.6)
|
16
|
-
actionmailbox (7.1.
|
17
|
-
actionpack (= 7.1.
|
18
|
-
activejob (= 7.1.
|
19
|
-
activerecord (= 7.1.
|
20
|
-
activestorage (= 7.1.
|
21
|
-
activesupport (= 7.1.
|
16
|
+
actionmailbox (7.1.3.3)
|
17
|
+
actionpack (= 7.1.3.3)
|
18
|
+
activejob (= 7.1.3.3)
|
19
|
+
activerecord (= 7.1.3.3)
|
20
|
+
activestorage (= 7.1.3.3)
|
21
|
+
activesupport (= 7.1.3.3)
|
22
22
|
mail (>= 2.7.1)
|
23
23
|
net-imap
|
24
24
|
net-pop
|
25
25
|
net-smtp
|
26
|
-
actionmailer (7.1.
|
27
|
-
actionpack (= 7.1.
|
28
|
-
actionview (= 7.1.
|
29
|
-
activejob (= 7.1.
|
30
|
-
activesupport (= 7.1.
|
26
|
+
actionmailer (7.1.3.3)
|
27
|
+
actionpack (= 7.1.3.3)
|
28
|
+
actionview (= 7.1.3.3)
|
29
|
+
activejob (= 7.1.3.3)
|
30
|
+
activesupport (= 7.1.3.3)
|
31
31
|
mail (~> 2.5, >= 2.5.4)
|
32
32
|
net-imap
|
33
33
|
net-pop
|
34
34
|
net-smtp
|
35
35
|
rails-dom-testing (~> 2.2)
|
36
|
-
actionpack (7.1.
|
37
|
-
actionview (= 7.1.
|
38
|
-
activesupport (= 7.1.
|
36
|
+
actionpack (7.1.3.3)
|
37
|
+
actionview (= 7.1.3.3)
|
38
|
+
activesupport (= 7.1.3.3)
|
39
39
|
nokogiri (>= 1.8.5)
|
40
|
+
racc
|
40
41
|
rack (>= 2.2.4)
|
41
42
|
rack-session (>= 1.0.1)
|
42
43
|
rack-test (>= 0.6.3)
|
43
44
|
rails-dom-testing (~> 2.2)
|
44
45
|
rails-html-sanitizer (~> 1.6)
|
45
|
-
actiontext (7.1.
|
46
|
-
actionpack (= 7.1.
|
47
|
-
activerecord (= 7.1.
|
48
|
-
activestorage (= 7.1.
|
49
|
-
activesupport (= 7.1.
|
46
|
+
actiontext (7.1.3.3)
|
47
|
+
actionpack (= 7.1.3.3)
|
48
|
+
activerecord (= 7.1.3.3)
|
49
|
+
activestorage (= 7.1.3.3)
|
50
|
+
activesupport (= 7.1.3.3)
|
50
51
|
globalid (>= 0.6.0)
|
51
52
|
nokogiri (>= 1.8.5)
|
52
|
-
actionview (7.1.
|
53
|
-
activesupport (= 7.1.
|
53
|
+
actionview (7.1.3.3)
|
54
|
+
activesupport (= 7.1.3.3)
|
54
55
|
builder (~> 3.1)
|
55
56
|
erubi (~> 1.11)
|
56
57
|
rails-dom-testing (~> 2.2)
|
57
58
|
rails-html-sanitizer (~> 1.6)
|
58
|
-
activejob (7.1.
|
59
|
-
activesupport (= 7.1.
|
59
|
+
activejob (7.1.3.3)
|
60
|
+
activesupport (= 7.1.3.3)
|
60
61
|
globalid (>= 0.3.6)
|
61
|
-
activemodel (7.1.
|
62
|
-
activesupport (= 7.1.
|
63
|
-
activerecord (7.1.
|
64
|
-
activemodel (= 7.1.
|
65
|
-
activesupport (= 7.1.
|
62
|
+
activemodel (7.1.3.3)
|
63
|
+
activesupport (= 7.1.3.3)
|
64
|
+
activerecord (7.1.3.3)
|
65
|
+
activemodel (= 7.1.3.3)
|
66
|
+
activesupport (= 7.1.3.3)
|
66
67
|
timeout (>= 0.4.0)
|
67
|
-
activestorage (7.1.
|
68
|
-
actionpack (= 7.1.
|
69
|
-
activejob (= 7.1.
|
70
|
-
activerecord (= 7.1.
|
71
|
-
activesupport (= 7.1.
|
68
|
+
activestorage (7.1.3.3)
|
69
|
+
actionpack (= 7.1.3.3)
|
70
|
+
activejob (= 7.1.3.3)
|
71
|
+
activerecord (= 7.1.3.3)
|
72
|
+
activesupport (= 7.1.3.3)
|
72
73
|
marcel (~> 1.0)
|
73
|
-
activesupport (7.1.
|
74
|
+
activesupport (7.1.3.3)
|
74
75
|
base64
|
75
76
|
bigdecimal
|
76
77
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
@@ -81,28 +82,28 @@ GEM
|
|
81
82
|
mutex_m
|
82
83
|
tzinfo (~> 2.0)
|
83
84
|
ast (2.4.2)
|
84
|
-
base64 (0.
|
85
|
-
bigdecimal (3.1.
|
85
|
+
base64 (0.2.0)
|
86
|
+
bigdecimal (3.1.8)
|
86
87
|
builder (3.2.4)
|
87
88
|
coderay (1.1.3)
|
88
|
-
concurrent-ruby (1.2.
|
89
|
+
concurrent-ruby (1.2.3)
|
89
90
|
connection_pool (2.4.1)
|
90
91
|
crass (1.0.6)
|
91
|
-
date (3.3.
|
92
|
-
diff-lcs (1.5.
|
93
|
-
drb (2.
|
94
|
-
ruby2_keywords
|
92
|
+
date (3.3.4)
|
93
|
+
diff-lcs (1.5.1)
|
94
|
+
drb (2.2.1)
|
95
95
|
erubi (1.12.0)
|
96
96
|
globalid (1.2.1)
|
97
97
|
activesupport (>= 6.1)
|
98
|
-
i18n (1.14.
|
98
|
+
i18n (1.14.5)
|
99
99
|
concurrent-ruby (~> 1.0)
|
100
|
-
io-console (0.
|
101
|
-
irb (1.
|
102
|
-
rdoc
|
103
|
-
reline (>= 0.
|
104
|
-
json (2.
|
105
|
-
|
100
|
+
io-console (0.7.2)
|
101
|
+
irb (1.13.1)
|
102
|
+
rdoc (>= 4.0.0)
|
103
|
+
reline (>= 0.4.2)
|
104
|
+
json (2.7.2)
|
105
|
+
language_server-protocol (3.17.0.3)
|
106
|
+
loofah (2.22.0)
|
106
107
|
crass (~> 1.0.2)
|
107
108
|
nokogiri (>= 1.12.0)
|
108
109
|
mail (2.8.1)
|
@@ -110,38 +111,38 @@ GEM
|
|
110
111
|
net-imap
|
111
112
|
net-pop
|
112
113
|
net-smtp
|
113
|
-
marcel (1.0.
|
114
|
-
method_source (1.
|
114
|
+
marcel (1.0.4)
|
115
|
+
method_source (1.1.0)
|
115
116
|
mini_mime (1.1.5)
|
116
|
-
minitest (5.
|
117
|
-
mutex_m (0.
|
118
|
-
net-imap (0.4.
|
117
|
+
minitest (5.23.1)
|
118
|
+
mutex_m (0.2.0)
|
119
|
+
net-imap (0.4.11)
|
119
120
|
date
|
120
121
|
net-protocol
|
121
122
|
net-pop (0.1.2)
|
122
123
|
net-protocol
|
123
|
-
net-protocol (0.2.
|
124
|
+
net-protocol (0.2.2)
|
124
125
|
timeout
|
125
|
-
net-smtp (0.
|
126
|
+
net-smtp (0.5.0)
|
126
127
|
net-protocol
|
127
|
-
nio4r (2.
|
128
|
-
nokogiri (1.
|
128
|
+
nio4r (2.7.3)
|
129
|
+
nokogiri (1.16.5-arm64-darwin)
|
129
130
|
racc (~> 1.4)
|
130
|
-
nokogiri (1.
|
131
|
+
nokogiri (1.16.5-x86_64-darwin)
|
131
132
|
racc (~> 1.4)
|
132
|
-
nokogiri (1.
|
133
|
+
nokogiri (1.16.5-x86_64-linux)
|
133
134
|
racc (~> 1.4)
|
134
|
-
parallel (1.
|
135
|
-
parser (3.
|
135
|
+
parallel (1.24.0)
|
136
|
+
parser (3.3.1.0)
|
136
137
|
ast (~> 2.4.1)
|
137
138
|
racc
|
138
139
|
pry (0.14.2)
|
139
140
|
coderay (~> 1.1)
|
140
141
|
method_source (~> 1.0)
|
141
|
-
psych (5.1.
|
142
|
+
psych (5.1.2)
|
142
143
|
stringio
|
143
|
-
racc (1.
|
144
|
-
rack (3.0.
|
144
|
+
racc (1.8.0)
|
145
|
+
rack (3.0.11)
|
145
146
|
rack-session (2.0.0)
|
146
147
|
rack (>= 3.0.0)
|
147
148
|
rack-test (2.1.0)
|
@@ -149,20 +150,20 @@ GEM
|
|
149
150
|
rackup (2.1.0)
|
150
151
|
rack (>= 3)
|
151
152
|
webrick (~> 1.8)
|
152
|
-
rails (7.1.
|
153
|
-
actioncable (= 7.1.
|
154
|
-
actionmailbox (= 7.1.
|
155
|
-
actionmailer (= 7.1.
|
156
|
-
actionpack (= 7.1.
|
157
|
-
actiontext (= 7.1.
|
158
|
-
actionview (= 7.1.
|
159
|
-
activejob (= 7.1.
|
160
|
-
activemodel (= 7.1.
|
161
|
-
activerecord (= 7.1.
|
162
|
-
activestorage (= 7.1.
|
163
|
-
activesupport (= 7.1.
|
153
|
+
rails (7.1.3.3)
|
154
|
+
actioncable (= 7.1.3.3)
|
155
|
+
actionmailbox (= 7.1.3.3)
|
156
|
+
actionmailer (= 7.1.3.3)
|
157
|
+
actionpack (= 7.1.3.3)
|
158
|
+
actiontext (= 7.1.3.3)
|
159
|
+
actionview (= 7.1.3.3)
|
160
|
+
activejob (= 7.1.3.3)
|
161
|
+
activemodel (= 7.1.3.3)
|
162
|
+
activerecord (= 7.1.3.3)
|
163
|
+
activestorage (= 7.1.3.3)
|
164
|
+
activesupport (= 7.1.3.3)
|
164
165
|
bundler (>= 1.15.0)
|
165
|
-
railties (= 7.1.
|
166
|
+
railties (= 7.1.3.3)
|
166
167
|
rails-dom-testing (2.2.0)
|
167
168
|
activesupport (>= 5.0.0)
|
168
169
|
minitest
|
@@ -170,75 +171,84 @@ GEM
|
|
170
171
|
rails-html-sanitizer (1.6.0)
|
171
172
|
loofah (~> 2.21)
|
172
173
|
nokogiri (~> 1.14)
|
173
|
-
railties (7.1.
|
174
|
-
actionpack (= 7.1.
|
175
|
-
activesupport (= 7.1.
|
174
|
+
railties (7.1.3.3)
|
175
|
+
actionpack (= 7.1.3.3)
|
176
|
+
activesupport (= 7.1.3.3)
|
176
177
|
irb
|
177
178
|
rackup (>= 1.0.0)
|
178
179
|
rake (>= 12.2)
|
179
180
|
thor (~> 1.0, >= 1.2.2)
|
180
181
|
zeitwerk (~> 2.6)
|
181
182
|
rainbow (3.1.1)
|
182
|
-
rake (13.1
|
183
|
-
rdoc (6.
|
183
|
+
rake (13.2.1)
|
184
|
+
rdoc (6.7.0)
|
184
185
|
psych (>= 4.0.0)
|
185
|
-
regexp_parser (2.
|
186
|
-
reline (0.
|
186
|
+
regexp_parser (2.9.2)
|
187
|
+
reline (0.5.7)
|
187
188
|
io-console (~> 0.5)
|
188
|
-
rexml (3.2.
|
189
|
-
|
190
|
-
|
191
|
-
rspec-
|
192
|
-
rspec-
|
193
|
-
|
194
|
-
|
195
|
-
|
189
|
+
rexml (3.2.8)
|
190
|
+
strscan (>= 3.0.9)
|
191
|
+
rspec (3.13.0)
|
192
|
+
rspec-core (~> 3.13.0)
|
193
|
+
rspec-expectations (~> 3.13.0)
|
194
|
+
rspec-mocks (~> 3.13.0)
|
195
|
+
rspec-core (3.13.0)
|
196
|
+
rspec-support (~> 3.13.0)
|
197
|
+
rspec-expectations (3.13.0)
|
196
198
|
diff-lcs (>= 1.2.0, < 2.0)
|
197
|
-
rspec-support (~> 3.
|
198
|
-
rspec-mocks (3.
|
199
|
+
rspec-support (~> 3.13.0)
|
200
|
+
rspec-mocks (3.13.1)
|
199
201
|
diff-lcs (>= 1.2.0, < 2.0)
|
200
|
-
rspec-support (~> 3.
|
201
|
-
rspec-support (3.
|
202
|
-
rubocop (1.
|
202
|
+
rspec-support (~> 3.13.0)
|
203
|
+
rspec-support (3.13.1)
|
204
|
+
rubocop (1.63.5)
|
203
205
|
json (~> 2.3)
|
206
|
+
language_server-protocol (>= 3.17.0)
|
204
207
|
parallel (~> 1.10)
|
205
|
-
parser (>= 3.
|
208
|
+
parser (>= 3.3.0.2)
|
206
209
|
rainbow (>= 2.2.2, < 4.0)
|
207
210
|
regexp_parser (>= 1.8, < 3.0)
|
208
211
|
rexml (>= 3.2.5, < 4.0)
|
209
|
-
rubocop-ast (>= 1.
|
212
|
+
rubocop-ast (>= 1.31.1, < 2.0)
|
210
213
|
ruby-progressbar (~> 1.7)
|
211
214
|
unicode-display_width (>= 2.4.0, < 3.0)
|
212
|
-
rubocop-ast (1.
|
213
|
-
parser (>= 3.
|
214
|
-
rubocop-capybara (2.
|
215
|
+
rubocop-ast (1.31.3)
|
216
|
+
parser (>= 3.3.1.0)
|
217
|
+
rubocop-capybara (2.20.0)
|
215
218
|
rubocop (~> 1.41)
|
216
|
-
rubocop-config-umbrellio (1.
|
217
|
-
rubocop (~> 1.
|
218
|
-
rubocop-performance (~> 1.
|
219
|
-
rubocop-rails (~> 2.
|
219
|
+
rubocop-config-umbrellio (1.63.0.93)
|
220
|
+
rubocop (~> 1.63.0)
|
221
|
+
rubocop-performance (~> 1.21.0)
|
222
|
+
rubocop-rails (~> 2.24.0)
|
220
223
|
rubocop-rake (~> 0.6.0)
|
221
|
-
rubocop-rspec (~> 2.
|
224
|
+
rubocop-rspec (~> 2.29.0)
|
222
225
|
rubocop-sequel (~> 0.3.3)
|
223
|
-
rubocop-
|
224
|
-
rubocop (
|
225
|
-
|
226
|
-
|
226
|
+
rubocop-factory_bot (2.25.1)
|
227
|
+
rubocop (~> 1.41)
|
228
|
+
rubocop-performance (1.21.0)
|
229
|
+
rubocop (>= 1.48.1, < 2.0)
|
230
|
+
rubocop-ast (>= 1.31.1, < 2.0)
|
231
|
+
rubocop-rails (2.24.1)
|
227
232
|
activesupport (>= 4.2.0)
|
228
233
|
rack (>= 1.1)
|
229
234
|
rubocop (>= 1.33.0, < 2.0)
|
235
|
+
rubocop-ast (>= 1.31.1, < 2.0)
|
230
236
|
rubocop-rake (0.6.0)
|
231
237
|
rubocop (~> 1.0)
|
232
|
-
rubocop-rspec (2.
|
233
|
-
rubocop (~> 1.
|
238
|
+
rubocop-rspec (2.29.2)
|
239
|
+
rubocop (~> 1.40)
|
234
240
|
rubocop-capybara (~> 2.17)
|
241
|
+
rubocop-factory_bot (~> 2.22)
|
242
|
+
rubocop-rspec_rails (~> 2.28)
|
243
|
+
rubocop-rspec_rails (2.28.3)
|
244
|
+
rubocop (~> 1.40)
|
235
245
|
rubocop-sequel (0.3.4)
|
236
246
|
rubocop (~> 1.0)
|
237
247
|
ruby-progressbar (1.13.0)
|
238
|
-
|
239
|
-
|
240
|
-
thor (1.3.
|
241
|
-
timeout (0.4.
|
248
|
+
stringio (3.1.0)
|
249
|
+
strscan (3.1.0)
|
250
|
+
thor (1.3.1)
|
251
|
+
timeout (0.4.1)
|
242
252
|
tzinfo (2.0.6)
|
243
253
|
concurrent-ruby (~> 1.0)
|
244
254
|
unicode-display_width (2.5.0)
|
@@ -246,10 +256,11 @@ GEM
|
|
246
256
|
websocket-driver (0.7.6)
|
247
257
|
websocket-extensions (>= 0.1.0)
|
248
258
|
websocket-extensions (0.1.5)
|
249
|
-
zeitwerk (2.6.
|
259
|
+
zeitwerk (2.6.14)
|
250
260
|
|
251
261
|
PLATFORMS
|
252
262
|
arm64-darwin-22
|
263
|
+
arm64-darwin-23
|
253
264
|
x86_64-darwin-20
|
254
265
|
x86_64-darwin-21
|
255
266
|
x86_64-linux
|
@@ -263,4 +274,4 @@ DEPENDENCIES
|
|
263
274
|
rubocop-config-umbrellio
|
264
275
|
|
265
276
|
BUNDLED WITH
|
266
|
-
2.
|
277
|
+
2.5.5
|
data/README.md
CHANGED
@@ -33,18 +33,18 @@ 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
|
37
|
-
|
36
|
+
separate `database.yml` file you need to execute `#apply_rails_patch!` method in your `application.rb`
|
37
|
+
file before application init.
|
38
38
|
|
39
39
|
```ruby
|
40
|
-
ConfigDefault.
|
40
|
+
ConfigDefault.apply_rails_patch!
|
41
41
|
```
|
42
42
|
|
43
43
|
## Usage
|
44
44
|
|
45
45
|
### Default behaviour
|
46
46
|
|
47
|
-
First you need to separate you configuration to default and not.
|
47
|
+
First you need to separate you configuration to `.default` and not.
|
48
48
|
Let's check an example for Rails default config file `config/database.yml`:
|
49
49
|
|
50
50
|
```yaml
|
@@ -82,7 +82,8 @@ production:
|
|
82
82
|
```
|
83
83
|
|
84
84
|
All you need after creating this file in your secret location is to place this file near with
|
85
|
-
|
85
|
+
the `.default` one.
|
86
|
+
ConfigDefault will merge them automatically on startup.
|
86
87
|
|
87
88
|
### Your application configuration
|
88
89
|
|
@@ -17,10 +17,10 @@ module ConfigDefault::RailsApplicationPatch
|
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
20
|
-
module ConfigDefault::
|
20
|
+
module ConfigDefault::RailsPatch
|
21
21
|
extend self
|
22
22
|
|
23
|
-
def
|
23
|
+
def apply!
|
24
24
|
return unless Object.const_defined?(:Rails)
|
25
25
|
|
26
26
|
Rails::Application.prepend(ConfigDefault::RailsApplicationPatch)
|
data/lib/config_default.rb
CHANGED
@@ -4,7 +4,7 @@ require "active_support/core_ext/hash"
|
|
4
4
|
|
5
5
|
require "config_default/version"
|
6
6
|
require "config_default/config"
|
7
|
-
require "config_default/
|
7
|
+
require "config_default/rails_patch"
|
8
8
|
require "config_default/struct"
|
9
9
|
|
10
10
|
module ConfigDefault
|
@@ -18,8 +18,8 @@ module ConfigDefault
|
|
18
18
|
yield(config) if block_given?
|
19
19
|
end
|
20
20
|
|
21
|
-
def
|
22
|
-
ConfigDefault::
|
21
|
+
def apply_rails_patch!
|
22
|
+
ConfigDefault::RailsPatch.apply!
|
23
23
|
end
|
24
24
|
|
25
25
|
def load(name, key: Rails.env, symbolize_keys: false, deep_symbolize_keys: false)
|
@@ -27,7 +27,7 @@ module ConfigDefault
|
|
27
27
|
config = load_file(name)
|
28
28
|
|
29
29
|
data = default_config.deep_merge(config)
|
30
|
-
data =
|
30
|
+
data = data[key] if key
|
31
31
|
|
32
32
|
return {} if data.nil?
|
33
33
|
|
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.3.
|
4
|
+
version: 0.3.2
|
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: 2024-05-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -33,7 +33,7 @@ executables: []
|
|
33
33
|
extensions: []
|
34
34
|
extra_rdoc_files: []
|
35
35
|
files:
|
36
|
-
- ".github/workflows/
|
36
|
+
- ".github/workflows/ci.yml"
|
37
37
|
- ".gitignore"
|
38
38
|
- ".rubocop.yml"
|
39
39
|
- CHANGELOG.md
|
@@ -46,7 +46,7 @@ files:
|
|
46
46
|
- bin/setup
|
47
47
|
- lib/config_default.rb
|
48
48
|
- lib/config_default/config.rb
|
49
|
-
- lib/config_default/
|
49
|
+
- lib/config_default/rails_patch.rb
|
50
50
|
- lib/config_default/struct.rb
|
51
51
|
- lib/config_default/version.rb
|
52
52
|
homepage: https://github.com/skirushkin/config_default
|
@@ -71,7 +71,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
71
71
|
- !ruby/object:Gem::Version
|
72
72
|
version: '0'
|
73
73
|
requirements: []
|
74
|
-
rubygems_version: 3.
|
74
|
+
rubygems_version: 3.5.9
|
75
75
|
signing_key:
|
76
76
|
specification_version: 4
|
77
77
|
summary: A simple way to manage default and env configuration in Rails.
|