config_default 0.2.4 → 0.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4507e90d9bb3f204a007a1d66e4d2a861380b7a1270754e5adcae6319dd0ade6
4
- data.tar.gz: f967fddbd62e8ddb92ca9e162c3471a3e0dd09573edd4e814fc14618a7861d98
3
+ metadata.gz: 3ee450c0ba68badbd9918f55242afccc8c61368591c3f430cc42fc6ddc84d3ad
4
+ data.tar.gz: a6d5aa218bdf39fd65a6b19c223b196e5358327aaf7011529c31673b236a8cd2
5
5
  SHA512:
6
- metadata.gz: 7a2209a32fec7c10bb1ea0ecbfc03800bc6da8e10ababb9cb37336f445fd01c9608568b97189dc7b5511d4aad7157a200af0b455d68d136ecdc5082896375c38
7
- data.tar.gz: 72792f9a6bfb4774169436dec22f1638cd8f01ba412bf553fbb930ad6e348c7cd8d15ede3273fa82f23462ffe7b3665044a50d94e7cfb42a0ee3050d4a20314d
6
+ metadata.gz: be3a0b8ce4621dad804e5d767d9da31170c35044712caf503320d584b25fd1430c3fa6e7140f3a02a6cc161370dfa3397d306e2bdb00d73ab6c73a7fa7da2383
7
+ data.tar.gz: b17ceb5c71b2c2dc054ced8496392cebcf9846ff72961ee1b3df2872f27cfed2ef1e2ca099b38e51ec036f3102a9eea5f512a61cd34382698f14709298e8b84c
@@ -24,7 +24,7 @@ jobs:
24
24
 
25
25
  strategy:
26
26
  matrix:
27
- ruby: [2.7, 3.0, 3.1]
27
+ ruby: [2.7, 3.0, 3.1, 3.2]
28
28
 
29
29
  steps:
30
30
  - uses: actions/checkout@v2
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.2.4)
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.0.3.1)
11
- actionpack (= 7.0.3.1)
12
- activesupport (= 7.0.3.1)
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
- actionmailbox (7.0.3.1)
16
- actionpack (= 7.0.3.1)
17
- activejob (= 7.0.3.1)
18
- activerecord (= 7.0.3.1)
19
- activestorage (= 7.0.3.1)
20
- activesupport (= 7.0.3.1)
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.0.3.1)
26
- actionpack (= 7.0.3.1)
27
- actionview (= 7.0.3.1)
28
- activejob (= 7.0.3.1)
29
- activesupport (= 7.0.3.1)
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.0)
35
- actionpack (7.0.3.1)
36
- actionview (= 7.0.3.1)
37
- activesupport (= 7.0.3.1)
38
- rack (~> 2.0, >= 2.2.0)
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.0)
41
- rails-html-sanitizer (~> 1.0, >= 1.2.0)
42
- actiontext (7.0.3.1)
43
- actionpack (= 7.0.3.1)
44
- activerecord (= 7.0.3.1)
45
- activestorage (= 7.0.3.1)
46
- activesupport (= 7.0.3.1)
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.0.3.1)
50
- activesupport (= 7.0.3.1)
52
+ actionview (7.1.1)
53
+ activesupport (= 7.1.1)
51
54
  builder (~> 3.1)
52
- erubi (~> 1.4)
53
- rails-dom-testing (~> 2.0)
54
- rails-html-sanitizer (~> 1.1, >= 1.2.0)
55
- activejob (7.0.3.1)
56
- activesupport (= 7.0.3.1)
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.0.3.1)
59
- activesupport (= 7.0.3.1)
60
- activerecord (7.0.3.1)
61
- activemodel (= 7.0.3.1)
62
- activesupport (= 7.0.3.1)
63
- activestorage (7.0.3.1)
64
- actionpack (= 7.0.3.1)
65
- activejob (= 7.0.3.1)
66
- activerecord (= 7.0.3.1)
67
- activesupport (= 7.0.3.1)
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
- mini_mime (>= 1.1.0)
70
- activesupport (7.0.3.1)
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.1.10)
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
- digest (3.1.0)
82
- erubi (1.10.0)
83
- globalid (1.0.0)
84
- activesupport (>= 5.0)
85
- i18n (1.12.0)
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
- loofah (2.18.0)
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.5.9)
90
- mail (2.7.1)
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.2)
95
- minitest (5.16.2)
96
- net-imap (0.2.3)
97
- digest
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
- strscan
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-protocol (0.1.3)
105
- timeout
106
- net-smtp (0.3.1)
107
- digest
125
+ net-smtp (0.4.0)
108
126
  net-protocol
109
- timeout
110
- nio4r (2.5.8)
111
- nokogiri (1.13.7-x86_64-darwin)
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.13.7-x86_64-linux)
132
+ nokogiri (1.15.4-x86_64-linux)
114
133
  racc (~> 1.4)
