config_default 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 175dc5b4b199aaf4aae09af5ca3da95703a3a25d9699937cb0bd3b9a1c72868b
4
- data.tar.gz: 11d65678fb73c61e856e71daf8e760e6437d12b0bb20008408354d91564adaf4
3
+ metadata.gz: 9c957f780b6cc5bd9c0f02e4464bc39de39bef79e7ffe8aaf74a1c656013a271
4
+ data.tar.gz: 3d74c4af84249765e0df536b80bd788a46df2e3572127560f308771bf0a987c5
5
5
  SHA512:
6
- metadata.gz: 1669e9cacd6e5dfd35d0adf2f7b86bde90a607fab534b99c227f83d35d1dd89ca1b55c403bd721dc79262dcc35dd769d8e464227e71a74045a9a81dd3fe4cc6f
7
- data.tar.gz: 7014315c985528650a0b930a761664fe59c33dca909409456d5133470790635139aeabe4e6e7e9f4800328e4ab2a02df29a40ebe8fe3e4eff358315ed9632bf8
6
+ metadata.gz: 7a87866e4a1fe147620ed030130398a08e746f8b9a860c690ecd63112cfa7d63928cd726ec784cf552ce586bddaaa900231760af4e645f44d2b4da2a2fefcfbd
7
+ data.tar.gz: a5c8644094054c45a958654e7478649e918dec2133d7a91d12097455ac231f22c0491264cc4a445d2fff4610d7200c75d948a7091ebba87d62d54f01e1c8ef34
@@ -24,7 +24,7 @@ jobs:
24
24
 
25
25
  strategy:
26
26
  matrix:
27
- ruby: [3.0, 3.1, 3.2]
27
+ ruby: [3.0, 3.1, 3.2, 3.3]
28
28
 
29
29
  steps:
30
30
  - uses: actions/checkout@v2
data/.rubocop.yml CHANGED
@@ -4,3 +4,4 @@ inherit_gem:
4
4
  AllCops:
5
5
  DisplayCopNames: true
6
6
  TargetRubyVersion: 2.5
7
+ SuggestExtensions: false
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,41 +1,41 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- config_default (0.3.1)
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.3)
11
- actionpack (= 7.1.3)
12
- activesupport (= 7.1.3)
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.3)
17
- actionpack (= 7.1.3)
18
- activejob (= 7.1.3)
19
- activerecord (= 7.1.3)
20
- activestorage (= 7.1.3)
21
- activesupport (= 7.1.3)
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.3)
27
- actionpack (= 7.1.3)
28
- actionview (= 7.1.3)
29
- activejob (= 7.1.3)
30
- activesupport (= 7.1.3)
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.3)
37
- actionview (= 7.1.3)
38
- activesupport (= 7.1.3)
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
40
  racc
41
41
  rack (>= 2.2.4)
@@ -43,35 +43,35 @@ GEM
43
43
  rack-test (>= 0.6.3)
44
44
  rails-dom-testing (~> 2.2)
45
45
  rails-html-sanitizer (~> 1.6)
46
- actiontext (7.1.3)
47
- actionpack (= 7.1.3)
48
- activerecord (= 7.1.3)
49
- activestorage (= 7.1.3)
50
- activesupport (= 7.1.3)
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)
51
51
  globalid (>= 0.6.0)
52
52
  nokogiri (>= 1.8.5)
53
- actionview (7.1.3)
54
- activesupport (= 7.1.3)
53
+ actionview (7.1.3.3)
54
+ activesupport (= 7.1.3.3)
55
55
  builder (~> 3.1)
56
56
  erubi (~> 1.11)
57
57
  rails-dom-testing (~> 2.2)
58
58
  rails-html-sanitizer (~> 1.6)
59
- activejob (7.1.3)
60
- activesupport (= 7.1.3)
59
+ activejob (7.1.3.3)
60
+ activesupport (= 7.1.3.3)
61
61
  globalid (>= 0.3.6)
62
- activemodel (7.1.3)
63
- activesupport (= 7.1.3)
64
- activerecord (7.1.3)
65
- activemodel (= 7.1.3)
66
- activesupport (= 7.1.3)
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)
67
67
  timeout (>= 0.4.0)
68
- activestorage (7.1.3)
69
- actionpack (= 7.1.3)
70
- activejob (= 7.1.3)
71
- activerecord (= 7.1.3)
72
- activesupport (= 7.1.3)
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)
73
73
  marcel (~> 1.0)
74
- activesupport (7.1.3)
74
+ activesupport (7.1.3.3)
75
75
  base64
76
76
  bigdecimal
77
77
  concurrent-ruby (~> 1.0, >= 1.0.2)
@@ -83,7 +83,7 @@ GEM
83
83
  tzinfo (~> 2.0)
84
84
  ast (2.4.2)
85
85
  base64 (0.2.0)
86
- bigdecimal (3.1.6)
86
+ bigdecimal (3.1.8)
87
87
  builder (3.2.4)
88
88
  coderay (1.1.3)
