mixlib-config 2.2.6 → 2.2.8

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: df81f1268299346629241aff765fad4fcb4e458fe9eaa810a187a6dd1397b3d5
4
- data.tar.gz: 1fb4968f38fef4c1f8b78baf4e9516e8295803b68778eb259698db4b094d998e
3
+ metadata.gz: bd2cc6254a399be141db6b72daddba468d83d44d4e1b7760478c1df52a3308a8
4
+ data.tar.gz: 74c5a3f6dbcfa33219b45d3228dd0f9edda3e9a61edcb67f78e30f8631c934ce
5
5
  SHA512:
6
- metadata.gz: e0576c33521eafd4f4a3db47704536c491da50f98ca3052fcbba06e28cbf87d8f865ddee060694e4931e7369e7250bf70793c78362e9ca3d29b6f1aee4c12007
7
- data.tar.gz: 46d0dcb314b8840048d16692fedec257a7871fcd9ff2b2859fa888af35c602e0e25a63d6f2a21f1b4cee36b5825d0b001e3a745a31f2484d63e626566120225e
6
+ metadata.gz: 19fdc395724a60b15393c6e394bcdbd556fc435524337ba97d87cf91ef10d5f1947d227f5c822e38c4e50a570a8ddca0701289e50a049fd268a0654db3e2e625
7
+ data.tar.gz: 9d54097e31e016cbeadfa3f6a02e70b3aec9500cfadaa841717e42bc42f36b9e0bd7b1c22febd2bb42166c56b2425c883faf34c93efec20b0702e8646ce0e381
data/Rakefile CHANGED
@@ -14,8 +14,6 @@ RSpec::Core::RakeTask.new(:spec) do |spec|
14
14
  spec.pattern = "spec/**/*_spec.rb"
15
15
  end
16
16
 
17
- gem_spec = eval(File.read("mixlib-config.gemspec"))
18
-
19
17
  begin
20
18
  require "chefstyle"
21
19
  require "rubocop/rake_task"
@@ -28,7 +26,7 @@ end
28
26
 
29
27
  RDoc::Task.new do |rdoc|
30
28
  rdoc.rdoc_dir = "rdoc"
31
- rdoc.title = "mixlib-config #{gem_spec.version}"
29
+ rdoc.title = "mixlib-config #{Mixlib::Config::VERSION}"
32
30
  rdoc.rdoc_files.include("README*")
33
31
  rdoc.rdoc_files.include("lib/**/*.rb")
34
32
  end
@@ -436,7 +436,7 @@ module Mixlib
436
436
  # block<Block>: a block that will be run in the context of this new config
437
437
  # class.
438
438
  def config_context_list(plural_symbol, singular_symbol, &block)
439
- if configurables.has_key?(symbol)
439
+ if configurables.has_key?(plural_symbol)
440
440
  raise ReopenedConfigurableWithConfigContextError, "Cannot redefine config value #{plural_symbol} with a config context"
441
441
  end
442
442
 
@@ -468,7 +468,7 @@ module Mixlib
468
468
  # block<Block>: a block that will be run in the context of this new config
469
469
  # class.
470
470
  def config_context_hash(plural_symbol, singular_symbol, &block)
471
- if configurables.has_key?(symbol)
471
+ if configurables.has_key?(plural_symbol)
472
472
  raise ReopenedConfigurableWithConfigContextError, "Cannot redefine config value #{plural_symbol} with a config context"
473
473
  end
474
474
 
@@ -19,7 +19,7 @@
19
19
  module Mixlib
20
20
  module Config
21
21
 
22
- VERSION = "2.2.6"
22
+ VERSION = "2.2.8"
23
23
 
24
24
  end
25
25
  end
@@ -115,6 +115,26 @@ describe Mixlib::Config do
115
115
  it "raises an error when you set an arbitrary config option with [:y] = 10" do
116
116
  expect(lambda { StrictClass[:y] = 10 }).to raise_error(Mixlib::Config::UnknownConfigOptionError, "Cannot set unsupported config value y.")
117
117
  end
118
+
119
+ it "does not break config_context_list" do
120
+ expect(lambda do
121
+ StrictClass.class_eval do
122
+ config_context_list(:lists, :list) do
123
+ default :y, 20
124
+ end
125
+ end
126
+ end).not_to raise_error
127
+ end
128
+
129
+ it "does not break config_context_hash" do
130
+ expect(lambda do
131
+ StrictClass.class_eval do
132
+ config_context_hash(:hashes, :hash) do
133
+ default :z, 20
134
+ end
135
+ end
136
+ end).not_to raise_error
137
+ end
118
138
  end
119
139
 
120
140
  describe "when a block has been used to set config values" do
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: 2.2.6
4
+ version: 2.2.8
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: 2018-03-01 00:00:00.000000000 Z
11
+ date: 2018-06-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tomlrb
@@ -122,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
122
122
  version: '0'
123
123
  requirements: []
124
124
  rubyforge_project:
125
- rubygems_version: 2.7.4
125
+ rubygems_version: 2.7.6
126
126
  signing_key:
127
127
  specification_version: 4
128
128
  summary: A class based configuration library