complex_config 0.13.0 → 0.13.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +3 -2
- data/README.md +2 -0
- data/VERSION +1 -1
- data/complex_config.gemspec +4 -4
- data/lib/complex_config/provider.rb +10 -6
- data/lib/complex_config/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 11714f3ba3ed9b55517d48387bd4b8a92e6eb3a8448b911b4892275adfe6d13c
|
4
|
+
data.tar.gz: ce4b19cb078404e1eb2e82805782bea3e3818e114f9e82f25b2a543dfd68ece6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b5a6ae82c387a3866fc4eb4bdc834cf6c2dc87b4eee0c5df5d41632efcc5017230e13dd7d60a51997ad6318b2c3d42ab5ac314b6e873b3ab8ba282d7e8e98ef5
|
7
|
+
data.tar.gz: '079795e2114767896a3a362847b8079bc7b20fbe9f146872bba8a21af61b0ba8e698c4a00080e5013f3946c20566f222e993c26629527818d473334efe2357a7'
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -144,6 +144,8 @@ Here is the `ComplexConfig::Plugins::MONEY` plugin for example:
|
|
144
144
|
|
145
145
|
## Changes
|
146
146
|
|
147
|
+
* 2018-02-09 Release 0.13.1
|
148
|
+
Improve error reporting for encrypted files (missing key)
|
147
149
|
* 2018-01-26 Release 0.13.0
|
148
150
|
Improve `write_config` interface and more tests
|
149
151
|
* 2017-11-17 Release 0.12.2
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.13.
|
1
|
+
0.13.1
|
data/complex_config.gemspec
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
# stub: complex_config 0.13.
|
2
|
+
# stub: complex_config 0.13.1 ruby lib
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "complex_config".freeze
|
6
|
-
s.version = "0.13.
|
6
|
+
s.version = "0.13.1"
|
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 = "2018-
|
11
|
+
s.date = "2018-02-09"
|
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.extra_rdoc_files = ["README.md".freeze, "lib/complex_config.rb".freeze, "lib/complex_config/config.rb".freeze, "lib/complex_config/encryption.rb".freeze, "lib/complex_config/errors.rb".freeze, "lib/complex_config/plugins.rb".freeze, "lib/complex_config/plugins/enable.rb".freeze, "lib/complex_config/plugins/money.rb".freeze, "lib/complex_config/plugins/uri.rb".freeze, "lib/complex_config/provider.rb".freeze, "lib/complex_config/provider/shortcuts.rb".freeze, "lib/complex_config/proxy.rb".freeze, "lib/complex_config/railtie.rb".freeze, "lib/complex_config/rude.rb".freeze, "lib/complex_config/settings.rb".freeze, "lib/complex_config/shortcuts.rb".freeze, "lib/complex_config/version.rb".freeze]
|
@@ -16,7 +16,7 @@ Gem::Specification.new do |s|
|
|
16
16
|
s.homepage = "https://github.com/flori/complex_config".freeze
|
17
17
|
s.licenses = ["Apache-2.0".freeze]
|
18
18
|
s.rdoc_options = ["--title".freeze, "ComplexConfig -- configuration library".freeze, "--main".freeze, "README.md".freeze]
|
19
|
-
s.rubygems_version = "2.
|
19
|
+
s.rubygems_version = "2.7.3".freeze
|
20
20
|
s.summary = "configuration library".freeze
|
21
21
|
s.test_files = ["spec/complex_config/config_spec.rb".freeze, "spec/complex_config/encryption_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]
|
22
22
|
|
@@ -68,13 +68,14 @@ class ComplexConfig::Provider
|
|
68
68
|
datas << IO.binread(pathname)
|
69
69
|
end
|
70
70
|
if enc_pathname = pathname.to_s + '.enc' and
|
71
|
-
File.exist?(enc_pathname) and
|
71
|
+
File.exist?(enc_pathname) and
|
72
|
+
my_key = key_as_bytes(enc_pathname)
|
72
73
|
then
|
73
74
|
text = IO.binread(enc_pathname)
|
74
75
|
datas << ComplexConfig::Encryption.new(my_key).decrypt(text)
|
75
76
|
end
|
76
77
|
datas.empty? and raise ComplexConfig::ConfigurationFileMissing,
|
77
|
-
"configuration file #{pathname.inspect} is missing"
|
78
|
+
"configuration file #{pathname.to_s.inspect} is missing"
|
78
79
|
results = datas.map { |d| evaluate(pathname, d) }
|
79
80
|
hashes = results.map { |r| ::YAML.load(r, pathname) }
|
80
81
|
settings = ComplexConfig::Settings.build(name, hashes.shift)
|
@@ -166,10 +167,13 @@ class ComplexConfig::Provider
|
|
166
167
|
].compact[0, 1].map(&:strip).first
|
167
168
|
end
|
168
169
|
|
169
|
-
def key_as_bytes(pathname
|
170
|
-
k = key(pathname)
|
171
|
-
|
172
|
-
|
170
|
+
def key_as_bytes(pathname)
|
171
|
+
if k = key(pathname.sub(/\.enc\z/, ''))
|
172
|
+
key_to_bytes(k)
|
173
|
+
else
|
174
|
+
warn "encryption key is missing for #{pathname.to_s.inspect} => Ignoring it!"
|
175
|
+
nil
|
176
|
+
end
|
173
177
|
end
|
174
178
|
|
175
179
|
attr_writer :key
|
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.13.
|
4
|
+
version: 0.13.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Florian Frank
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-02-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gem_hadar
|
@@ -215,7 +215,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
215
215
|
version: '0'
|
216
216
|
requirements: []
|
217
217
|
rubyforge_project:
|
218
|
-
rubygems_version: 2.
|
218
|
+
rubygems_version: 2.7.3
|
219
219
|
signing_key:
|
220
220
|
specification_version: 4
|
221
221
|
summary: configuration library
|