Module: Tuxedo::Cli

Extended by:
Cli
Included in:
Cli
Defined in:
lib/tuxedo/cli.rb

Defined Under Namespace

Classes: CliResult

Instance Method Summary collapse

Instance Method Details

#sh(cmd) ⇒ Object



9
10
11
12
13
14
15
16
# File 'lib/tuxedo/cli.rb', line 9

def sh(cmd)
  Open3.popen3(cmd) do |stdin, stdout, stderr, wait_thr|
    pid = wait_thr.pid # pid of the started process.
    exit_status = wait_thr.value

    CliResult.new(stdout.read, stderr.read, exit_status)
  end
end