Class: VagrantPlugins::HostRubyProvisioner::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-host-ruby-provisioner/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



10
11
12
13
14
# File 'lib/vagrant-host-ruby-provisioner/config.rb', line 10

def initialize
  @clean   = UNSET_VALUE
  @cwd     = UNSET_VALUE
  @routine = UNSET_VALUE
end

Instance Attribute Details

#cleanObject

Returns the value of attribute clean.



6
7
8
# File 'lib/vagrant-host-ruby-provisioner/config.rb', line 6

def clean
  @clean
end

#cwdObject

Returns the value of attribute cwd.



7
8
9
# File 'lib/vagrant-host-ruby-provisioner/config.rb', line 7

def cwd
  @cwd
end

#routineObject

Returns the value of attribute routine.



8
9
10
# File 'lib/vagrant-host-ruby-provisioner/config.rb', line 8

def routine
  @routine
end

Instance Method Details

#finalize!Object



16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/vagrant-host-ruby-provisioner/config.rb', line 16

def finalize!
  if @clean == UNSET_VALUE
    @clean = lambda {}
  end

  if @cwd == UNSET_VALUE
    @cwd = nil
  end

  if @routine == UNSET_VALUE
    @routine = lambda {}
  end
end

#validate(machine) ⇒ Object



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/vagrant-host-ruby-provisioner/config.rb', line 30

def validate machine
  errors  = _detected_errors
  results = {}

  if ! @clean.lambda?
    errors << (I18n.t :'vagrant_host_ruby_provisioner.config.clean.not_lambda')
  end

  if ! @routine.lambda?
    errors << (I18n.t :'vagrant_host_ruby_provisioner.config.routine.not_lambda')
  end

  results[HostRubyProvisioner::INFO[:name]] = errors

  results
end