89
89
  concurrent-ruby (1.2.3)
@@ -91,18 +91,18 @@ GEM
91
91
  crass (1.0.6)
92
92
  date (3.3.4)
93
93
  diff-lcs (1.5.1)
94
- drb (2.2.0)
95
- ruby2_keywords
94
+ drb (2.2.1)
96
95
  erubi (1.12.0)
97
96
  globalid (1.2.1)
98
97
  activesupport (>= 6.1)
99
- i18n (1.14.1)
98
+ i18n (1.14.5)
100
99
  concurrent-ruby (~> 1.0)
101
100
  io-console (0.7.2)
102
- irb (1.11.1)
103
- rdoc
101
+ irb (1.13.1)
102
+ rdoc (>= 4.0.0)
104
103
  reline (>= 0.4.2)
105
- json (2.7.1)
104
+ json (2.7.2)
105
+ language_server-protocol (3.17.0.3)
106
106
  loofah (2.22.0)
107
107
  crass (~> 1.0.2)
108
108
  nokogiri (>= 1.12.0)
@@ -111,29 +111,29 @@ GEM
111
111
  net-imap
112
112
  net-pop
113
113
  net-smtp
114
- marcel (1.0.2)
115
- method_source (1.0.0)
114
+ marcel (1.0.4)
115
+ method_source (1.1.0)
116
116
  mini_mime (1.1.5)
117
- minitest (5.22.0)
117
+ minitest (5.23.1)
118
118
  mutex_m (0.2.0)
119
- net-imap (0.4.10)
119
+ net-imap (0.4.11)
120
120
  date
121
121
  net-protocol
122
122
  net-pop (0.1.2)
123
123
  net-protocol
124
124
  net-protocol (0.2.2)
125
125
  timeout
126
- net-smtp (0.4.0.1)
126
+ net-smtp (0.5.0)
127
127
  net-protocol
128
- nio4r (2.7.0)
129
- nokogiri (1.16.2-arm64-darwin)
128
+ nio4r (2.7.3)
129
+ nokogiri (1.16.5-arm64-darwin)
130
130
  racc (~> 1.4)
131
- nokogiri (1.16.2-x86_64-darwin)
131
+ nokogiri (1.16.5-x86_64-darwin)
132
132
  racc (~> 1.4)
133
- nokogiri (1.16.2-x86_64-linux)
133
+ nokogiri (1.16.5-x86_64-linux)
134
134
  racc (~> 1.4)
135
135
  parallel (1.24.0)
136
- parser (3.3.0.5)
136
+ parser (3.3.1.0)
137
137
  ast (~> 2.4.1)
138
138
  racc
139
139
  pry (0.14.2)
@@ -141,8 +141,8 @@ GEM
141
141
  method_source (~> 1.0)
142
142
  psych (5.1.2)
143
143
  stringio
144
- racc (1.7.3)
145
- rack (3.0.9)
144
+ racc (1.8.0)
145
+ rack (3.0.11)
146
146
  rack-session (2.0.0)
147
147
  rack (>= 3.0.0)
148
148
  rack-test (2.1.0)
@@ -150,20 +150,20 @@ GEM
150
150
  rackup (2.1.0)
151
151
  rack (>= 3)
152
152
  webrick (~> 1.8)
153
- rails (7.1.3)
154
- actioncable (= 7.1.3)
155
- actionmailbox (= 7.1.3)
156
- actionmailer (= 7.1.3)
157
- actionpack (= 7.1.3)
158
- actiontext (= 7.1.3)
159
- actionview (= 7.1.3)
160
- activejob (= 7.1.3)
161
- activemodel (= 7.1.3)
162
- activerecord (= 7.1.3)
163
- activestorage (= 7.1.3)
164
- activesupport (= 7.1.3)
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)
165
165
  bundler (>= 1.15.0)
166
- railties (= 7.1.3)
166
+ railties (= 7.1.3.3)
167
167
  rails-dom-testing (2.2.0)
168
168
  activesupport (>= 5.0.0)
169
169
  minitest
@@ -171,22 +171,23 @@ GEM
171
171
  rails-html-sanitizer (1.6.0)
172
172
  loofah (~> 2.21)
173
173
  nokogiri (~> 1.14)
174
- railties (7.1.3)
175
- actionpack (= 7.1.3)
176
- activesupport (= 7.1.3)
174
+ railties (7.1.3.3)
175
+ actionpack (= 7.1.3.3)
176
+ activesupport (= 7.1.3.3)
177
177
  irb
178
178
  rackup (>= 1.0.0)
179
179
  rake (>= 12.2)
180
180
  thor (~> 1.0, >= 1.2.2)
181
181
  zeitwerk (~> 2.6)
182
182
  rainbow (3.1.1)
183
- rake (13.1.0)
184
- rdoc (6.6.2)
183
+ rake (13.2.1)
184
+ rdoc (6.7.0)
185
185
  psych (>= 4.0.0)
186
- regexp_parser (2.9.0)
187
- reline (0.4.2)
186
+ regexp_parser (2.9.2)
187
+ reline (0.5.7)
188
188
  io-console (~> 0.5)
