config_default 0.2.1 → 0.2.4

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: b0e496b125200f0a672fbbc01b51ce0f2634f83d742384980a5e77300401de55
4
- data.tar.gz: 367ebd46e430509331e964e31a463f237f29f9b73a81967a978a9875d41760bf
3
+ metadata.gz: 4507e90d9bb3f204a007a1d66e4d2a861380b7a1270754e5adcae6319dd0ade6
4
+ data.tar.gz: f967fddbd62e8ddb92ca9e162c3471a3e0dd09573edd4e814fc14618a7861d98
5
5
  SHA512:
6
- metadata.gz: 4463a3895be54cda1a391edf76b78c55a1389fb981b00e6529ce7643ec307fe98ea7acbc778ddb51b4d330046f07c5e345e1ab14a0e409c5c158c5ed0693f919
7
- data.tar.gz: ff999b172f7971c4c0f891c8195155b1ac421ae74997e37bb71cb2b06e1e2e5c8d76794d1701b46cc9c8de37999e4a5dab8d85f2c82e13f388ccafde12a0983c
6
+ metadata.gz: 7a2209a32fec7c10bb1ea0ecbfc03800bc6da8e10ababb9cb37336f445fd01c9608568b97189dc7b5511d4aad7157a200af0b455d68d136ecdc5082896375c38
7
+ data.tar.gz: 72792f9a6bfb4774169436dec22f1638cd8f01ba412bf553fbb930ad6e348c7cd8d15ede3273fa82f23462ffe7b3665044a50d94e7cfb42a0ee3050d4a20314d
@@ -24,7 +24,7 @@ jobs:
24
24
 
25
25
  strategy:
26
26
  matrix:
27
- ruby: [2.5, 2.6, 2.7, 3.0]
27
+ ruby: [2.7, 3.0, 3.1]
28
28
 
29
29
  steps:
30
30
  - uses: actions/checkout@v2
data/Gemfile.lock CHANGED
@@ -1,83 +1,90 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- config_default (0.2.1)
5
- activesupport (~> 6)
4
+ config_default (0.2.4)
5
+ activesupport (>= 6)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- actioncable (6.1.4.1)
11
- actionpack (= 6.1.4.1)
12
- activesupport (= 6.1.4.1)
10
+ actioncable (7.0.3.1)
11
+ actionpack (= 7.0.3.1)
12
+ activesupport (= 7.0.3.1)
13
13
  nio4r (~> 2.0)
14
14
  websocket-driver (>= 0.6.1)
15
- actionmailbox (6.1.4.1)
16
- actionpack (= 6.1.4.1)
17
- activejob (= 6.1.4.1)
18
- activerecord (= 6.1.4.1)
19
- activestorage (= 6.1.4.1)
20
- activesupport (= 6.1.4.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)
21
21
  mail (>= 2.7.1)
22
- actionmailer (6.1.4.1)
23
- actionpack (= 6.1.4.1)
24
- actionview (= 6.1.4.1)
25
- activejob (= 6.1.4.1)
26
- activesupport (= 6.1.4.1)
22
+ net-imap
23
+ net-pop
24
+ 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)
27
30
  mail (~> 2.5, >= 2.5.4)
31
+ net-imap
32
+ net-pop
33
+ net-smtp
28
34
  rails-dom-testing (~> 2.0)
29
- actionpack (6.1.4.1)
30
- actionview (= 6.1.4.1)
31
- activesupport (= 6.1.4.1)
32
- rack (~> 2.0, >= 2.0.9)
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)
33
39
  rack-test (>= 0.6.3)
34
40
  rails-dom-testing (~> 2.0)
35
41
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
36
- actiontext (6.1.4.1)
37
- actionpack (= 6.1.4.1)
38
- activerecord (= 6.1.4.1)
39
- activestorage (= 6.1.4.1)
40
- activesupport (= 6.1.4.1)
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)
47
+ globalid (>= 0.6.0)
41
48
  nokogiri (>= 1.8.5)
42
- actionview (6.1.4.1)
43
- activesupport (= 6.1.4.1)
49
+ actionview (7.0.3.1)
50
+ activesupport (= 7.0.3.1)
44
51
  builder (~> 3.1)
