mixlib-config 2.2.6 → 2.2.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +1 -3
- data/lib/mixlib/config.rb +2 -2
- data/lib/mixlib/config/version.rb +1 -1
- data/spec/mixlib/config_spec.rb +20 -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: bd2cc6254a399be141db6b72daddba468d83d44d4e1b7760478c1df52a3308a8
|
4
|
+
data.tar.gz: 74c5a3f6dbcfa33219b45d3228dd0f9edda3e9a61edcb67f78e30f8631c934ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 #{
|
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
|
data/lib/mixlib/config.rb
CHANGED
@@ -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?(
|
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?(
|
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
|
|
data/spec/mixlib/config_spec.rb
CHANGED
@@ -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.
|
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-
|
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.
|
125
|
+
rubygems_version: 2.7.6
|
126
126
|
signing_key:
|
127
127
|
specification_version: 4
|
128
128
|
summary: A class based configuration library
|