Class: VagrantPlugins::ShellLocal::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-shell-local/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



5
6
7
# File 'lib/vagrant-shell-local/config.rb', line 5

def initialize
  @command = UNSET_VALUE
end

Instance Attribute Details

#commandObject

Returns the value of attribute command.



3
4
5
# File 'lib/vagrant-shell-local/config.rb', line 3

def command
  @command
end

Instance Method Details

#finalize!Object



9
10
11
# File 'lib/vagrant-shell-local/config.rb', line 9

def finalize!
  @command = nil if @inline == UNSET_VALUE
end

#validate(machine) ⇒ Object



13
14
15
16
17
18
19
20
21
# File 'lib/vagrant-shell-local/config.rb', line 13

def validate(machine)
  errors = _detected_errors

  unless command.is_a?(Array) || command.is_a?(String)
    errors << ':shell_local provisioner requires command to be set and be an array or a string'
  end

  { 'host shell provisioner' => errors }
end