Sha256: 9a9d15f1ff8bd07fafd345f9bcab0feee948c8e60c89a22bd044cbae2f8aeb25
Contents?: true
Size: 563 Bytes
Versions: 77
Compression:
Stored size: 563 Bytes
Contents
require "open3" module J1 module Utils module Exec extend self # Runs a program in a sub-shell. # # *args - a list of strings containing the program name and arguments # # Returns a Process::Status and a String of output in an array in # that order. def run(*args) stdin, stdout, stderr, process = Open3.popen3(*args) out = stdout.read.strip err = stderr.read.strip [stdin, stdout, stderr].each(&:close) [process.value, out + ';' + err] end end end end
Version data entries
77 entries across 77 versions & 1 rubygems