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.



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

def initialize
  @directory             = UNSET_VALUE
  @ansible_inventory     = UNSET_VALUE
  @test_plan             = UNSET_VALUE
  @generate_machine_data = 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

#generate_machine_dataObject

Returns the value of attribute generate_machine_data.



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

def generate_machine_data
  @generate_machine_data
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



27
28
29
30
31
# File 'lib/vagrant_spec/config/base.rb', line 27

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

#final_directoryObject



23
24
25
# File 'lib/vagrant_spec/config/base.rb', line 23

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

#final_generate_machine_dataObject



37
38
39
40
41
# File 'lib/vagrant_spec/config/base.rb', line 37

def final_generate_machine_data
  if @generate_machine_data == UNSET_VALUE
    @generate_machine_data = DEFAULTS['generate_machine_data']
  end
end

#final_test_planObject



33
34
35
# File 'lib/vagrant_spec/config/base.rb', line 33

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

#finalize!Object



43
44
45
46
47
48
# File 'lib/vagrant_spec/config/base.rb', line 43

def finalize!
  final_directory
  final_ansible_inventory
  final_test_plan
  final_generate_machine_data
end