Class: ZAWS::Helper::Shell

Inherits:
Object
  • Object
show all
Defined in:
lib/zaws/helper/shell.rb

Instance Method Summary collapse

Instance Method Details

#cli(command, output = nil) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/zaws/helper/shell.rb', line 7

def cli(command,output=nil)
    output.puts ZAWS::Helper::Output.colorize(command,AWS_consts::COLOR_BLUE) if output
     list = Mixlib::ShellOut.new(command)
    list.run_command
    list.error!
    return list.stdout
end

#if_then(condition, command, output = nil) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/zaws/helper/shell.rb', line 15

def if_then(condition,command,output=nil)
    if not condition
 output.puts ZAWS::Helper::Output.colorize(command,AWS_consts::COLOR_BLUE) if output
 return nil   
    end
    return cli(command,output)
end