Open mmzyk opened 9 years ago
Would it also be useful to be able to specify whether a config option is required
? I'm picturing a similar system as how attributes
are defined in a Chef cookbook LWRP:
require 'mixlib/config'
class ValidatedConfig
# something like this?
configurable('string').required.is_a(String)
end
It should be possible to state the valid values for a config option and check that either the default value is used or that the option supplied is valid.
This would avoid issues such as the one seen here https://github.com/chef/chef/issues/1509 where cookbook_path was set to nil leading to odd errors.