Sha256: 27c98eaae5232a0cb7e46d1bd7940b188890c75e75187471ae59ce4b189eaa46
Contents?: true
Size: 512 Bytes
Versions: 11
Compression:
Stored size: 512 Bytes
Contents
require 'open3' module Soaring class Executor def self.execute(command) captured_stdout = '' captured_stderr = '' exit_status = Open3.popen3(ENV, command) {|stdin, stdout, stderr, wait_thr| pid = wait_thr.pid # pid of the started process. stdin.close captured_stdout = stdout.read captured_stderr = stderr.read wait_thr.value # Process::Status object returned. } ["#{captured_stdout}#{captured_stderr}", exit_status] end end end
Version data entries
11 entries across 11 versions & 1 rubygems