Sha256: a0ec04f0ffa3e097b1a17804daf365dc64b2a62760fec6d047749fb05e67354e
Contents?: true
Size: 591 Bytes
Versions: 15
Compression:
Stored size: 591 Bytes
Contents
# frozen_string_literal: true require "open3" module Jekyll 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
15 entries across 15 versions & 1 rubygems