complex_config 0.19.1 → 0.19.2

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: fe5832112e279c1bdadad2c91d5ba3c6872dbbead84955e46afb93ed317ea254
4
- data.tar.gz: f71125155654cec752772eed831ec0224f35a4a164c8bb98bbd1c9ce44c2969e
3
+ metadata.gz: 3486d5210e50100d17dea40922e6958c06898ba4ec70d3830b58b50160ecdeba
4
+ data.tar.gz: ee463ae5164fee75e2a4454b1176b1d31903026924297aca8371814cf6e1649d
5
5
  SHA512:
6
- metadata.gz: ed5d657e1335598d5794412dc9a802a5e2c99be3c53d36d788d969bdc84c14bb69bb7cea1e933d05fd090c93eb061eb6c8a779db0d4e29212cc59345d7a69f7c
7
- data.tar.gz: c1e88b402088da14ac41850160a05651a9f59618199dc886fe932e579b4052eab48f05fa0d241600616d395a117732a6a46598e2ea475e2b965b04b20837b5e2
6
+ metadata.gz: 6ea338ae3b2f8b9ea408d0a2e439afd14f21ba29937f82d33d01f3db6c155513e16108d3647345e3c05031c6ba06433ab9db7d626ba5be427758be6ad51f1981
7
+ data.tar.gz: 3cba305f3824ff5da2592283ce698ff7f06d28fe1c9c61caabd6fc77c7f0601664a7a4213bf8b47a14adb88bdb29ee43a44b4220ca9305b441678905d94c2b77
data/.tool-versions CHANGED
@@ -1 +1 @@
1
- ruby 3.0.1
1
+ ruby 3.0.2
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.19.1
1
+ 0.19.2
@@ -1,23 +1,23 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: complex_config 0.19.1 ruby lib
2
+ # stub: complex_config 0.19.2 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "complex_config".freeze
6
- s.version = "0.19.1"
6
+ s.version = "0.19.2"
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 = "2021-04-09"
11
+ s.date = "2021-10-28"
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]
15
15
  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/key_source.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
- s.files = [".gitignore".freeze, ".rspec".freeze, ".tool-versions".freeze, ".travis.yml".freeze, ".utilsrc".freeze, "COPYING".freeze, "Gemfile".freeze, "README.md".freeze, "Rakefile".freeze, "VERSION".freeze, "bin/complex_config".freeze, "complex_config.gemspec".freeze, "config/products.yml".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/key_source.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, "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/config/broken_config.yml".freeze, "spec/config/config.yml".freeze, "spec/config/master.key".freeze, "spec/config/with-key-file.yml.enc".freeze, "spec/config/with-key-file.yml.key".freeze, "spec/config/without-key-file.yml.enc".freeze, "spec/spec_helper.rb".freeze]
16
+ s.files = [".gitignore".freeze, ".rspec".freeze, ".tool-versions".freeze, ".travis.yml".freeze, ".utilsrc".freeze, "COPYING".freeze, "Gemfile".freeze, "README.md".freeze, "Rakefile".freeze, "VERSION".freeze, "bin/complex_config".freeze, "complex_config.gemspec".freeze, "config/products.yml".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/key_source.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, "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/config/broken_config.yml".freeze, "spec/config/config.yml".freeze, "spec/config/config_with_alias.yml".freeze, "spec/config/master.key".freeze, "spec/config/with-key-file.yml.enc".freeze, "spec/config/with-key-file.yml.key".freeze, "spec/config/without-key-file.yml.enc".freeze, "spec/spec_helper.rb".freeze]
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.2.15".freeze
20
+ s.rubygems_version = "3.2.22".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
 
@@ -99,7 +99,12 @@ class ComplexConfig::Provider
99
99
  "configuration file #{pathname.to_s.inspect} is missing"
100
100
  end
101
101
  results = datas.map { |d| evaluate(pathname, d) }
102
- hashes = results.map { |r| ::YAML.load(r, pathname) }
102
+ hashes =
103
+ if ::Psych::VERSION < "4"
104
+ results.map { |r| ::YAML.load(r, pathname) }
105
+ else
106
+ results.map { |r| ::YAML.load(r, filename: pathname, aliases: true) }
107
+ end
103
108
  settings = ComplexConfig::Settings.build(name, hashes.shift)
104
109
  hashes.each { |h| settings.attributes_update(h) }
105
110
  if shared = settings.shared?
@@ -1,6 +1,6 @@
1
1
  module ComplexConfig
2
2
  # ComplexConfig version
3
- VERSION = '0.19.1'
3
+ VERSION = '0.19.2'
4
4
  VERSION_ARRAY = VERSION.split('.').map(&:to_i) # :nodoc:
5
5
  VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc:
6
6
  VERSION_MINOR = VERSION_ARRAY[1] # :nodoc:
@@ -269,6 +269,18 @@ RSpec.describe ComplexConfig::Provider do
269
269
  end
270
270
  end
271
271
 
272
+ context 'handling configuration files with aliases (considered unsafe)' do
273
+ before do
274
+ described_class.config_dir = Pathname.new(__FILE__) + '../../config'
275
+ end
276
+
277
+ it 'reads yaml files with aliases just fine' do
278
+ expect(
279
+ described_class.config(asset('config_with_alias.yml')).specific.extended
280
+ ).to be true
281
+ end
282
+ end
283
+
272
284
  context 'evaluating configuration files with ERB' do
273
285
  it 'evaluates a config file correctly' do
274
286
  expect(
@@ -0,0 +1,6 @@
1
+ common: &common
2
+ extended: true
3
+
4
+ specific:
5
+ <<: *common
6
+ foo: true
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.19.1
4
+ version: 0.19.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: 2021-04-09 00:00:00.000000000 Z
11
+ date: 2021-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gem_hadar
@@ -192,6 +192,7 @@ files:
192
192
  - spec/complex_config/shortcuts_spec.rb
193
193
  - spec/config/broken_config.yml
194
194
  - spec/config/config.yml
195
+ - spec/config/config_with_alias.yml
195
196
  - spec/config/master.key
196
197
  - spec/config/with-key-file.yml.enc
197
198
  - spec/config/with-key-file.yml.key
@@ -220,7 +221,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
220
221
  - !ruby/object:Gem::Version
221
222
  version: '0'
222
223
  requirements: []
223
- rubygems_version: 3.2.15
224
+ rubygems_version: 3.2.22
224
225
  signing_key:
225
226
  specification_version: 4
226
227
  summary: configuration library