Class: VagrantPlugins::Recipe::Config
- Inherits:
-
Object
- Object
- VagrantPlugins::Recipe::Config
- Defined in:
- lib/vagrant-recipe/config.rb
Instance Attribute Summary collapse
-
#bundler ⇒ Object
Returns the value of attribute bundler.
-
#chef ⇒ Object
Returns the value of attribute chef.
-
#env ⇒ Object
readonly
Returns the value of attribute env.
-
#json ⇒ Object
Returns the value of attribute json.
Instance Method Summary collapse
- #finalize! ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #validate(_) ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
10 11 12 13 14 15 |
# File 'lib/vagrant-recipe/config.rb', line 10 def initialize @env = {} @bundler = UNSET_VALUE @chef = UNSET_VALUE @json = UNSET_VALUE end |
Instance Attribute Details
#bundler ⇒ Object
Returns the value of attribute bundler.
6 7 8 |
# File 'lib/vagrant-recipe/config.rb', line 6 def bundler @bundler end |
#chef ⇒ Object
Returns the value of attribute chef.
7 8 9 |
# File 'lib/vagrant-recipe/config.rb', line 7 def chef @chef end |
#env ⇒ Object (readonly)
Returns the value of attribute env.
5 6 7 |
# File 'lib/vagrant-recipe/config.rb', line 5 def env @env end |
#json ⇒ Object
Returns the value of attribute json.
8 9 10 |
# File 'lib/vagrant-recipe/config.rb', line 8 def json @json end |
Instance Method Details
#finalize! ⇒ Object
25 26 27 28 29 |
# File 'lib/vagrant-recipe/config.rb', line 25 def finalize! @chef = '/tmp/vagrant-chef-1/solo.rb' if @chef == UNSET_VALUE @json = '/tmp/vagrant-chef-1/dna.json' if @json == UNSET_VALUE @bundler = false if @bundler == UNSET_VALUE end |
#validate(_) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/vagrant-recipe/config.rb', line 17 def validate(_) return { 'exec' => ['bundler should be boolean'] } unless [true, false].include?(@bundler) return { 'exec' => ['chef should be a string'] } unless @chef.is_a?(String) return { 'exec' => ['json should be a string'] } unless @json.is_a?(String) {} end |