Class: VagrantSpec::Config::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant_spec/config/base.rb

Overview

This class handles the configuration options in the Vagrantfile

Constant Summary collapse

DEFAULTS =
VagrantSpec::Config::DEFAULTS

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeBase

Returns a new instance of Base.



15
16
17
18
19
# File 'lib/vagrant_spec/config/base.rb', line 15

def initialize
  @directory         = UNSET_VALUE
  @ansible_inventory = UNSET_VALUE
  @test_plan         = UNSET_VALUE
end

Instance Attribute Details

#ansible_inventoryObject

Returns the value of attribute ansible_inventory.



12
13
14
# File 'lib/vagrant_spec/config/base.rb', line 12

def ansible_inventory
  @ansible_inventory
end

#directoryObject

Returns the value of attribute directory.



11
12
13
# File 'lib/vagrant_spec/config/base.rb', line 11

def directory
  @directory
end

#test_planObject

Returns the value of attribute test_plan.



13
14
15
# File 'lib/vagrant_spec/config/base.rb', line 13

def test_plan
  @test_plan
end

Instance Method Details

#final_ansible_inventoryObject



25
26
27
28
29
# File 'lib/vagrant_spec/config/base.rb', line 25

def final_ansible_inventory
  if @ansible_inventory == UNSET_VALUE
    @ansible_inventory = DEFAULTS['ansible_inventory']
  end
end

#final_directoryObject



21
22
23
# File 'lib/vagrant_spec/config/base.rb', line 21

def final_directory
  @directory = DEFAULTS['directory'] if @directory == UNSET_VALUE
end

#final_test_planObject



31
32
33
# File 'lib/vagrant_spec/config/base.rb', line 31

def final_test_plan
  @test_plan = DEFAULTS['test_plan'] if @test_plan == UNSET_VALUE
end

#finalize!Object



35
36
37
38
39
# File 'lib/vagrant_spec/config/base.rb', line 35

def finalize!
  final_directory
  final_ansible_inventory
  final_test_plan
end