Commit f911b927 authored by Antonio Terceiro's avatar Antonio Terceiro

Imported Upstream version 2.2.1

parent 3dcdee3e
......@@ -50,7 +50,7 @@ module Mixlib
# Pass Mixlib::Config.configure() a block, and it will yield itself
#
# === Parameters
# block<Block>:: A block that is called with self.configuration as the arugment.
# block<Block>:: A block that is called with self.configuration as the argument.
def configure(&block)
block.call(self.configuration)
end
......@@ -402,7 +402,7 @@ module Mixlib
# === Parameters
# symbol<Symbol>:: Name of the method (variable setter)
# value<Object>:: Value to be set in config hash
#
#
def internal_set(symbol,value)
if configurables.has_key?(symbol)
configurables[symbol].set(self.configuration, value)
......@@ -410,9 +410,9 @@ module Mixlib
config_contexts[symbol].restore(value)
else
if config_strict_mode == :warn
Chef::Log.warn("Setting unsupported config value #{method_name}..")
Chef::Log.warn("Setting unsupported config value #{symbol}.")
elsif config_strict_mode
raise UnknownConfigOptionError, "Cannot set unsupported config value #{method_name}."
raise UnknownConfigOptionError, "Cannot set unsupported config value #{symbol}."
end
configuration[symbol] = value
end
......
......@@ -19,7 +19,7 @@
module Mixlib
module Config
VERSION = "2.1.0"
VERSION = "2.2.1"
end
end
--- !ruby/object:Gem::Specification
name: mixlib-config
version: !ruby/object:Gem::Version
version: 2.1.0
version: 2.2.1
platform: ruby
authors:
- Opscode, Inc.
- Chef Software, Inc.
autorequire:
bindir: bin
cert_chain: []
date: 2013-12-05 00:00:00.000000000 Z
date: 2015-05-12 00:00:00.000000000 Z
dependencies:
- !ruby/object:Gem::Dependency
name: rake
requirement: !ruby/object:Gem::Requirement
requirements:
- - '>='
- - ">="
- !ruby/object:Gem::Version
version: '0'
type: :development
prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - '>='
- - ">="
- !ruby/object:Gem::Version
version: '0'
- !ruby/object:Gem::Dependency
name: rspec
requirement: !ruby/object:Gem::Requirement
requirements:
- - '>='
- - "~>"
- !ruby/object:Gem::Version
version: '0'
version: '2.99'
type: :development
prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - '>='
- - "~>"
- !ruby/object:Gem::Version
version: '0'
version: '2.99'
- !ruby/object:Gem::Dependency
name: rdoc
requirement: !ruby/object:Gem::Requirement
requirements:
- - '>='
- - ">="
- !ruby/object:Gem::Version
version: '0'
type: :development
prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - '>='
- - ">="
- !ruby/object:Gem::Version
version: '0'
description: A class based configuration library
email: info@opscode.com
email: legal@chef.io
executables: []
extensions: []
extra_rdoc_files:
......@@ -64,16 +64,17 @@ files:
- NOTICE
- README.md
- Rakefile
- lib/mixlib/config.rb
- lib/mixlib/config/configurable.rb
- lib/mixlib/config/reopened_config_context_with_configurable_error.rb
- lib/mixlib/config/reopened_configurable_with_config_context_error.rb
- lib/mixlib/config/unknown_config_option_error.rb
- lib/mixlib/config/version.rb
- lib/mixlib/config.rb
- spec/mixlib/config_spec.rb
- spec/spec_helper.rb
homepage: http://www.opscode.com
licenses: []
homepage: http://www.chef.io
licenses:
- Apache-2.0
metadata: {}
post_install_message:
rdoc_options: []
......@@ -81,17 +82,17 @@ require_paths:
- lib
required_ruby_version: !ruby/object:Gem::Requirement
requirements:
- - '>='
- - ">="
- !ruby/object:Gem::Version
version: '0'
required_rubygems_version: !ruby/object:Gem::Requirement
requirements:
- - '>='
- - ">="
- !ruby/object:Gem::Version
version: '0'
requirements: []
rubyforge_project:
rubygems_version: 2.0.3
rubygems_version: 2.4.5
signing_key:
specification_version: 4
summary: A class based configuration library
......
......@@ -102,23 +102,23 @@ describe Mixlib::Config do
end
it "raises an error when you get an arbitrary config option with .y" do
lambda { StrictClass.y }.should raise_error(Mixlib::Config::UnknownConfigOptionError)
lambda { StrictClass.y }.should raise_error(Mixlib::Config::UnknownConfigOptionError, "Reading unsupported config value y.")
end
it "raises an error when you get an arbitrary config option with [:y]" do
lambda { StrictClass[:y] }.should raise_error(Mixlib::Config::UnknownConfigOptionError)
lambda { StrictClass[:y] }.should raise_error(Mixlib::Config::UnknownConfigOptionError, "Reading unsupported config value y.")
end
it "raises an error when you set an arbitrary config option with .y = 10" do
lambda { StrictClass.y = 10 }.should raise_error(Mixlib::Config::UnknownConfigOptionError)
lambda { StrictClass.y = 10 }.should raise_error(Mixlib::Config::UnknownConfigOptionError, "Cannot set unsupported config value y.")
end
it "raises an error when you get an arbitrary config option with .y 10" do
lambda { StrictClass.y 10 }.should raise_error(Mixlib::Config::UnknownConfigOptionError)
it "raises an error when you set an arbitrary config option with .y 10" do
lambda { StrictClass.y 10 }.should raise_error(Mixlib::Config::UnknownConfigOptionError, "Cannot set unsupported config value y.")
end
it "raises an error when you get an arbitrary config option with [:y] = 10" do
lambda { StrictClass[:y] = 10 }.should raise_error(Mixlib::Config::UnknownConfigOptionError)
it "raises an error when you set an arbitrary config option with [:y] = 10" do
lambda { StrictClass[:y] = 10 }.should raise_error(Mixlib::Config::UnknownConfigOptionError, "Cannot set unsupported config value y.")
end
end
......@@ -225,7 +225,7 @@ describe Mixlib::Config do
raise NopeError, "NOPE"
end
end
it 'Normal classes call the extra method' do
normal_class = Class.new
normal_class.extend(::Mixlib::Config)
......@@ -887,7 +887,7 @@ describe Mixlib::Config do
end
it "The nested class does not allow you to set arbitrary config options" do
lambda { StrictClass2.c.y = 10 }.should raise_error(Mixlib::Config::UnknownConfigOptionError)
lambda { StrictClass2.c.y = 10 }.should raise_error(Mixlib::Config::UnknownConfigOptionError, "Cannot set unsupported config value y.")
end
end
......@@ -900,11 +900,11 @@ describe Mixlib::Config do
end
it "The parent class does not allow you to set arbitrary config options" do
lambda { StrictClass3.y = 10 }.should raise_error(Mixlib::Config::UnknownConfigOptionError)
lambda { StrictClass3.y = 10 }.should raise_error(Mixlib::Config::UnknownConfigOptionError, "Cannot set unsupported config value y.")
end
it "The nested class does not allow you to set arbitrary config options" do
lambda { StrictClass3.y = 10 }.should raise_error(Mixlib::Config::UnknownConfigOptionError)
lambda { StrictClass3.y = 10 }.should raise_error(Mixlib::Config::UnknownConfigOptionError, "Cannot set unsupported config value y.")
end
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment