lib/mixlib/config.rb in mixlib-config-2.1.0 vs lib/mixlib/config.rb in mixlib-config-2.2.0
- old
+ new
@@ -48,11 +48,11 @@
end
# 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
# Get the value of a config option
@@ -90,13 +90,14 @@
# key<Symbol>:: The config option to check for
#
# === Returns
# <True>:: If the config option exists
# <False>:: If the config option does not exist
- def has_key?(key)
+ def key?(key)
self.configuration.has_key?(key.to_sym)
end
+ alias_method :has_key?, :key?
# Resets a config option to its default.
#
# === Parameters
# symbol<Symbol>:: Name of the config option
@@ -400,20 +401,20 @@
# Internal dispatch setter for config values.
#
# === 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)
elsif config_contexts.has_key?(symbol)
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
end