mixlib-config 3.0.5 → 3.0.27

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 542f1c9f7daff1297b70799397e6f44dba7896522e89334e71496db690802013
4
- data.tar.gz: f2383ad0c71049dab95ceeac81d39d7b8ed1d8cb2e9a6ed45ac29acaa0d63838
3
+ metadata.gz: 244c4985aca98893235fd40849494fffac378dfc1e3814c99eeb2315fb378d38
4
+ data.tar.gz: 616f2fff1b715bdd98451cabbcc97c1f41bfcbef2fd9c1196548fe59070ece73
5
5
  SHA512:
6
- metadata.gz: d4137a9a0747261ad42cc1f3035ab6136823ee3c89666e7adf041e36190cd24179e0eee5711686011ab7c1e7efead2242aef88c6f9c0e03bfee8ef41509492be
7
- data.tar.gz: 22248d0a227c55598fa81debb29a0eaa9436d27192bfbd45beb091b0ace555b4abd4783f09ef7c1febca965b386320268dada9fe5f45a94485cc266695144a9b
6
+ metadata.gz: 9d83d13b43d723dc8f516d525388d2d089859fbd8d98ba2ca8d6910af64c75a4e9749daea1c3399da9b7bdc7058a78e38e517a5a149bcf2b0ff2810fc98c51c6
7
+ data.tar.gz: 33edd2c26ac7be09708384a2113d2087861a3d43f1b2b9d185367a5247098d1b6df7dbf13a41e7bcf5fd9279a908cef11362c52fdfd15aa21ebef201ca653a38
@@ -19,7 +19,7 @@
19
19
  module Mixlib
20
20
  module Config
21
21
 
22
- VERSION = "3.0.5".freeze
22
+ VERSION = "3.0.27".freeze
23
23
 
24
24
  end
25
25
  end
data/lib/mixlib/config.rb CHANGED
@@ -18,11 +18,11 @@
18
18
  # limitations under the License.
19
19
  #
20
20
 
21
- require "mixlib/config/version"
22
- require "mixlib/config/configurable"
23
- require "mixlib/config/unknown_config_option_error"
24
- require "mixlib/config/reopened_config_context_with_configurable_error"
25
- require "mixlib/config/reopened_configurable_with_config_context_error"
21
+ require_relative "config/version"
22
+ require_relative "config/configurable"
23
+ require_relative "config/unknown_config_option_error"
24
+ require_relative "config/reopened_config_context_with_configurable_error"
25
+ require_relative "config/reopened_configurable_with_config_context_error"
26
26
 
27
27
  module Mixlib
28
28
  module Config
@@ -69,7 +69,7 @@ module Mixlib
69
69
  # === Parameters
70
70
  # filename<String>:: A filename to read from
71
71
  def from_yaml(filename)
72
- require "yaml"
72
+ require "yaml" unless defined?(YAML)
73
73
  from_hash(YAML.load(IO.read(filename)))
74
74
  end
75
75
 
@@ -78,12 +78,12 @@ module Mixlib
78
78
  # === Parameters
79
79
  # filename<String>:: A filename to read from
80
80
  def from_json(filename)
81
- require "json"
81
+ require "json" unless defined?(JSON)
82
82
  from_hash(JSON.parse(IO.read(filename)))
83
83
  end
84
84
 
85
85
  def from_toml(filename)
86
- require "tomlrb"
86
+ require "tomlrb" unless defined?(Tomlrb)
87
87
  from_hash(Tomlrb.parse(IO.read(filename), symbolize_keys: true))
88
88
  end
89
89
 
@@ -565,10 +565,13 @@ module Mixlib
565
565
  # the #to_dotted_hash method above.
566
566
  #
567
567
  # === Parameters
568
- # hash<Hash>:: The hash to apply to the config oject
568
+ # hash<Hash>:: The hash to apply to the config object
569
569
  def apply_nested_hash(hash)
570
570
  hash.each do |k, v|
571
- if v.is_a? Hash
571
+ if v.is_a?(Hash) && internal_get(k.to_sym).is_a?(Hash)
572
+ # If it is a plain config key (not a context) and the value is a Hash, plain merge the Hashes.
573
+ internal_set(k.to_sym, internal_get(k.to_sym).merge(v))
574
+ elsif v.is_a? Hash
572
575
  # If loading from hash, and we reference a context that doesn't exist
573
576
  # and warning/strict is off, we need to create the config context that we expected to be here.
574
577
  context = internal_get(k.to_sym) || config_context(k.to_sym)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mixlib-config
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.5
4
+ version: 3.0.27
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chef Software, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-14 00:00:00.000000000 Z
11
+ date: 2022-06-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tomlrb
@@ -50,14 +50,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
50
50
  requirements:
51
51
  - - ">="
52
52
  - !ruby/object:Gem::Version
53
- version: '2.4'
53
+ version: '2.5'
54
54
  required_rubygems_version: !ruby/object:Gem::Requirement
55
55
  requirements:
56
56
  - - ">="
57
57
  - !ruby/object:Gem::Version
58
58
  version: '0'
59
59
  requirements: []
60
- rubygems_version: 3.0.3
60
+ rubygems_version: 3.1.4
61
61
  signing_key:
62
62
  specification_version: 4
63
63
  summary: A class based configuration library