189
- rexml (3.2.6)
189
+ rexml (3.2.8)
190
+ strscan (>= 3.0.9)
190
191
  rspec (3.13.0)
191
192
  rspec-core (~> 3.13.0)
192
193
  rspec-expectations (~> 3.13.0)
@@ -196,49 +197,57 @@ GEM
196
197
  rspec-expectations (3.13.0)
197
198
  diff-lcs (>= 1.2.0, < 2.0)
198
199
  rspec-support (~> 3.13.0)
199
- rspec-mocks (3.13.0)
200
+ rspec-mocks (3.13.1)
200
201
  diff-lcs (>= 1.2.0, < 2.0)
201
202
  rspec-support (~> 3.13.0)
202
- rspec-support (3.13.0)
203
- rubocop (1.50.2)
203
+ rspec-support (3.13.1)
204
+ rubocop (1.63.5)
204
205
  json (~> 2.3)
206
+ language_server-protocol (>= 3.17.0)
205
207
  parallel (~> 1.10)
206
- parser (>= 3.2.0.0)
208
+ parser (>= 3.3.0.2)
207
209
  rainbow (>= 2.2.2, < 4.0)
208
210
  regexp_parser (>= 1.8, < 3.0)
209
211
  rexml (>= 3.2.5, < 4.0)
210
- rubocop-ast (>= 1.28.0, < 2.0)
212
+ rubocop-ast (>= 1.31.1, < 2.0)
211
213
  ruby-progressbar (~> 1.7)
212
214
  unicode-display_width (>= 2.4.0, < 3.0)
213
- rubocop-ast (1.30.0)
214
- parser (>= 3.2.1.0)
215
+ rubocop-ast (1.31.3)
216
+ parser (>= 3.3.1.0)
215
217
  rubocop-capybara (2.20.0)
216
218
  rubocop (~> 1.41)
217
- rubocop-config-umbrellio (1.50.0.85)
218
- rubocop (~> 1.50.0)
219
- rubocop-performance (~> 1.17.0)
220
- rubocop-rails (~> 2.19.0)
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)
221
223
  rubocop-rake (~> 0.6.0)
222
- rubocop-rspec (~> 2.20.0)
224
+ rubocop-rspec (~> 2.29.0)
223
225
  rubocop-sequel (~> 0.3.3)
224
- rubocop-performance (1.17.1)
225
- rubocop (>= 1.7.0, < 2.0)
226
- rubocop-ast (>= 0.4.0)
227
- rubocop-rails (2.19.1)
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)
228
232
  activesupport (>= 4.2.0)
229
233
  rack (>= 1.1)
230
234
  rubocop (>= 1.33.0, < 2.0)
235
+ rubocop-ast (>= 1.31.1, < 2.0)
231
236
  rubocop-rake (0.6.0)
232
237
  rubocop (~> 1.0)
233
- rubocop-rspec (2.20.0)
234
- rubocop (~> 1.33)
238
+ rubocop-rspec (2.29.2)
239
+ rubocop (~> 1.40)
235
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)
236
245
  rubocop-sequel (0.3.4)
237
246
  rubocop (~> 1.0)
238
247
  ruby-progressbar (1.13.0)
239
- ruby2_keywords (0.0.5)
240
248
  stringio (3.1.0)
241
- thor (1.3.0)
249
+ strscan (3.1.0)
250
+ thor (1.3.1)
242
251
  timeout (0.4.1)
243
252
  tzinfo (2.0.6)
244
253
  concurrent-ruby (~> 1.0)
@@ -247,10 +256,11 @@ GEM
247
256
  websocket-driver (0.7.6)
248
257
  websocket-extensions (>= 0.1.0)
249
258
  websocket-extensions (0.1.5)
250
- zeitwerk (2.6.13)
259
+ zeitwerk (2.6.14)
251
260
 
252
261
  PLATFORMS
253
262
  arm64-darwin-22
263
+ arm64-darwin-23
254
264
  x86_64-darwin-20
255
265
  x86_64-darwin-21
256
266
  x86_64-linux
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 apply `#init_rails_patch!` method in your
37
- `application.yml` file before application initialization.
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.init_rails_patch!
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
- previous one. ConfigDefault will merge them automatically on startup.
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::Init
20
+ module ConfigDefault::RailsPatch
21
21
  extend self
22
22
 
23
- def init_rails_patch!
23
+ def apply!
24
24
  return unless Object.const_defined?(:Rails)
25
25
 
26
26
  Rails::Application.prepend(ConfigDefault::RailsApplicationPatch)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ConfigDefault
4
- VERSION = "0.3.1"
4
+ VERSION = "0.3.2"
5
5
  end
@@ -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/init"
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 init_rails_patch!
22
- ConfigDefault::Init.init_rails_patch!
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 = key ? data[key] : 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.1
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: 2024-02-06 00:00:00.000000000 Z
11
+ date: 2024-05-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -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/init.rb
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.5.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.