config_default 0.2.4 → 0.2.5

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: 4507e90d9bb3f204a007a1d66e4d2a861380b7a1270754e5adcae6319dd0ade6
4
- data.tar.gz: f967fddbd62e8ddb92ca9e162c3471a3e0dd09573edd4e814fc14618a7861d98
3
+ metadata.gz: c668f11a0329c689b17ce83c7f656efba30e31ecbe4c277602df2a623ce5395f
4
+ data.tar.gz: edc20362637a4ee07b9db2f6bdc41d60841ad40b5af6e29b1edf1990664deec1
5
5
  SHA512:
6
- metadata.gz: 7a2209a32fec7c10bb1ea0ecbfc03800bc6da8e10ababb9cb37336f445fd01c9608568b97189dc7b5511d4aad7157a200af0b455d68d136ecdc5082896375c38
7
- data.tar.gz: 72792f9a6bfb4774169436dec22f1638cd8f01ba412bf553fbb930ad6e348c7cd8d15ede3273fa82f23462ffe7b3665044a50d94e7cfb42a0ee3050d4a20314d
6
+ metadata.gz: 4d060c70fe676be1172615599c64ba5c59f3b03c3b9313c5758e5724dd256c02def5b05697f44b39c17c1fdc352753f1dc6b32cc74e41ac51cd446f440683252
7
+ data.tar.gz: 2a8133cb3fe79507af9dc42c9d86aaa96e8d47f5cf1a82b67ff58eddb5027adb8e4a81f2364fc566659f2b22497dd60a5078d0ca668dd836155f09180f1b70c5
@@ -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,73 +1,73 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- config_default (0.2.4)
4
+ config_default (0.2.5)
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.0.5)
11
+ actionpack (= 7.0.5)
12
+ activesupport (= 7.0.5)
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
+ actionmailbox (7.0.5)
16
+ actionpack (= 7.0.5)
17
+ activejob (= 7.0.5)
18
+ activerecord (= 7.0.5)
19
+ activestorage (= 7.0.5)
20
+ activesupport (= 7.0.5)
21
21
  mail (>= 2.7.1)
22
22
  net-imap
23
23
  net-pop
24
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)
25
+ actionmailer (7.0.5)
26
+ actionpack (= 7.0.5)
27
+ actionview (= 7.0.5)
28
+ activejob (= 7.0.5)
29
+ activesupport (= 7.0.5)
30
30
  mail (~> 2.5, >= 2.5.4)
31
31
  net-imap
32
32
  net-pop
33
33
  net-smtp
34
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
+ actionpack (7.0.5)
36
+ actionview (= 7.0.5)
37
+ activesupport (= 7.0.5)
38
+ rack (~> 2.0, >= 2.2.4)
39
39
  rack-test (>= 0.6.3)
40
40
  rails-dom-testing (~> 2.0)
41
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)
42
+ actiontext (7.0.5)
43
+ actionpack (= 7.0.5)
44
+ activerecord (= 7.0.5)
45
+ activestorage (= 7.0.5)
46
+ activesupport (= 7.0.5)
47
47
  globalid (>= 0.6.0)
48
48
  nokogiri (>= 1.8.5)
49
- actionview (7.0.3.1)
50
- activesupport (= 7.0.3.1)
49
+ actionview (7.0.5)
50
+ activesupport (= 7.0.5)
51
51
  builder (~> 3.1)
52
52
  erubi (~> 1.4)
53
53
  rails-dom-testing (~> 2.0)
54
54
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
55
- activejob (7.0.3.1)
56
- activesupport (= 7.0.3.1)
55
+ activejob (7.0.5)
56
+ activesupport (= 7.0.5)
57
57
  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)
58
+ activemodel (7.0.5)
59
+ activesupport (= 7.0.5)
60
+ activerecord (7.0.5)
61
+ activemodel (= 7.0.5)
62
+ activesupport (= 7.0.5)
63
+ activestorage (7.0.5)
64
+ actionpack (= 7.0.5)
65
+ activejob (= 7.0.5)
66
+ activerecord (= 7.0.5)
67
+ activesupport (= 7.0.5)
68
68
  marcel (~> 1.0)
69
69
  mini_mime (>= 1.1.0)
70
- activesupport (7.0.3.1)
70
+ activesupport (7.0.5)
71
71
  concurrent-ruby (~> 1.0, >= 1.0.2)
72
72
  i18n (>= 1.6, < 2)
73
73
  minitest (>= 5.1)
@@ -75,140 +75,147 @@ GEM
75
75
  ast (2.4.2)