115
- parallel (1.22.1)
116
- parser (3.1.2.0)
134
+ parallel (1.23.0)
135
+ parser (3.2.2.4)
117
136
  ast (~> 2.4.1)
118
- pry (0.14.1)
137
+ racc
138
+ pry (0.14.2)
119
139
  coderay (~> 1.1)
120
140
  method_source (~> 1.0)
121
- racc (1.6.0)
122
- rack (2.2.4)
123
- rack-test (2.0.2)
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
- rails (7.0.3.1)
126
- actioncable (= 7.0.3.1)
127
- actionmailbox (= 7.0.3.1)
128
- actionmailer (= 7.0.3.1)
129
- actionpack (= 7.0.3.1)
130
- actiontext (= 7.0.3.1)
131
- actionview (= 7.0.3.1)
132
- activejob (= 7.0.3.1)
133
- activemodel (= 7.0.3.1)
134
- activerecord (= 7.0.3.1)
135
- activestorage (= 7.0.3.1)
136
- activesupport (= 7.0.3.1)
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.0.3.1)
139
- rails-dom-testing (2.0.3)
140
- activesupport (>= 4.2.0)
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.4.3)
143
- loofah (~> 2.3)
144
- railties (7.0.3.1)
145
- actionpack (= 7.0.3.1)
146
- activesupport (= 7.0.3.1)
147
- method_source
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.5)
179
+ thor (~> 1.0, >= 1.2.2)
180
+ zeitwerk (~> 2.6)
151
181
  rainbow (3.1.1)
152
- rake (13.0.6)
153
- regexp_parser (2.5.0)
154
- rexml (3.2.5)
155
- rspec (3.11.0)
156
- rspec-core (~> 3.11.0)
157
- rspec-expectations (~> 3.11.0)
158
- rspec-mocks (~> 3.11.0)
159
- rspec-core (3.11.0)
160
- rspec-support (~> 3.11.0)
161
- rspec-expectations (3.11.0)
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.11.0)
164
- rspec-mocks (3.11.1)
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.11.0)
167
- rspec-support (3.11.0)
168
- rubocop (1.30.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.1.0.0)
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.18.0, < 2.0)
209
+ rubocop-ast (>= 1.28.0, < 2.0)
175
210
  ruby-progressbar (~> 1.7)
176
- unicode-display_width (>= 1.4.0, < 3.0)
177
- rubocop-ast (1.19.1)
178
- parser (>= 3.1.1.0)
179
- rubocop-config-umbrellio (1.30.0.65)
180
- rubocop (~> 1.30.0)
181
- rubocop-performance (~> 1.14.0)
182
- rubocop-rails (~> 2.14.2)
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.11.1)
221
+ rubocop-rspec (~> 2.20.0)
185
222
  rubocop-sequel (~> 0.3.3)
186
- rubocop-performance (1.14.3)
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.14.2)
226
+ rubocop-rails (2.19.1)
190
227
  activesupport (>= 4.2.0)
191
228
  rack (>= 1.1)
192
- rubocop (>= 1.7.0, < 2.0)
229
+ rubocop (>= 1.33.0, < 2.0)
193
230
  rubocop-rake (0.6.0)
194
231
  rubocop (~> 1.0)
195
- rubocop-rspec (2.11.1)
196
- rubocop (~> 1.19)
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.11.0)
200
- strscan (3.0.3)
201
- thor (1.2.1)
202
- timeout (0.3.0)
203
- tzinfo (2.0.5)
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.2.0)
206
- websocket-driver (0.7.5)
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.0)
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.2.28
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 `#init_rails_monkey_patch!` method in your
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.init_rails_monkey_patch!
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(attributes: config_on_the_fly, recursive: true)
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
@@ -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 init_rails_monkey_patch!
23
+ def init_rails_patch!
7
24
  return unless Object.const_defined?(:Rails)
8
25
 
9
- Rails::Application.prepend(ConfigDefault::RailsApplicationExtension)
10
- Rails::Application::Configuration.prepend(ConfigDefault::RailsApplicationConfigurationExtension)
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:, recursive: false, allow_nil: false)
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
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ConfigDefault
4
- VERSION = "0.2.4"
4
+ VERSION = "0.3.0"
5
5
  end
@@ -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 init_rails_monkey_patch!
24
- ConfigDefault::Init.init_rails_monkey_patch!
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
- ConfigDefault::Struct.new(
54
- attributes: load(name, key: key),
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.2.4
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: 2022-07-22 00:00:00.000000000 Z
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.3.12
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.
@@ -1,11 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module ConfigDefault::RailsApplicationConfigurationExtension
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
@@ -1,8 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module ConfigDefault::RailsApplicationExtension
4
- def config_for(name, env: Rails.env)
5
- data = ConfigDefault.load(name, key: env, deep_symbolize_keys: true)
6
- ActiveSupport::OrderedOptions.new.merge(data)
7
- end
8
- end