Class: Amigrind::Blueprints::Provisioners::LocalShell

Inherits:
Amigrind::Blueprints::Provisioner show all
Defined in:
lib/amigrind/blueprints/provisioners/local_shell.rb

Instance Method Summary collapse

Methods inherited from Amigrind::Blueprints::Provisioner

#racker_name

Instance Method Details

#command=(cmd) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/amigrind/blueprints/provisioners/local_shell.rb', line 7

def command=(cmd)
  raise "'command' must be a String or an array of String." \
    unless cmd.is_a?(String) ||
           (cmd.respond_to?(:all?) && cmd.all? { |l| l.is_a?(String) })

  if cmd.is_a?(String)
    @inline = cmd.split("\n")
  else
    @inline = cmd
  end
end

#to_racker_hashObject



19
20
21
22
23
24
# File 'lib/amigrind/blueprints/provisioners/local_shell.rb', line 19

def to_racker_hash
  {
    type: 'shell-local',
    command: @inline.join("\n")
  }
end