config_default 0.5.5 → 0.6.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 +4 -4
- data/Gemfile.lock +70 -70
- data/lib/config_default/rails_patch.rb +9 -20
- data/lib/config_default/version.rb +1 -1
- data/lib/config_default.rb +5 -2
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c578e209fd98c0060e802f2b3f1eb4bada4fd25b4e3f5b323d2af82844839932
|
|
4
|
+
data.tar.gz: c0a5e708f9a6cdbf3e9b8410acdf3bee5a62f50a9ee96e9ec770f4ca19bce21e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ac456e007e54f9355c42b2e28f36087e2b93168102be181fae4bfc3b86997419b41ebff87fc5aa5b5ba107a07dd710df3f89cef973c447a1331f24cacb8e2521
|
|
7
|
+
data.tar.gz: 6416a64655e45aceaa5f811be55f4ad1fb2434778775895f4e3a8105f9f88bd6825f92acb2a2068c11360b04f5985423850229d3a9d556347e0b2af4bd1e7799
|
data/Gemfile.lock
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
config_default (0.
|
|
4
|
+
config_default (0.6.0)
|
|
5
5
|
activesupport (>= 6)
|
|
6
6
|
|
|
7
7
|
GEM
|
|
8
8
|
remote: https://rubygems.org/
|
|
9
9
|
specs:
|
|
10
|
-
action_text-trix (2.1.
|
|
10
|
+
action_text-trix (2.1.18)
|
|
11
11
|
railties
|
|
12
|
-
actioncable (8.1.
|
|
13
|
-
actionpack (= 8.1.
|
|
14
|
-
activesupport (= 8.1.
|
|
12
|
+
actioncable (8.1.3)
|
|
13
|
+
actionpack (= 8.1.3)
|
|
14
|
+
activesupport (= 8.1.3)
|
|
15
15
|
nio4r (~> 2.0)
|
|
16
16
|
websocket-driver (>= 0.6.1)
|
|
17
17
|
zeitwerk (~> 2.6)
|
|
18
|
-
actionmailbox (8.1.
|
|
19
|
-
actionpack (= 8.1.
|
|
20
|
-
activejob (= 8.1.
|
|
21
|
-
activerecord (= 8.1.
|
|
22
|
-
activestorage (= 8.1.
|
|
23
|
-
activesupport (= 8.1.
|
|
18
|
+
actionmailbox (8.1.3)
|
|
19
|
+
actionpack (= 8.1.3)
|
|
20
|
+
activejob (= 8.1.3)
|
|
21
|
+
activerecord (= 8.1.3)
|
|
22
|
+
activestorage (= 8.1.3)
|
|
23
|
+
activesupport (= 8.1.3)
|
|
24
24
|
mail (>= 2.8.0)
|
|
25
|
-
actionmailer (8.1.
|
|
26
|
-
actionpack (= 8.1.
|
|
27
|
-
actionview (= 8.1.
|
|
28
|
-
activejob (= 8.1.
|
|
29
|
-
activesupport (= 8.1.
|
|
25
|
+
actionmailer (8.1.3)
|
|
26
|
+
actionpack (= 8.1.3)
|
|
27
|
+
actionview (= 8.1.3)
|
|
28
|
+
activejob (= 8.1.3)
|
|
29
|
+
activesupport (= 8.1.3)
|
|
30
30
|
mail (>= 2.8.0)
|
|
31
31
|
rails-dom-testing (~> 2.2)
|
|
32
|
-
actionpack (8.1.
|
|
33
|
-
actionview (= 8.1.
|
|
34
|
-
activesupport (= 8.1.
|
|
32
|
+
actionpack (8.1.3)
|
|
33
|
+
actionview (= 8.1.3)
|
|
34
|
+
activesupport (= 8.1.3)
|
|
35
35
|
nokogiri (>= 1.8.5)
|
|
36
36
|
rack (>= 2.2.4)
|
|
37
37
|
rack-session (>= 1.0.1)
|
|
@@ -39,36 +39,36 @@ GEM
|
|
|
39
39
|
rails-dom-testing (~> 2.2)
|
|
40
40
|
rails-html-sanitizer (~> 1.6)
|
|
41
41
|
useragent (~> 0.16)
|
|
42
|
-
actiontext (8.1.
|
|
42
|
+
actiontext (8.1.3)
|
|
43
43
|
action_text-trix (~> 2.1.15)
|
|
44
|
-
actionpack (= 8.1.
|
|
45
|
-
activerecord (= 8.1.
|
|
46
|
-
activestorage (= 8.1.
|
|
47
|
-
activesupport (= 8.1.
|
|
44
|
+
actionpack (= 8.1.3)
|
|
45
|
+
activerecord (= 8.1.3)
|
|
46
|
+
activestorage (= 8.1.3)
|
|
47
|
+
activesupport (= 8.1.3)
|
|
48
48
|
globalid (>= 0.6.0)
|
|
49
49
|
nokogiri (>= 1.8.5)
|
|
50
|
-
actionview (8.1.
|
|
51
|
-
activesupport (= 8.1.
|
|
50
|
+
actionview (8.1.3)
|
|
51
|
+
activesupport (= 8.1.3)
|
|
52
52
|
builder (~> 3.1)
|
|
53
53
|
erubi (~> 1.11)
|
|
54
54
|
rails-dom-testing (~> 2.2)
|
|
55
55
|
rails-html-sanitizer (~> 1.6)
|
|
56
|
-
activejob (8.1.
|
|
57
|
-
activesupport (= 8.1.
|
|
56
|
+
activejob (8.1.3)
|
|
57
|
+
activesupport (= 8.1.3)
|
|
58
58
|
globalid (>= 0.3.6)
|
|
59
|
-
activemodel (8.1.
|
|
60
|
-
activesupport (= 8.1.
|
|
61
|
-
activerecord (8.1.
|
|
62
|
-
activemodel (= 8.1.
|
|
63
|
-
activesupport (= 8.1.
|
|
59
|
+
activemodel (8.1.3)
|
|
60
|
+
activesupport (= 8.1.3)
|
|
61
|
+
activerecord (8.1.3)
|
|
62
|
+
activemodel (= 8.1.3)
|
|
63
|
+
activesupport (= 8.1.3)
|
|
64
64
|
timeout (>= 0.4.0)
|
|
65
|
-
activestorage (8.1.
|
|
66
|
-
actionpack (= 8.1.
|
|
67
|
-
activejob (= 8.1.
|
|
68
|
-
activerecord (= 8.1.
|
|
69
|
-
activesupport (= 8.1.
|
|
65
|
+
activestorage (8.1.3)
|
|
66
|
+
actionpack (= 8.1.3)
|
|
67
|
+
activejob (= 8.1.3)
|
|
68
|
+
activerecord (= 8.1.3)
|
|
69
|
+
activesupport (= 8.1.3)
|
|
70
70
|
marcel (~> 1.0)
|
|
71
|
-
activesupport (8.1.
|
|
71
|
+
activesupport (8.1.3)
|
|
72
72
|
base64
|
|
73
73
|
bigdecimal
|
|
74
74
|
concurrent-ruby (~> 1.0, >= 1.3.1)
|
|
@@ -83,7 +83,7 @@ GEM
|
|
|
83
83
|
uri (>= 0.13.1)
|
|
84
84
|
ast (2.4.3)
|
|
85
85
|
base64 (0.3.0)
|
|
86
|
-
bigdecimal (4.
|
|
86
|
+
bigdecimal (4.1.2)
|
|
87
87
|
builder (3.3.0)
|
|
88
88
|
coderay (1.1.3)
|
|
89
89
|
concurrent-ruby (1.3.6)
|
|
@@ -92,19 +92,19 @@ GEM
|
|
|
92
92
|
date (3.5.1)
|
|
93
93
|
diff-lcs (1.6.2)
|
|
94
94
|
drb (2.2.3)
|
|
95
|
-
erb (6.0.
|
|
95
|
+
erb (6.0.4)
|
|
96
96
|
erubi (1.13.1)
|
|
97
97
|
globalid (1.3.0)
|
|
98
98
|
activesupport (>= 6.1)
|
|
99
99
|
i18n (1.14.8)
|
|
100
100
|
concurrent-ruby (~> 1.0)
|
|
101
101
|
io-console (0.8.2)
|
|
102
|
-
irb (1.
|
|
102
|
+
irb (1.18.0)
|
|
103
103
|
pp (>= 0.6.0)
|
|
104
104
|
prism (>= 1.3.0)
|
|
105
105
|
rdoc (>= 4.0.0)
|
|
106
106
|
reline (>= 0.4.2)
|
|
107
|
-
json (2.19.
|
|
107
|
+
json (2.19.5)
|
|
108
108
|
language_server-protocol (3.17.0.5)
|
|
109
109
|
lint_roller (1.1.0)
|
|
110
110
|
logger (1.7.0)
|
|
@@ -120,10 +120,10 @@ GEM
|
|
|
120
120
|
marcel (1.1.0)
|
|
121
121
|
method_source (1.1.0)
|
|
122
122
|
mini_mime (1.1.5)
|
|
123
|
-
minitest (6.0.
|
|
123
|
+
minitest (6.0.6)
|
|
124
124
|
drb (~> 2.0)
|
|
125
125
|
prism (~> 1.5)
|
|
126
|
-
net-imap (0.6.
|
|
126
|
+
net-imap (0.6.4)
|
|
127
127
|
date
|
|
128
128
|
net-protocol
|
|
129
129
|
net-pop (0.1.2)
|
|
@@ -133,14 +133,14 @@ GEM
|
|
|
133
133
|
net-smtp (0.5.1)
|
|
134
134
|
net-protocol
|
|
135
135
|
nio4r (2.7.5)
|
|
136
|
-
nokogiri (1.19.
|
|
136
|
+
nokogiri (1.19.3-arm64-darwin)
|
|
137
137
|
racc (~> 1.4)
|
|
138
|
-
nokogiri (1.19.
|
|
138
|
+
nokogiri (1.19.3-x86_64-darwin)
|
|
139
139
|
racc (~> 1.4)
|
|
140
|
-
nokogiri (1.19.
|
|
140
|
+
nokogiri (1.19.3-x86_64-linux-gnu)
|
|
141
141
|
racc (~> 1.4)
|
|
142
|
-
parallel (1.
|
|
143
|
-
parser (3.3.
|
|
142
|
+
parallel (1.28.0)
|
|
143
|
+
parser (3.3.11.1)
|
|
144
144
|
ast (~> 2.4.1)
|
|
145
145
|
racc
|
|
146
146
|
pp (0.6.3)
|
|
@@ -155,28 +155,28 @@ GEM
|
|
|
155
155
|
date
|
|
156
156
|
stringio
|
|
157
157
|
racc (1.8.1)
|
|
158
|
-
rack (3.2.
|
|
159
|
-
rack-session (2.1.
|
|
158
|
+
rack (3.2.6)
|
|
159
|
+
rack-session (2.1.2)
|
|
160
160
|
base64 (>= 0.1.0)
|
|
161
161
|
rack (>= 3.0.0)
|
|
162
162
|
rack-test (2.2.0)
|
|
163
163
|
rack (>= 1.3)
|
|
164
164
|
rackup (2.3.1)
|
|
165
165
|
rack (>= 3)
|
|
166
|
-
rails (8.1.
|
|
167
|
-
actioncable (= 8.1.
|
|
168
|
-
actionmailbox (= 8.1.
|
|
169
|
-
actionmailer (= 8.1.
|
|
170
|
-
actionpack (= 8.1.
|
|
171
|
-
actiontext (= 8.1.
|
|
172
|
-
actionview (= 8.1.
|
|
173
|
-
activejob (= 8.1.
|
|
174
|
-
activemodel (= 8.1.
|
|
175
|
-
activerecord (= 8.1.
|
|
176
|
-
activestorage (= 8.1.
|
|
177
|
-
activesupport (= 8.1.
|
|
166
|
+
rails (8.1.3)
|
|
167
|
+
actioncable (= 8.1.3)
|
|
168
|
+
actionmailbox (= 8.1.3)
|
|
169
|
+
actionmailer (= 8.1.3)
|
|
170
|
+
actionpack (= 8.1.3)
|
|
171
|
+
actiontext (= 8.1.3)
|
|
172
|
+
actionview (= 8.1.3)
|
|
173
|
+
activejob (= 8.1.3)
|
|
174
|
+
activemodel (= 8.1.3)
|
|
175
|
+
activerecord (= 8.1.3)
|
|
176
|
+
activestorage (= 8.1.3)
|
|
177
|
+
activesupport (= 8.1.3)
|
|
178
178
|
bundler (>= 1.15.0)
|
|
179
|
-
railties (= 8.1.
|
|
179
|
+
railties (= 8.1.3)
|
|
180
180
|
rails-dom-testing (2.3.0)
|
|
181
181
|
activesupport (>= 5.0.0)
|
|
182
182
|
minitest
|
|
@@ -184,9 +184,9 @@ GEM
|
|
|
184
184
|
rails-html-sanitizer (1.7.0)
|
|
185
185
|
loofah (~> 2.25)
|
|
186
186
|
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
|
|
187
|
-
railties (8.1.
|
|
188
|
-
actionpack (= 8.1.
|
|
189
|
-
activesupport (= 8.1.
|
|
187
|
+
railties (8.1.3)
|
|
188
|
+
actionpack (= 8.1.3)
|
|
189
|
+
activesupport (= 8.1.3)
|
|
190
190
|
irb (~> 1.13)
|
|
191
191
|
rackup (>= 1.0.0)
|
|
192
192
|
rake (>= 12.2)
|
|
@@ -194,12 +194,12 @@ GEM
|
|
|
194
194
|
tsort (>= 0.2)
|
|
195
195
|
zeitwerk (~> 2.6)
|
|
196
196
|
rainbow (3.1.1)
|
|
197
|
-
rake (13.
|
|
197
|
+
rake (13.4.2)
|
|
198
198
|
rdoc (7.2.0)
|
|
199
199
|
erb
|
|
200
200
|
psych (>= 4.0.0)
|
|
201
201
|
tsort
|
|
202
|
-
regexp_parser (2.
|
|
202
|
+
regexp_parser (2.12.0)
|
|
203
203
|
reline (0.6.3)
|
|
204
204
|
io-console (~> 0.5)
|
|
205
205
|
rspec (3.13.2)
|
|
@@ -1,19 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# NOTE: Patch
|
|
3
|
+
# NOTE: Patch Rails::Application to add support in #config_for method
|
|
4
4
|
# https://github.com/rails/rails/blob/main/railties/lib/rails/application.rb#L295
|
|
5
|
-
module ConfigDefault::RailsApplicationConfigurationPatch
|
|
6
|
-
def load_database_yaml
|
|
7
|
-
ConfigDefault.hash(:database, key: nil)
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
def database_configuration
|
|
11
|
-
load_database_yaml
|
|
12
|
-
end
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
# NOTE: Patch Rails to load database configuration
|
|
16
|
-
# https://github.com/rails/rails/blob/main/railties/lib/rails/application/configuration.rb#L467
|
|
17
5
|
module ConfigDefault::RailsApplicationPatch
|
|
18
6
|
def config_for(name, env: Rails.env)
|
|
19
7
|
data = ConfigDefault.hash(name, key: env, deep_symbolize_keys: true)
|
|
@@ -21,13 +9,14 @@ module ConfigDefault::RailsApplicationPatch
|
|
|
21
9
|
end
|
|
22
10
|
end
|
|
23
11
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
def
|
|
28
|
-
|
|
12
|
+
# NOTE: Patch Rails::Application::Configuration to add support into database conf files
|
|
13
|
+
# https://github.com/rails/rails/blob/main/railties/lib/rails/application/configuration.rb#L467
|
|
14
|
+
module ConfigDefault::RailsApplicationConfigurationPatch
|
|
15
|
+
def load_database_yaml
|
|
16
|
+
ConfigDefault.hash(:database, key: nil)
|
|
17
|
+
end
|
|
29
18
|
|
|
30
|
-
|
|
31
|
-
|
|
19
|
+
def database_configuration
|
|
20
|
+
load_database_yaml
|
|
32
21
|
end
|
|
33
22
|
end
|
data/lib/config_default.rb
CHANGED
|
@@ -19,7 +19,10 @@ module ConfigDefault
|
|
|
19
19
|
end
|
|
20
20
|
|
|
21
21
|
def apply_rails_patch!
|
|
22
|
-
|
|
22
|
+
return unless Object.const_defined?(:Rails)
|
|
23
|
+
|
|
24
|
+
Rails::Application.prepend(ConfigDefault::RailsApplicationPatch)
|
|
25
|
+
Rails::Application::Configuration.prepend(ConfigDefault::RailsApplicationConfigurationPatch)
|
|
23
26
|
end
|
|
24
27
|
|
|
25
28
|
def hash(name, key: Rails.env, symbolize_keys: false, deep_symbolize_keys: false)
|
|
@@ -54,7 +57,7 @@ module ConfigDefault
|
|
|
54
57
|
def read_file(name)
|
|
55
58
|
file_name = File.join(config.config_path, "#{name}.yml")
|
|
56
59
|
ActiveSupport::ConfigurationFile.parse(file_name)
|
|
57
|
-
rescue
|
|
60
|
+
rescue Errno::ENOENT
|
|
58
61
|
{}
|
|
59
62
|
end
|
|
60
63
|
end
|