Class: VagrantPlugins::ChefZero::Config
- Inherits:
-
Object
- Object
- VagrantPlugins::ChefZero::Config
- Defined in:
- lib/vagrant-chef-zero/config.rb
Instance Attribute Summary collapse
-
#chef_repo_path ⇒ String
Path to a chef repo.
-
#cookbooks ⇒ String
Path to cookbooks.
-
#data_bags ⇒ String
Path to data bag fixtures.
-
#enabled ⇒ TrueClass, FalseClass
Is the plugin enabled?.
-
#environments ⇒ String
Path to environment fixtures.
-
#nodes ⇒ String
Path to node fixtures.
-
#roles ⇒ String
Path to role fixtures.
Instance Method Summary collapse
- #finalize! ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #path_exists?(path) ⇒ Boolean
- #validate(machine) ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
52 53 54 55 56 57 58 59 60 |
# File 'lib/vagrant-chef-zero/config.rb', line 52 def initialize @chef_repo_path = UNSET_VALUE @roles = UNSET_VALUE @environments = UNSET_VALUE @nodes = UNSET_VALUE @cookbooks = UNSET_VALUE @data_bags = UNSET_VALUE @enabled = UNSET_VALUE end |
Instance Attribute Details
#chef_repo_path ⇒ String
Path to a chef repo
40 41 42 |
# File 'lib/vagrant-chef-zero/config.rb', line 40 def chef_repo_path @chef_repo_path end |
#cookbooks ⇒ String
Path to cookbooks
25 26 27 |
# File 'lib/vagrant-chef-zero/config.rb', line 25 def cookbooks @cookbooks end |
#data_bags ⇒ String
Path to data bag fixtures
30 31 32 |
# File 'lib/vagrant-chef-zero/config.rb', line 30 def data_bags @data_bags end |
#enabled ⇒ TrueClass, FalseClass
Is the plugin enabled?
35 36 37 |
# File 'lib/vagrant-chef-zero/config.rb', line 35 def enabled @enabled end |
#environments ⇒ String
Path to environment fixtures
15 16 17 |
# File 'lib/vagrant-chef-zero/config.rb', line 15 def environments @environments end |
#nodes ⇒ String
Path to node fixtures
20 21 22 |
# File 'lib/vagrant-chef-zero/config.rb', line 20 def nodes @nodes end |
#roles ⇒ String
Path to role fixtures
10 11 12 |
# File 'lib/vagrant-chef-zero/config.rb', line 10 def roles @roles end |
Instance Method Details
#finalize! ⇒ Object
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/vagrant-chef-zero/config.rb', line 70 def finalize! @enabled = true if @enabled == UNSET_VALUE @roles = nil if @roles == UNSET_VALUE @roles = (@roles) if @roles @environments = nil if @environments == UNSET_VALUE @environments = (@environments) if @environments @nodes = nil if @nodes == UNSET_VALUE @nodes = (@nodes) if @nodes @cookbooks = nil if @cookbooks == UNSET_VALUE @cookbooks = (@cookbooks) if @cookbooks @data_bags = nil if @data_bags == UNSET_VALUE @data_bags = (@data_bags) if @data_bags @chef_repo_path = nil if @chef_repo_path == UNSET_VALUE {} end |
#path_exists?(path) ⇒ Boolean
66 67 68 |
# File 'lib/vagrant-chef-zero/config.rb', line 66 def path_exists?(path) File.directory? path end |
#validate(machine) ⇒ Object
62 63 64 |
# File 'lib/vagrant-chef-zero/config.rb', line 62 def validate(machine) { "Chef Zero" => [] } end |