Class: Vagrant::ChefConfig::Config
- Inherits:
-
Object
- Object
- Vagrant::ChefConfig::Config
- Defined in:
- lib/vagrant-chefconfig/config.rb
Instance Attribute Summary collapse
-
#enabled ⇒ Object
Returns the value of attribute enabled.
-
#knife_config_path ⇒ Object
Returns the value of attribute knife_config_path.
Instance Method Summary collapse
- #finalize! ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #validate(machine) ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
7 8 9 10 11 |
# File 'lib/vagrant-chefconfig/config.rb', line 7 def initialize super @enabled = UNSET_VALUE @knife_config_path = UNSET_VALUE end |
Instance Attribute Details
#enabled ⇒ Object
Returns the value of attribute enabled.
4 5 6 |
# File 'lib/vagrant-chefconfig/config.rb', line 4 def enabled @enabled end |
#knife_config_path ⇒ Object
Returns the value of attribute knife_config_path.
5 6 7 |
# File 'lib/vagrant-chefconfig/config.rb', line 5 def knife_config_path @knife_config_path end |
Instance Method Details
#finalize! ⇒ Object
13 14 15 16 |
# File 'lib/vagrant-chefconfig/config.rb', line 13 def finalize! @enabled = true if @enabled == UNSET_VALUE @knife_config_path = nil if @knife_config_path == UNSET_VALUE end |
#validate(machine) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/vagrant-chefconfig/config.rb', line 18 def validate(machine) errors =[] if @enabled if @knife_config_path && !File.exists?(@knife_config_path) errors << "chefconfig.knife_config_path file '#{@knife_config_path}' not found" end end { "chefconfig" => errors } end |