complex_config 0.18.2 → 0.19.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/complex_config.gemspec +4 -4
- data/lib/complex_config/settings.rb +12 -2
- data/lib/complex_config/version.rb +1 -1
- data/spec/complex_config/settings_spec.rb +5 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ff2b361ee9d3b06983e6ccdcc847a1ca17dd7b41cdf7bc45fc83bc0261b318c
|
4
|
+
data.tar.gz: a658135bbc6e28aaef43ec7ba14ec70e8cde6bcdf1a897ddae0c26abd1a5f0fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 750968741f4e6744525b091cd101d8e3344ded32f538e98a99f450c553de9b36e7f18d7275c1efacc4319634b85f78549107c1daa05eb24b560464043b0b02e0
|
7
|
+
data.tar.gz: 2f6a955ac2ee470429390784b2e886655556ac0c06a3a6d440357a295b62d155c4f8ce6622834a2724671cab5e9a4c28c74f46e05631523bb12fa84c0c96d1d0
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.19.0
|
data/complex_config.gemspec
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
# stub: complex_config 0.
|
2
|
+
# stub: complex_config 0.19.0 ruby lib
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "complex_config".freeze
|
6
|
-
s.version = "0.
|
6
|
+
s.version = "0.19.0"
|
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 = "
|
11
|
+
s.date = "2021-01-05"
|
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]
|
@@ -17,7 +17,7 @@ Gem::Specification.new do |s|
|
|
17
17
|
s.homepage = "https://github.com/flori/complex_config".freeze
|
18
18
|
s.licenses = ["Apache-2.0".freeze]
|
19
19
|
s.rdoc_options = ["--title".freeze, "ComplexConfig -- configuration library".freeze, "--main".freeze, "README.md".freeze]
|
20
|
-
s.rubygems_version = "3.
|
20
|
+
s.rubygems_version = "3.2.3".freeze
|
21
21
|
s.summary = "configuration library".freeze
|
22
22
|
s.test_files = ["spec/complex_config/config_spec.rb".freeze, "spec/complex_config/encryption_spec.rb".freeze, "spec/complex_config/key_source_spec.rb".freeze, "spec/complex_config/plugins_spec.rb".freeze, "spec/complex_config/provider_spec.rb".freeze, "spec/complex_config/settings_spec.rb".freeze, "spec/complex_config/shortcuts_spec.rb".freeze, "spec/spec_helper.rb".freeze]
|
23
23
|
|
@@ -111,7 +111,7 @@ class ComplexConfig::Settings < BasicObject
|
|
111
111
|
end
|
112
112
|
|
113
113
|
def ==(other)
|
114
|
-
to_h == other.to_h
|
114
|
+
other.respond_to?(:to_h) && to_h == other.to_h
|
115
115
|
end
|
116
116
|
|
117
117
|
def to_yaml
|
@@ -187,7 +187,7 @@ class ComplexConfig::Settings < BasicObject
|
|
187
187
|
freeze
|
188
188
|
end
|
189
189
|
|
190
|
-
def
|
190
|
+
def attribute_get(name)
|
191
191
|
if !attribute_set?(name) and
|
192
192
|
value = ::ComplexConfig::Provider.apply_plugins(self, name)
|
193
193
|
then
|
@@ -197,6 +197,16 @@ class ComplexConfig::Settings < BasicObject
|
|
197
197
|
end
|
198
198
|
end
|
199
199
|
|
200
|
+
alias [] attribute_get
|
201
|
+
|
202
|
+
def attribute_get!(name)
|
203
|
+
if attribute_set?(name)
|
204
|
+
attribute_get(name)
|
205
|
+
else
|
206
|
+
raise ::ComplexConfig::AttributeMissing, "no attribute named #{name.inspect}"
|
207
|
+
end
|
208
|
+
end
|
209
|
+
|
200
210
|
def []=(name, value)
|
201
211
|
@table[name.to_sym] = value
|
202
212
|
end
|
@@ -133,6 +133,11 @@ EOT
|
|
133
133
|
expect(settings.foo.baz?).to be_falsy
|
134
134
|
end
|
135
135
|
|
136
|
+
it 'can trigger exception on attribute get' do
|
137
|
+
expect(settings.foo.attribute_get!(:bar)).to be_truthy
|
138
|
+
expect { settings.foo.attribute_get!(:baz) }.to raise_error ComplexConfig::AttributeMissing
|
139
|
+
end
|
140
|
+
|
136
141
|
it 'handles arrays correctly' do
|
137
142
|
settings = described_class[ary: [ 1, { hsh: 2 }, 3 ]]
|
138
143
|
expect(settings.to_h).to eq(ary: [ 1, { hsh: 2 }, 3 ])
|
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.
|
4
|
+
version: 0.19.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Florian Frank
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gem_hadar
|
@@ -219,7 +219,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
219
219
|
- !ruby/object:Gem::Version
|
220
220
|
version: '0'
|
221
221
|
requirements: []
|
222
|
-
rubygems_version: 3.
|
222
|
+
rubygems_version: 3.2.3
|
223
223
|
signing_key:
|
224
224
|
specification_version: 4
|
225
225
|
summary: configuration library
|