Module: Whisk::Mixin::ShellOut

Included in:
Provider::Bowl, Provider::Ingredient
Defined in:
lib/whisk/mixin/shellout.rb

Instance Method Summary collapse

Instance Method Details

#run_command(*command_args) ⇒ Object



41
42
43
44
45
# File 'lib/whisk/mixin/shellout.rb', line 41

def run_command(*command_args)
  cmd = Mixlib::ShellOut.new(*command_args)
  cmd.run_command
  cmd
end

#run_command!(*command_args) ⇒ Object



47
48
49
50
51
# File 'lib/whisk/mixin/shellout.rb', line 47

def run_command!(*command_args)
  cmd = run_command(*command_args)
  cmd.error!
  cmd
end

#shell_out(*command_args) ⇒ Object



26
27
28
29
30
31
32
33
# File 'lib/whisk/mixin/shellout.rb', line 26

def shell_out(*command_args)
  cmd = Mixlib::ShellOut.new(*command_args)
  if STDOUT.tty?
    cmd.live_stream = STDOUT
  end
  cmd.run_command
  cmd
end

#shell_out!(*command_args) ⇒ Object



35
36
37
38
39
# File 'lib/whisk/mixin/shellout.rb', line 35

def shell_out!(*command_args)
  cmd = shell_out(*command_args)
  cmd.error!
  cmd
end