45
52
  erubi (~> 1.4)
46
53
  rails-dom-testing (~> 2.0)
47
54
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
48
- activejob (6.1.4.1)
49
- activesupport (= 6.1.4.1)
55
+ activejob (7.0.3.1)
56
+ activesupport (= 7.0.3.1)
50
57
  globalid (>= 0.3.6)
51
- activemodel (6.1.4.1)
52
- activesupport (= 6.1.4.1)
53
- activerecord (6.1.4.1)
54
- activemodel (= 6.1.4.1)
55
- activesupport (= 6.1.4.1)
56
- activestorage (6.1.4.1)
57
- actionpack (= 6.1.4.1)
58
- activejob (= 6.1.4.1)
59
- activerecord (= 6.1.4.1)
60
- activesupport (= 6.1.4.1)
61
- marcel (~> 1.0.0)
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)
68
+ marcel (~> 1.0)
62
69
  mini_mime (>= 1.1.0)
63
- activesupport (6.1.4.1)
70
+ activesupport (7.0.3.1)
64
71
  concurrent-ruby (~> 1.0, >= 1.0.2)
65
72
  i18n (>= 1.6, < 2)
66
73
  minitest (>= 5.1)
67
74
  tzinfo (~> 2.0)
68
- zeitwerk (~> 2.3)
69
75
  ast (2.4.2)
70
76
  builder (3.2.4)
71
77
  coderay (1.1.3)
72
- concurrent-ruby (1.1.9)
78
+ concurrent-ruby (1.1.10)
73
79
  crass (1.0.6)
74
- diff-lcs (1.4.4)
80
+ diff-lcs (1.5.0)
81
+ digest (3.1.0)
75
82
  erubi (1.10.0)
76
- globalid (0.5.2)
83
+ globalid (1.0.0)
77
84
  activesupport (>= 5.0)
78
- i18n (1.8.11)
85
+ i18n (1.12.0)
79
86
  concurrent-ruby (~> 1.0)
80
- loofah (2.12.0)
87
+ loofah (2.18.0)
81
88
  crass (~> 1.0.2)
82
89
  nokogiri (>= 1.5.9)
83
90
  mail (2.7.1)
@@ -85,116 +92,125 @@ GEM
85
92
  marcel (1.0.2)
86
93
  method_source (1.0.0)
87
94
  mini_mime (1.1.2)
88
- minitest (5.14.4)
95
+ minitest (5.16.2)
96
+ net-imap (0.2.3)
97
+ digest
98
+ net-protocol
99
+ strscan
100
+ net-pop (0.1.1)
101
+ digest
102
+ net-protocol
103
+ timeout
104
+ net-protocol (0.1.3)
105
+ timeout
106
+ net-smtp (0.3.1)
107
+ digest
108
+ net-protocol
109
+ timeout
89
110
  nio4r (2.5.8)
90
- nokogiri (1.12.5-x86_64-darwin)
111
+ nokogiri (1.13.7-x86_64-darwin)
91
112
  racc (~> 1.4)
92
- nokogiri (1.12.5-x86_64-linux)
113
+ nokogiri (1.13.7-x86_64-linux)
93
114
  racc (~> 1.4)
94
- parallel (1.21.0)
95
- parser (3.0.2.0)
115
+ parallel (1.22.1)
116
+ parser (3.1.2.0)
96
117
  ast (~> 2.4.1)
97
118
  pry (0.14.1)
98
119
  coderay (~> 1.1)
99
120
  method_source (~> 1.0)
100
121
  racc (1.6.0)
101
- rack (2.2.3)
102
- rack-test (1.1.0)
103
- rack (>= 1.0, < 3)
104
- rails (6.1.4.1)
105
- actioncable (= 6.1.4.1)
106
- actionmailbox (= 6.1.4.1)
107
- actionmailer (= 6.1.4.1)
108
- actionpack (= 6.1.4.1)
109
- actiontext (= 6.1.4.1)
110
- actionview (= 6.1.4.1)
111
- activejob (= 6.1.4.1)
112
- activemodel (= 6.1.4.1)
113
- activerecord (= 6.1.4.1)
114
- activestorage (= 6.1.4.1)
115
- activesupport (= 6.1.4.1)
122
+ rack (2.2.4)
123
+ rack-test (2.0.2)
124
+ 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)
116
137
  bundler (>= 1.15.0)