76
76
  builder (3.2.4)
77
77
  coderay (1.1.3)
78
- concurrent-ruby (1.1.10)
78
+ concurrent-ruby (1.2.2)
79
79
  crass (1.0.6)
80
+ date (3.3.3)
80
81
  diff-lcs (1.5.0)
81
- digest (3.1.0)
82
- erubi (1.10.0)
83
- globalid (1.0.0)
82
+ erubi (1.12.0)
83
+ globalid (1.1.0)
84
84
  activesupport (>= 5.0)
85
- i18n (1.12.0)
85
+ i18n (1.14.1)
86
86
  concurrent-ruby (~> 1.0)
87
- loofah (2.18.0)
87
+ json (2.6.3)
88
+ loofah (2.21.3)
88
89
  crass (~> 1.0.2)
89
- nokogiri (>= 1.5.9)
90
- mail (2.7.1)
90
+ nokogiri (>= 1.12.0)
91
+ mail (2.8.1)
91
92
  mini_mime (>= 0.1.1)
93
+ net-imap
94
+ net-pop
95
+ net-smtp
92
96
  marcel (1.0.2)
93
97
  method_source (1.0.0)
94
98
  mini_mime (1.1.2)
95
- minitest (5.16.2)
96
- net-imap (0.2.3)
97
- digest
99
+ minitest (5.18.0)
100
+ net-imap (0.3.4)
101
+ date
98
102
  net-protocol
99
- strscan
100
- net-pop (0.1.1)
101
- digest
103
+ net-pop (0.1.2)
102
104
  net-protocol
105
+ net-protocol (0.2.1)
103
106
  timeout
104
- net-protocol (0.1.3)
105
- timeout
106
- net-smtp (0.3.1)
107
- digest
107
+ net-smtp (0.3.3)
108
108
  net-protocol
109
- timeout
110
- nio4r (2.5.8)
111
- nokogiri (1.13.7-x86_64-darwin)
109
+ nio4r (2.5.9)
110
+ nokogiri (1.15.2-arm64-darwin)
111
+ racc (~> 1.4)
112
+ nokogiri (1.15.2-x86_64-darwin)
112
113
  racc (~> 1.4)
113
- nokogiri (1.13.7-x86_64-linux)
114
+ nokogiri (1.15.2-x86_64-linux)
114
115
  racc (~> 1.4)
115
- parallel (1.22.1)
116
- parser (3.1.2.0)
116
+ parallel (1.23.0)
117
+ parser (3.2.2.3)
117
118
  ast (~> 2.4.1)
118
- pry (0.14.1)
119
+ racc
120
+ pry (0.14.2)
119
121
  coderay (~> 1.1)
120
122
  method_source (~> 1.0)
121
- racc (1.6.0)
122
- rack (2.2.4)
123
- rack-test (2.0.2)
123
+ racc (1.7.0)
124
+ rack (2.2.7)
125
+ rack-test (2.1.0)
124
126
  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)
127
+ rails (7.0.5)
128
+ actioncable (= 7.0.5)
129
+ actionmailbox (= 7.0.5)
130
+ actionmailer (= 7.0.5)
131
+ actionpack (= 7.0.5)
132
+ actiontext (= 7.0.5)
133
+ actionview (= 7.0.5)
134
+ activejob (= 7.0.5)
135
+ activemodel (= 7.0.5)
136
+ activerecord (= 7.0.5)
137
+ activestorage (= 7.0.5)
138
+ activesupport (= 7.0.5)
137
139
  bundler (>= 1.15.0)
138
- railties (= 7.0.3.1)
140
+ railties (= 7.0.5)
139
141
  rails-dom-testing (2.0.3)
140
142
  activesupport (>= 4.2.0)
141
143
  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)
144
+ rails-html-sanitizer (1.6.0)
145
+ loofah (~> 2.21)
146
+ nokogiri (~> 1.14)
147
+ railties (7.0.5)
148
+ actionpack (= 7.0.5)
149
+ activesupport (= 7.0.5)
147
150
  method_source
148
151
  rake (>= 12.2)
149
152
  thor (~> 1.0)
150
153
  zeitwerk (~> 2.5)
151
154
  rainbow (3.1.1)
152
155
  rake (13.0.6)
153
- regexp_parser (2.5.0)
156
+ regexp_parser (2.8.0)
154
157
  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)
