complex_config 0.22.0 → 0.22.2
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/CHANGES.md +113 -88
- data/Rakefile +0 -1
- data/VERSION +1 -1
- data/complex_config.gemspec +4 -5
- data/lib/complex_config/key_source.rb +1 -1
- data/lib/complex_config/settings.rb +5 -1
- data/lib/complex_config/version.rb +1 -1
- data/spec/complex_config/config_spec.rb +0 -1
- data/spec/complex_config/plugins_spec.rb +0 -1
- data/spec/complex_config/provider_spec.rb +0 -1
- data/spec/complex_config/settings_spec.rb +13 -5
- data/spec/complex_config/shortcuts_spec.rb +1 -1
- metadata +4 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dec152dd05a3915da90c6145950d4339a75949644a92c562e8e0ebded4419ec8
|
4
|
+
data.tar.gz: 8cd0e2f3f8bf856bec3eb327bd9c4047e7529c226daf8ede5bf10351cf7e8e5a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d4eff35fd9725c6b0e2df22f8ccc74c8d0883abca52ad67217e2de50f6c368a474ec957a7540106f546f0f7720431502736f0107b14670c9839e0dc82370b7d2
|
7
|
+
data.tar.gz: 59010f4928055d8ca065efc50c120d89804429c21aaf34cb9ce47bedb5b28f15698222c565c39d1bb16fdfebde0d9f6899e03c8d2ff8cd2921640c33a63929f0
|
data/CHANGES.md
CHANGED
@@ -1,18 +1,43 @@
|
|
1
1
|
# Changes
|
2
2
|
|
3
|
+
## 2024-10-21 v0.22.2
|
4
|
+
|
5
|
+
* Update file to handle ENOENT and ENOTDIR errors when reading from file:
|
6
|
+
+ Add `Errno::ENOTDIR` to rescue clause in `ComplexConfig::KeySource`
|
7
|
+
+ Rescue both `Errno::ENOENT` and `Errno::ENOTDIR` exceptions for robustness
|
8
|
+
* Improved test(s) in specs:
|
9
|
+
+ Removed unneeded `allow` statement from `provider_spec.rb`
|
10
|
+
+ Modified `shortcuts_spec.rb` to use `at_least(:once)` for `expect(provider).to receive(:env)`
|
11
|
+
|
12
|
+
## 2024-09-22 v0.22.1
|
13
|
+
|
14
|
+
#### Bug Fixes and Improvements
|
15
|
+
|
16
|
+
* Refactor ComplexConfig settings and specs to handle nil values:
|
17
|
+
* Added `nil` handling in `ComplexConfig::Settings`
|
18
|
+
* Updated `settings_spec.rb` to test for `nil` values
|
19
|
+
* Update dependencies and date in gemspec files:
|
20
|
+
- Removed development dependency `'utils'` from Rakefile.
|
21
|
+
- Updated date in `complex_config.gemspec` from "2024-09-13" to "2024-09-22"
|
22
|
+
|
23
|
+
* Bumped version to **0.22.1**:
|
24
|
+
- Updated `VERSION` in `lib/complex_config/version.rb` from **0.22.0** to **0.22.1**
|
25
|
+
- Updated `s.version` in `complex_config.gemspec` from **0.22.0** to **0.22.1**
|
26
|
+
- Updated gem stub version in `complex_config.gemspec` from **0.22.0** to **0.22.1**
|
27
|
+
|
3
28
|
## 2024-09-12 v0.22.0
|
4
29
|
|
5
30
|
* **New Feature: UTF-8 Support**
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
31
|
+
+ Added `utf8` parameter to `Tree#initialize`
|
32
|
+
+ Introduced `default_utf8` method to determine default encoding based on environment variables
|
33
|
+
+ Modified `inner_child_prefix` and `last_child_prefix` methods for UTF-8 and ASCII encodings
|
34
|
+
+ Updated tests in `spec/complex_config/settings_spec.rb`
|
10
35
|
|
11
36
|
## 2024-09-09 v0.21.2
|
12
37
|
|
13
38
|
* **Settings List Method**:
|
14
|
-
|
15
|
-
|
39
|
+
+ Renamed `list` to `attributes_list`.
|
40
|
+
+ Updated tests in `settings_spec.rb` to use the new method name.
|
16
41
|
|
17
42
|
## 2024-09-09 v0.21.1
|
18
43
|
|
@@ -24,21 +49,21 @@
|
|
24
49
|
## 2024-09-09 v0.21.0
|
25
50
|
|
26
51
|
* **Tree Representation**:
|
27
|
-
|
28
|
-
|
29
|
-
|
52
|
+
+ Add `Tree` class to convert complex config objects into trees.
|
53
|
+
+ Update `Settings` class to use `Tree` conversion in `to_tree` method.
|
54
|
+
+ Update tests to reflect changes.
|
30
55
|
* **Components Array**: Add components array for flux capacitors
|
31
56
|
* **Rakefile and Gemspec**:
|
32
|
-
|
33
|
-
|
57
|
+
- Add clobber task for coverage to Rakefile
|
58
|
+
- Update all_images script: update `bundle` to `bundle install --full-index`
|
34
59
|
* **.gitignore**: Remove `.byebug_history` from ignored files
|
35
60
|
* **Complex Config**:
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
61
|
+
+ Raise type error and add test for empty configuration file.
|
62
|
+
+ Update gemspec to use GemHadar 1.17.0
|
63
|
+
+ Add requirement for tins/xt/ask_and_send in complex_config/provider.rb
|
64
|
+
+ Add check for hash type in ComplexConfig::Settings#build method
|
65
|
+
+ Add test for reading from empty configuration file in provider_spec.rb
|
66
|
+
+ Replace byebug with debug in spec_helper.rb
|
42
67
|
|
43
68
|
## 2024-04-17 v0.20.0
|
44
69
|
|
@@ -75,13 +100,13 @@
|
|
75
100
|
## 2021-10-28 v0.19.2
|
76
101
|
|
77
102
|
* **New Psych Support**
|
78
|
-
|
79
|
-
|
103
|
+
+ Added support for newest Psych 4 library
|
104
|
+
+ Defaults to disabling YAML alias feature
|
80
105
|
* **Psych API Update**
|
81
|
-
|
82
|
-
|
106
|
+
+ Updated code to use new Psych/YAML API when Psych version < 4
|
107
|
+
+ Retained behavior of evaluating aliases
|
83
108
|
* **Ruby Version Bump**
|
84
|
-
|
109
|
+
+ Updated Ruby version in tool-versions to 3.0.2
|
85
110
|
|
86
111
|
## 2021-04-09 v0.19.1
|
87
112
|
|
@@ -91,8 +116,8 @@
|
|
91
116
|
## 2021-01-05 v0.19.0
|
92
117
|
|
93
118
|
* Added two new methods:
|
94
|
-
|
95
|
-
|
119
|
+
+ `get_attribute_by_name`
|
120
|
+
+ `get_attributes_by_name`
|
96
121
|
|
97
122
|
## 2020-08-26 v0.18.2
|
98
123
|
|
@@ -109,13 +134,13 @@
|
|
109
134
|
## 2020-01-07 v0.18.0
|
110
135
|
|
111
136
|
* **New Version Summary**
|
112
|
-
|
113
|
-
|
114
|
-
|
137
|
+
+ Added support for Ruby 2.7.0
|
138
|
+
+ Updated tests to include Ruby 2.7.0
|
139
|
+
+ Refactored code to avoid string modifications
|
115
140
|
* Significant Changes:
|
116
|
-
|
117
|
-
|
118
|
-
|
141
|
+
* Support added for Ruby 2.7.0
|
142
|
+
* Tests updated to include Ruby 2.7.0
|
143
|
+
* String modification stopped
|
119
144
|
|
120
145
|
## 2019-11-27 v0.17.1
|
121
146
|
|
@@ -130,11 +155,11 @@
|
|
130
155
|
## 2019-03-18 v0.16.2
|
131
156
|
|
132
157
|
* **New Feature**: Added support for handling complex scenarios
|
133
|
-
|
158
|
+
+ Implemented a new logic to handle intricate cases
|
134
159
|
* Improved error handling and reporting
|
135
|
-
|
160
|
+
+ Enhanced logging to provide more detailed information about errors
|
136
161
|
* Minor code refactoring
|
137
|
-
|
162
|
+
+ Simplified some conditional statements
|
138
163
|
|
139
164
|
## 2019-03-18 v0.16.1
|
140
165
|
|
@@ -145,12 +170,12 @@
|
|
145
170
|
## 2019-03-14 v0.16.0
|
146
171
|
|
147
172
|
* **New Features**
|
148
|
-
|
149
|
-
|
150
|
-
|
173
|
+
+ Added support for `trim_mode` in legacy mode
|
174
|
+
+ Enabled `trim_mode` by default
|
175
|
+
+ Added `#to_json` method to settings objects
|
151
176
|
* **Changes**
|
152
|
-
|
153
|
-
|
177
|
+
+ Updated code to use new `trim_mode` feature
|
178
|
+
+ Modified settings objects to include `#to_json` method
|
154
179
|
|
155
180
|
## 2019-03-14 v0.15.1
|
156
181
|
|
@@ -167,14 +192,14 @@
|
|
167
192
|
|
168
193
|
* **New Version**: Bumped version
|
169
194
|
* **Improved Error Handling**:
|
170
|
-
|
171
|
-
|
195
|
+
+ Improved error handling if key isn't valid
|
196
|
+
+ Raises `ComplexConfig::DecryptionFailed` for encrypted files
|
172
197
|
* **Compatibility**:
|
173
|
-
|
198
|
+
+ Make this run on older rubies
|
174
199
|
* **Documentation**:
|
175
|
-
|
200
|
+
+ Cleanup documentation
|
176
201
|
* **RubyGems**:
|
177
|
-
|
202
|
+
+ Use newest rubygems
|
178
203
|
|
179
204
|
## 2018-06-07 v0.14.0
|
180
205
|
|
@@ -183,24 +208,24 @@
|
|
183
208
|
## 2018-02-23 v0.13.3
|
184
209
|
|
185
210
|
* **Changes in Evaluation Order**
|
186
|
-
|
211
|
+
+ The evaluation order of key sources has been modified.
|
187
212
|
|
188
213
|
## 2018-02-23 v0.13.2
|
189
214
|
|
190
215
|
* **Compatibility improvements**
|
191
|
-
|
192
|
-
|
193
|
-
|
216
|
+
+ Be compatible with ancient rubies^3
|
217
|
+
+ Be compatible with ancient rubies^2
|
218
|
+
+ Be compatible with ancient rubies
|
194
219
|
* **Refactoring**
|
195
|
-
|
220
|
+
+ Refactor key provision with source object
|
196
221
|
|
197
222
|
## 2018-02-09 v0.13.1
|
198
223
|
|
199
224
|
* **New Features**
|
200
|
-
|
225
|
+
+ Added information to README file
|
201
226
|
* **Significant Changes**
|
202
|
-
|
203
|
-
|
227
|
+
+ Bumped version number
|
228
|
+
+ Improved error reporting for encrypted files with missing keys
|
204
229
|
|
205
230
|
## 2018-01-26 v0.13.0
|
206
231
|
|
@@ -219,11 +244,11 @@
|
|
219
244
|
## 2017-11-16 v0.12.0
|
220
245
|
|
221
246
|
* **New Features**
|
222
|
-
|
247
|
+
+ Add support for writing configurations (encrypted or not)
|
223
248
|
* **Version Bump**
|
224
|
-
|
249
|
+
+ Bump version to 0.12.0
|
225
250
|
* **Compatibility Improvements**
|
226
|
-
|
251
|
+
+ Support older Rubies
|
227
252
|
|
228
253
|
## 2017-11-02 v0.11.3
|
229
254
|
|
@@ -252,18 +277,18 @@
|
|
252
277
|
|
253
278
|
* **New Version**: Released version 0.9.2.
|
254
279
|
* **Performance Improvement**:
|
255
|
-
|
280
|
+
+ Memoized proxy object for improved performance.
|
256
281
|
|
257
282
|
## 2016-11-23 v0.9.1
|
258
283
|
|
259
284
|
* **New Features**
|
260
|
-
|
261
|
-
|
285
|
+
+ Use newest RubyGems
|
286
|
+
+ Test on Ruby 2.3.3
|
262
287
|
* **Bug Fixes**
|
263
|
-
|
264
|
-
|
288
|
+
+ Fix Travis builds
|
289
|
+
+ travis fiddles with RAILS_ENV variable, breaking specs (resolved)
|
265
290
|
* **Testing Improvements**
|
266
|
-
|
291
|
+
+ Test newer Rubies
|
267
292
|
|
268
293
|
## 2016-11-22 v0.9.0
|
269
294
|
|
@@ -280,23 +305,23 @@
|
|
280
305
|
## 2016-07-18 v0.7.0
|
281
306
|
|
282
307
|
* **New Features**
|
283
|
-
|
308
|
+
+ Added new date functionality
|
284
309
|
* **Improvements**
|
285
310
|
+ Simplified `ComplexConfig::Settings` interface by basing it on
|
286
311
|
`BasicObject` and reducing mixin usage
|
287
312
|
* **Documentation**
|
288
|
-
|
313
|
+
+ Updated README.md with new changes
|
289
314
|
|
290
315
|
## 2016-07-15 v0.6.0
|
291
316
|
|
292
317
|
* **Caching Improvements**
|
293
|
-
|
318
|
+
+ Use `mize` for caching
|
294
319
|
|
295
320
|
## 2016-06-23 v0.5.2
|
296
321
|
|
297
322
|
* **Index Access Feature**
|
298
|
-
|
299
|
-
|
323
|
+
+ Fixed issue with incorrect indexing behavior (#56190d3)
|
324
|
+
+ Improved performance and reliability of index access functionality
|
300
325
|
|
301
326
|
## 2016-06-23 v0.5.1
|
302
327
|
|
@@ -305,20 +330,20 @@
|
|
305
330
|
`foo[:bar]` equivalent for a plugin key.
|
306
331
|
+ Test on Ruby 2.3.1 and 2.4.0-preview1
|
307
332
|
* **Infrastructure Changes**
|
308
|
-
|
333
|
+
+ Use new infrastructure
|
309
334
|
* **Bug Fixes**
|
310
|
-
|
335
|
+
+ Fix typo
|
311
336
|
|
312
337
|
## 2015-11-19 v0.5.0
|
313
338
|
|
314
339
|
* **New Features**
|
315
|
-
|
316
|
-
|
340
|
+
+ Add configure method
|
341
|
+
+ Add configuration example to README
|
317
342
|
* **Bug Fixes**
|
318
|
-
|
319
|
-
|
343
|
+
+ Flush cache for every request in rails development
|
344
|
+
+ Change the Changes
|
320
345
|
* **Improvements**
|
321
|
-
|
346
|
+
+ Just always skip to avoid interference
|
322
347
|
|
323
348
|
## 2015-11-17 v0.4.0
|
324
349
|
|
@@ -327,14 +352,14 @@
|
|
327
352
|
## 2015-11-03 v0.3.1
|
328
353
|
|
329
354
|
* **New Features**
|
330
|
-
|
331
|
-
|
332
|
-
|
355
|
+
+ Add missing tins dependency
|
356
|
+
+ Show improved settings output in README.md
|
357
|
+
+ Adds a decent string representation for ComplexConfig::Settings objects
|
333
358
|
* **Dependency Updates**
|
334
|
-
|
335
|
-
|
359
|
+
+ Use newest gem hadar
|
360
|
+
+ Add some development_dependencies (including tins)
|
336
361
|
* **Code Improvements**
|
337
|
-
|
362
|
+
+ Shorten codeclimate snippet
|
338
363
|
|
339
364
|
## 2015-03-24 v0.3.0
|
340
365
|
|
@@ -365,28 +390,28 @@
|
|
365
390
|
## 2015-01-27 v0.2.0
|
366
391
|
|
367
392
|
* **New Features**
|
368
|
-
|
369
|
-
|
393
|
+
+ Added support for JRuby in tests
|
394
|
+
+ Updated to newest Ruby 2.2
|
370
395
|
* **Improvements**
|
371
396
|
+ Replaced mixin with delegation for Enumerable, allowing attribute names
|
372
397
|
like `zip`, `min`, or `max` without conflicts
|
373
398
|
* **Documentation**
|
374
|
-
|
399
|
+
+ Added Apache license file
|
375
400
|
|
376
401
|
## 2015-01-01 v0.1.1
|
377
402
|
|
378
403
|
* **New Version Summary**
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
404
|
+
+ Use value from non-associative list arrays
|
405
|
+
+ Fix `puts` method to call `to_ary` correctly
|
406
|
+
+ Prevent cash leakage after flushing cache
|
407
|
+
+ Add `to_ary` method for level on demand
|
383
408
|
|
384
409
|
## 2014-12-15 v0.1.0
|
385
410
|
|
386
411
|
* **Significant Changes**:
|
387
|
-
|
388
|
-
|
389
|
-
|
412
|
+
+ Freeze cached configuration by default (versioning)
|
413
|
+
+ Add to-do list for future development
|
414
|
+
+ Integrate CodeClimate for code analysis and improvement
|
390
415
|
|
391
416
|
## 2014-12-12 v0.0.0
|
392
417
|
|
data/Rakefile
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.22.
|
1
|
+
0.22.2
|
data/complex_config.gemspec
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
# stub: complex_config 0.22.
|
2
|
+
# stub: complex_config 0.22.2 ruby lib
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "complex_config".freeze
|
6
|
-
s.version = "0.22.
|
6
|
+
s.version = "0.22.2".freeze
|
7
7
|
|
8
8
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
9
9
|
s.require_paths = ["lib".freeze]
|
10
10
|
s.authors = ["Florian Frank".freeze]
|
11
|
-
s.date = "2024-
|
11
|
+
s.date = "2024-10-21"
|
12
12
|
s.description = "This library allows you to access configuration files via a simple interface".freeze
|
13
13
|
s.email = "flori@ping.de".freeze
|
14
14
|
s.executables = ["complex_config".freeze]
|
@@ -23,12 +23,11 @@ Gem::Specification.new do |s|
|
|
23
23
|
|
24
24
|
s.specification_version = 4
|
25
25
|
|
26
|
-
s.add_development_dependency(%q<gem_hadar>.freeze, ["~> 1.
|
26
|
+
s.add_development_dependency(%q<gem_hadar>.freeze, ["~> 1.19".freeze])
|
27
27
|
s.add_development_dependency(%q<rake>.freeze, [">= 0".freeze])
|
28
28
|
s.add_development_dependency(%q<simplecov>.freeze, [">= 0".freeze])
|
29
29
|
s.add_development_dependency(%q<rspec>.freeze, [">= 0".freeze])
|
30
30
|
s.add_development_dependency(%q<monetize>.freeze, [">= 0".freeze])
|
31
|
-
s.add_development_dependency(%q<utils>.freeze, [">= 0".freeze])
|
32
31
|
s.add_development_dependency(%q<debug>.freeze, [">= 0".freeze])
|
33
32
|
s.add_runtime_dependency(%q<json>.freeze, [">= 0".freeze])
|
34
33
|
s.add_runtime_dependency(%q<tins>.freeze, [">= 0".freeze])
|
@@ -104,7 +104,11 @@ class ComplexConfig::Settings < BasicObject
|
|
104
104
|
if ::Array === v
|
105
105
|
v.to_ary.map { |x| (x.ask_and_send(:to_h) rescue x) || x }
|
106
106
|
elsif v.respond_to?(:to_h)
|
107
|
-
v.
|
107
|
+
if v.nil?
|
108
|
+
nil
|
109
|
+
else
|
110
|
+
v.ask_and_send(:to_h) rescue v
|
111
|
+
end
|
108
112
|
else
|
109
113
|
v
|
110
114
|
end
|
@@ -19,7 +19,8 @@ RSpec.describe ComplexConfig::Settings do
|
|
19
19
|
bar: {
|
20
20
|
baz: true
|
21
21
|
},
|
22
|
-
|
22
|
+
nix: nil,
|
23
|
+
qux: 'quux',
|
23
24
|
}
|
24
25
|
]
|
25
26
|
obj.name_prefix = 'root'
|
@@ -69,7 +70,7 @@ RSpec.describe ComplexConfig::Settings do
|
|
69
70
|
end
|
70
71
|
|
71
72
|
it 'can display its attribute_names' do
|
72
|
-
expect(settings.foo.attribute_names).to eq [
|
73
|
+
expect(settings.foo.attribute_names).to eq %i[ bar nix qux ]
|
73
74
|
end
|
74
75
|
|
75
76
|
it 'can display its attribute_values' do
|
@@ -83,19 +84,21 @@ RSpec.describe ComplexConfig::Settings do
|
|
83
84
|
end
|
84
85
|
|
85
86
|
it 'can be converted into a hash' do
|
86
|
-
expect(settings.foo.to_h).to eq(bar: { baz: true }, qux: 'quux')
|
87
|
+
expect(settings.foo.to_h).to eq(bar: { baz: true }, nix: nil, qux: 'quux')
|
87
88
|
end
|
88
89
|
|
89
90
|
it 'can return a hash with pathes as keys' do
|
90
91
|
expect(settings.pathes(path_sep: ?:)).to eq(
|
91
92
|
'root:foo:bar:baz' => true,
|
92
|
-
'root:foo:
|
93
|
+
'root:foo:nix' => nil,
|
94
|
+
'root:foo:qux' => "quux",
|
93
95
|
)
|
94
96
|
end
|
95
97
|
|
96
98
|
it 'can be listed as string' do
|
97
99
|
expect(settings.attributes_list(pair_sep: ' → ', path_sep: ?/)).to eq <<~EOT
|
98
100
|
root/foo/bar/baz → true
|
101
|
+
root/foo/nix → nil
|
99
102
|
root/foo/qux → "quux"
|
100
103
|
EOT
|
101
104
|
end
|
@@ -108,6 +111,7 @@ RSpec.describe ComplexConfig::Settings do
|
|
108
111
|
settings[:ary] = described_class[ [ 1, { nested: 2 }, 3 ] ]
|
109
112
|
expect(settings.attributes_list).to eq <<~EOT
|
110
113
|
root.foo.bar.baz = true
|
114
|
+
root.foo.nix = nil
|
111
115
|
root.foo.qux = "quux"
|
112
116
|
root.ary[0] = 1
|
113
117
|
root.ary[1].nested = 2
|
@@ -122,6 +126,7 @@ RSpec.describe ComplexConfig::Settings do
|
|
122
126
|
├─ foo
|
123
127
|
│ ├─ bar
|
124
128
|
│ │ └─ baz = true
|
129
|
+
│ ├─ nix = nil
|
125
130
|
│ └─ qux = "quux"
|
126
131
|
└─ ary
|
127
132
|
├─ 1
|
@@ -138,6 +143,7 @@ RSpec.describe ComplexConfig::Settings do
|
|
138
143
|
└─ foo
|
139
144
|
├─ bar
|
140
145
|
│ └─ baz = true
|
146
|
+
├─ nix = nil
|
141
147
|
└─ qux = "quux"
|
142
148
|
EOT
|
143
149
|
settings.pretty_print(q)
|
@@ -150,6 +156,7 @@ RSpec.describe ComplexConfig::Settings do
|
|
150
156
|
`- foo
|
151
157
|
+- bar
|
152
158
|
| `- baz = true
|
159
|
+
+- nix = nil
|
153
160
|
`- qux = "quux"
|
154
161
|
EOT
|
155
162
|
ENV['LANG'] = 'de_DE.ISO8859-15'
|
@@ -162,12 +169,13 @@ RSpec.describe ComplexConfig::Settings do
|
|
162
169
|
:foo:
|
163
170
|
:bar:
|
164
171
|
:baz: true
|
172
|
+
:nix:
|
165
173
|
:qux: quux
|
166
174
|
EOT
|
167
175
|
end
|
168
176
|
|
169
177
|
it 'can be converted into JSON' do
|
170
|
-
expect(settings.to_json).to eq '{"foo":{"bar":{"baz":true},"qux":"quux"}}'
|
178
|
+
expect(settings.to_json).to eq '{"foo":{"bar":{"baz":true},"nix":null,"qux":"quux"}}'
|
171
179
|
end
|
172
180
|
|
173
181
|
it 'raises exception if expected attribute is missing' do
|
@@ -54,7 +54,7 @@ RSpec.describe 'shortcuts' do
|
|
54
54
|
settings = complex_config_with_env.config
|
55
55
|
expect(settings).to be_a ComplexConfig::Settings
|
56
56
|
expect(settings.config.baz).to eq 'something'
|
57
|
-
|
57
|
+
expect(provider).to receive(:env).and_return('test').at_least(:once)
|
58
58
|
settings = complex_config_with_env.config
|
59
59
|
expect(settings).to be_a ComplexConfig::Settings
|
60
60
|
expect(settings.config.baz).to eq 'something else'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: complex_config
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.22.
|
4
|
+
version: 0.22.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Florian Frank
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-10-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gem_hadar
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.
|
19
|
+
version: '1.19'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.
|
26
|
+
version: '1.19'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -80,20 +80,6 @@ dependencies:
|
|
80
80
|
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: utils
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - ">="
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '0'
|
90
|
-
type: :development
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - ">="
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '0'
|
97
83
|
- !ruby/object:Gem::Dependency
|
98
84
|
name: debug
|
99
85
|
requirement: !ruby/object:Gem::Requirement
|