117
- railties (= 6.1.4.1)
118
- sprockets-rails (>= 2.0.0)
138
+ railties (= 7.0.3.1)
119
139
  rails-dom-testing (2.0.3)
120
140
  activesupport (>= 4.2.0)
121
141
  nokogiri (>= 1.6)
122
- rails-html-sanitizer (1.4.2)
142
+ rails-html-sanitizer (1.4.3)
123
143
  loofah (~> 2.3)
124
- railties (6.1.4.1)
125
- actionpack (= 6.1.4.1)
126
- activesupport (= 6.1.4.1)
144
+ railties (7.0.3.1)
145
+ actionpack (= 7.0.3.1)
146
+ activesupport (= 7.0.3.1)
127
147
  method_source
128
- rake (>= 0.13)
148
+ rake (>= 12.2)
129
149
  thor (~> 1.0)
130
- rainbow (3.0.0)
150
+ zeitwerk (~> 2.5)
151
+ rainbow (3.1.1)
131
152
  rake (13.0.6)
132
- regexp_parser (2.1.1)
153
+ regexp_parser (2.5.0)
133
154
  rexml (3.2.5)
134
- rspec (3.10.0)
135
- rspec-core (~> 3.10.0)
136
- rspec-expectations (~> 3.10.0)
137
- rspec-mocks (~> 3.10.0)
138
- rspec-core (3.10.1)
139
- rspec-support (~> 3.10.0)
140
- rspec-expectations (3.10.1)
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)
141
162
  diff-lcs (>= 1.2.0, < 2.0)
142
- rspec-support (~> 3.10.0)
143
- rspec-mocks (3.10.2)
163
+ rspec-support (~> 3.11.0)
164
+ rspec-mocks (3.11.1)
144
165
  diff-lcs (>= 1.2.0, < 2.0)
145
- rspec-support (~> 3.10.0)
146
- rspec-support (3.10.3)
147
- rubocop (1.17.0)
166
+ rspec-support (~> 3.11.0)
167
+ rspec-support (3.11.0)
168
+ rubocop (1.30.1)
148
169
  parallel (~> 1.10)
149
- parser (>= 3.0.0.0)
170
+ parser (>= 3.1.0.0)
150
171
  rainbow (>= 2.2.2, < 4.0)
151
172
  regexp_parser (>= 1.8, < 3.0)
152
- rexml
153
- rubocop-ast (>= 1.7.0, < 2.0)
173
+ rexml (>= 3.2.5, < 4.0)
174
+ rubocop-ast (>= 1.18.0, < 2.0)
154
175
  ruby-progressbar (~> 1.7)
155
176
  unicode-display_width (>= 1.4.0, < 3.0)
156
- rubocop-ast (1.13.0)
157
- parser (>= 3.0.1.1)
158
- rubocop-config-umbrellio (1.17.0.53)
159
- rubocop (= 1.17.0)
160
- rubocop-performance (= 1.10.0)
161
- rubocop-rails (= 2.9.1)
162
- rubocop-rake (= 0.5.1)
163
- rubocop-rspec (= 2.2.0)
164
- rubocop-sequel (= 0.2.0)
165
- rubocop-performance (1.10.0)
166
- rubocop (>= 0.90.0, < 2.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)
183
+ rubocop-rake (~> 0.6.0)
184
+ rubocop-rspec (~> 2.11.1)
185
+ rubocop-sequel (~> 0.3.3)
186
+ rubocop-performance (1.14.3)
187
+ rubocop (>= 1.7.0, < 2.0)
167
188
  rubocop-ast (>= 0.4.0)
168
- rubocop-rails (2.9.1)
189
+ rubocop-rails (2.14.2)
169
190
  activesupport (>= 4.2.0)
170
191
  rack (>= 1.1)