158
+ rspec (3.12.0)
159
+ rspec-core (~> 3.12.0)
160
+ rspec-expectations (~> 3.12.0)
161
+ rspec-mocks (~> 3.12.0)
162
+ rspec-core (3.12.2)
163
+ rspec-support (~> 3.12.0)
164
+ rspec-expectations (3.12.3)
162
165
  diff-lcs (>= 1.2.0, < 2.0)
163
- rspec-support (~> 3.11.0)
164
- rspec-mocks (3.11.1)
166
+ rspec-support (~> 3.12.0)
167
+ rspec-mocks (3.12.5)
165
168
  diff-lcs (>= 1.2.0, < 2.0)
166
- rspec-support (~> 3.11.0)
167
- rspec-support (3.11.0)
168
- rubocop (1.30.1)
169
+ rspec-support (~> 3.12.0)
170
+ rspec-support (3.12.0)
171
+ rubocop (1.50.2)
172
+ json (~> 2.3)
169
173
  parallel (~> 1.10)
170
- parser (>= 3.1.0.0)
174
+ parser (>= 3.2.0.0)
171
175
  rainbow (>= 2.2.2, < 4.0)
172
176
  regexp_parser (>= 1.8, < 3.0)
173
177
  rexml (>= 3.2.5, < 4.0)
174
- rubocop-ast (>= 1.18.0, < 2.0)
178
+ rubocop-ast (>= 1.28.0, < 2.0)
175
179
  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)
180
+ unicode-display_width (>= 2.4.0, < 3.0)
181
+ rubocop-ast (1.29.0)
182
+ parser (>= 3.2.1.0)
183
+ rubocop-capybara (2.18.0)
184
+ rubocop (~> 1.41)
185
+ rubocop-config-umbrellio (1.50.0.85)
186
+ rubocop (~> 1.50.0)
187
+ rubocop-performance (~> 1.17.0)
188
+ rubocop-rails (~> 2.19.0)
183
189
  rubocop-rake (~> 0.6.0)
184
- rubocop-rspec (~> 2.11.1)
190
+ rubocop-rspec (~> 2.20.0)
185
191
  rubocop-sequel (~> 0.3.3)
186
- rubocop-performance (1.14.3)
192
+ rubocop-performance (1.17.1)
187
193
  rubocop (>= 1.7.0, < 2.0)
188
194
  rubocop-ast (>= 0.4.0)
189
- rubocop-rails (2.14.2)
195
+ rubocop-rails (2.19.1)
190
196
  activesupport (>= 4.2.0)
191
197
  rack (>= 1.1)
192
- rubocop (>= 1.7.0, < 2.0)
198
+ rubocop (>= 1.33.0, < 2.0)
193
199
  rubocop-rake (0.6.0)
194
200
  rubocop (~> 1.0)
195
- rubocop-rspec (2.11.1)
196
- rubocop (~> 1.19)
201
+ rubocop-rspec (2.20.0)
202
+ rubocop (~> 1.33)
203
+ rubocop-capybara (~> 2.17)
197
204
  rubocop-sequel (0.3.4)
198
205
  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)
206
+ ruby-progressbar (1.13.0)
207
+ thor (1.2.2)
208
+ timeout (0.3.2)
209
+ tzinfo (2.0.6)
204
210
  concurrent-ruby (~> 1.0)
205
- unicode-display_width (2.2.0)
211
+ unicode-display_width (2.4.2)
206
212
  websocket-driver (0.7.5)
207
213
  websocket-extensions (>= 0.1.0)
208
214
  websocket-extensions (0.1.5)
209
- zeitwerk (2.6.0)
215
+ zeitwerk (2.6.8)
210
216
 
211
217
  PLATFORMS
218
+ arm64-darwin-22
212
219
  x86_64-darwin-20
213
220
  x86_64-darwin-21
214
221
  x86_64-linux
@@ -222,4 +229,4 @@ DEPENDENCIES
222
229
  rubocop-config-umbrellio
223
230
 
224
231
  BUNDLED WITH
225
- 2.2.28
232
+ 2.4.13
data/README.md CHANGED
@@ -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
@@ -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.2.5"
5
5
  end
@@ -50,10 +50,7 @@ module ConfigDefault
50
50
  end
51
51
 
52
52
  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
- )
53
+ attributes = load(name, key: key)
54
+ ConfigDefault::Struct.new(attributes, recursive: recursive, allow_nil: allow_nil)
58
55
  end
59
56
  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.2.5
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-06-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -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.3.12
76
+ rubygems_version: 3.4.13
77
77
  signing_key:
78
78
  specification_version: 4
79
79
  summary: A simple way to manage default and env configuration in Rails.