Sha256: cbb11cca2a33dcd3fbeb4f3d7fb6760b21b964cf6296d23c10f65c4b70eadf32
Contents?: true
Size: 600 Bytes
Versions: 70
Compression:
Stored size: 600 Bytes
Contents
require 'open3' module Gitlab module Git module Popen def popen(cmd, path) unless cmd.is_a?(Array) raise "System commands must be given as an array of strings" end vars = { "PWD" => path } options = { chdir: path } @cmd_output = "" @cmd_status = 0 Open3.popen3(vars, *cmd, options) do |stdin, stdout, stderr, wait_thr| @cmd_output << stdout.read @cmd_output << stderr.read @cmd_status = wait_thr.value.exitstatus end [@cmd_output, @cmd_status] end end end end
Version data entries
70 entries across 70 versions & 1 rubygems