summaryrefslogtreecommitdiff
path: root/lib/mixlib/config.rb
Commit message (Collapse)AuthorAgeFilesLines
* Fix in apply nested hash when passing hash in configNikita Mathur2022-06-021-1/+4
| | | | Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
* Fix another typoTim Smith2021-10-161-1/+1
| | | | Signed-off-by: Tim Smith <tsmith@chef.io>
* Optimize requires for non-omnibus installsrequiresTim Smith2020-08-121-3/+3
| | | | | | require is quite slow in Ruby and doing requires for things you've already required is also slow. We've used this simple hack in Chef to speed up our requires. In the omnibus installs we patch how rubygems works to make this somewhat pointless, but this will help non-omnibus installs Signed-off-by: Tim Smith <tsmith@chef.io>
* Substitute require for require_relativerelativeTim Smith2019-12-201-5/+5
| | | | | | require_relative is significantly faster and should be used when available. Signed-off-by: Tim Smith <tsmith@chef.io>
* Do not crash when loading undefined context from hashMarc A. Paradise2019-11-141-1/+4
| | | | | | | | | | | | | | When loading `from_hash` and with `strict_mode false`, a config context that is not defined will cause mixlib-config to crash. This is because we used `internal_get` without checking to see if the result was nil. nil occurs when the scenario above is met. Now, we will define the context when this happens, and continue to populate that context from the hash. Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
* Chefstyle fixesTim Smith2019-08-071-8/+10
| | | | Also add the badge to the readme
* Chefstyle fixes for the latest chefstyleTim Smith2018-12-061-21/+21
| | | | Signed-off-by: Tim Smith <tsmith@chef.io>
* test+fix config contextsLamont Granquist2018-07-111-17/+19
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Avoid converting to text representation when parsing JSON/TOML/etcLamont Granquist2018-07-111-16/+21
| | | | | | | Directly apply the config as we descend recursively through the Hash using internal_set/internal_get. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* remove debuggeratingLamont Granquist2018-07-051-2/+0
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* add is_default? inspection methodLamont Granquist2018-07-051-0/+11
| | | | | | plus some code cleanup of the configurable class Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* key? and has_key? should find subcontextsLamont Granquist2018-07-021-1/+1
| | | | | | | | | | | | | | when we have: config[:knife][:whatever] then: config.key?(:knife) should be true, not false. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* add `#key?` alias to `#has_key?`Lamont Granquist2018-07-021-2/+4
| | | | | | e.g. for rubocop Style/PreferredHashMethod Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Fix config_context_list/hash in strict modeEli Young2018-06-131-2/+2
| | | | Signed-off-by: Eli Young <elyscape@gmail.com>
* Adding support for reading from TOML filestyler-ball2018-02-281-0/+7
| | | | Signed-off-by: Tyler Ball <tball@chef.io>
* Add support for reading from JSON filesTom Duffield2018-02-091-0/+11
| | | | Signed-off-by: Tom Duffield <tom@chef.io>
* Add support for loading config from YAML filesTom Duffield2018-02-091-1/+55
| | | | Signed-off-by: Tom Duffield <tom@chef.io>
* fix chefstyle offensesLamont Granquist2017-06-201-18/+18
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Fix chefstyle bustagetm/re_chefstyleThom May2016-12-061-8/+8
| | | | Signed-off-by: Thom May <thom@chef.io>
* Add support for lists and hashes of context configsKierran McPherson2016-09-211-1/+162
|
* Merge pull request #42 from chef/hashThom May2016-09-021-1/+2
|\ | | | | Allow a config context to be set from another config context
| * allow a config context to be set from another config contexthashMatt Wrock2016-08-311-1/+2
| |
* | Merge pull request #35 from KierranM/context-blocksThom May2016-09-021-2/+12
|\ \ | |/ |/| Allow configuring contexts via block
| * Remove extraneous methodsKierran McPherson2016-08-131-10/+2
| |
| * Also allow yielding the contextKierran McPherson2016-08-131-1/+10
| |
| * Allow configuring contexts via blockKierran McPherson2016-08-131-2/+11
| |
* | restore by swapping in saved state instead of 'reset and merge'Matt Wrock2016-08-301-5/+9
| |
* | Opscode -> ChefTim Smith2016-08-231-4/+4
| | | | | | | | Signed-off-by: Tim Smith <tsmith@chef.io>
* | Correct new checkslcg/chefstyleThom May2016-08-111-2/+2
| | | | | | | | Signed-off-by: Thom May <thom@may.lt>
* | chefstyle fixesLamont Granquist2016-08-111-8/+8
|/
* Fix ruby warnings for access of undefined instance variabledanielsdeleo2015-05-261-0/+5
|
* Revert "Rename has_key? -> key? (BC compatible)"jdm/revertJay Mundrawala2015-05-121-2/+1
| | | | This reverts commit d4548e5c898a032c6751e25734371213a1b165c9.
* Fix strict mode errors to actually print symboljk/strict-errorJohn Keiser2014-09-091-4/+4
|
* Rename has_key? -> key? (BC compatible)Seth Vargo2014-06-031-1/+2
| | | Ruby has moved away from has_key?, so mixlib should as well.
* Fix example syntaxJohn Keiser2013-12-031-3/+4
|
* Add ability to reopen config_context, add setter for config_contextJohn Keiser2013-12-031-11/+40
|
* Add save/restore for tests/serializationJohn Keiser2013-12-021-8/+86
|
* Define explicit getter/setter methods for configurables instead of relying ↵John Keiser2013-09-171-32/+39
| | | | on missing_method
* Fix issue with Config['a'] = bJohn Keiser2013-09-161-1/+1
|
* Inherit config_strict_mode in child contextsJohn Keiser2013-09-131-4/+13
|
* Change config_strict_mode default back to falseJohn Keiser2013-09-111-2/+2
|
* Make config_strict_mode on by defaultJohn Keiser2013-09-111-2/+3
|
* Rename StrictModeError -> UnknownConfigOptionErrorJohn Keiser2013-09-111-7/+7
|
* Rename context to config_contextJohn Keiser2013-09-101-6/+6
|
* Add config_strict_mode to restrict set of options that can be setJohn Keiser2013-09-101-6/+87
|
* Add context() DSL for config classesJohn Keiser2013-09-091-0/+28
|
* Add configurable() DSL and resettable default valuesJohn Keiser2013-08-301-77/+98
|
* Add ability to handle default valuesJohn Keiser2013-08-271-0/+26
|
* Make "configure" still return underlying hashJohn Keiser2013-08-271-1/+1
|
* Update hash reference to avoid private sendsmethods-uber-allesdanielsdeleo2013-08-271-4/+9
|