171
- rubocop (>= 0.90.0, < 2.0)
172
- rubocop-rake (0.5.1)
173
- rubocop
174
- rubocop-rspec (2.2.0)
192
+ rubocop (>= 1.7.0, < 2.0)
193
+ rubocop-rake (0.6.0)
175
194
  rubocop (~> 1.0)
176
- rubocop-ast (>= 1.1.0)
177
- rubocop-sequel (0.2.0)
195
+ rubocop-rspec (2.11.1)
196
+ rubocop (~> 1.19)
197
+ rubocop-sequel (0.3.4)
178
198
  rubocop (~> 1.0)
179
199
  ruby-progressbar (1.11.0)
180
- sprockets (4.0.2)
200
+ strscan (3.0.3)
201
+ thor (1.2.1)
202
+ timeout (0.3.0)
203
+ tzinfo (2.0.5)
181
204
  concurrent-ruby (~> 1.0)
182
- rack (> 1, < 3)
183
- sprockets-rails (3.4.0)
184
- actionpack (>= 5.2)
185
- activesupport (>= 5.2)
186
- sprockets (>= 3.0.0)
187
- thor (1.1.0)
188
- tzinfo (2.0.4)
189
- concurrent-ruby (~> 1.0)
190
- unicode-display_width (2.1.0)
205
+ unicode-display_width (2.2.0)
191
206
  websocket-driver (0.7.5)
192
207
  websocket-extensions (>= 0.1.0)
193
208
  websocket-extensions (0.1.5)
194
- zeitwerk (2.5.1)
209
+ zeitwerk (2.6.0)
195
210
 
196
211
  PLATFORMS
197
212
  x86_64-darwin-20
213
+ x86_64-darwin-21
198
214
  x86_64-linux
199
215
 
200
216
  DEPENDENCIES
data/README.md CHANGED
@@ -2,7 +2,6 @@
2
2
 
3
3
  ConfigDefault is a simple way to separate your test/development config from your staging/production config.
4
4
  Designed to work with [Rails](https://github.com/rails/rails). It depends on `ActiveSupport`.
5
- Maybe in future I'll remove Rails dependency (cause it's never cool) and leave only ActiveSupport.
6
5
 
7
6
  ## Installation
8
7
 
@@ -4,9 +4,7 @@ module ConfigDefault::Init
4
4
  extend self
5
5
 
6
6
  def init_rails_monkey_patch!
7
- return unless Object.const_defined?("Rails")
8
- return unless Object.const_defined?("Rails::Application")
9
- return unless Object.const_defined?("Rails::Application::Configuration")
7
+ return unless Object.const_defined?(:Rails)
10
8
 
11
9
  Rails::Application.prepend(ConfigDefault::RailsApplicationExtension)
12
10
  Rails::Application::Configuration.prepend(ConfigDefault::RailsApplicationConfigurationExtension)
@@ -20,7 +20,7 @@ class ConfigDefault::Struct
20
20
 
21
21
  def method_missing(method, *_args)
22
22
  return if @allow_nil
23
- raise StandardError.new("There is no option :#{method} in configuration.")
23
+ raise ArgumentError.new("There is no option :#{method} in configuration.")
24
24
  end
25
25
 
26
26
  def respond_to_missing?(*_args)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ConfigDefault
4
- VERSION = "0.2.1"
4
+ VERSION = "0.2.4"
5
5
  end
@@ -31,6 +31,8 @@ module ConfigDefault
31
31
  data = default_config.deep_merge(config)
32
32
  data = key ? data[key] : data
33
33
 
34
+ return {} if data.nil?
35
+
34
36
  if deep_symbolize_keys
35
37
  data.deep_symbolize_keys
36
38
  elsif symbolize_keys
metadata CHANGED
@@ -1,27 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: config_default
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stepan Kirushkin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-24 00:00:00.000000000 Z
11
+ date: 2022-07-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '6'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '6'
27
27
  description: |2
@@ -73,7 +73,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
73
73
  - !ruby/object:Gem::Version
74
74
  version: '0'
75
75
  requirements: []
76
- rubygems_version: 3.2.15
76
+ rubygems_version: 3.3.12
77
77
  signing_key:
78
78
  specification_version: 4
79
79
  summary: A simple way to manage default and env configuration in Rails.