require'open3'moduleGitlabmoduleGitmodulePopendefpopen(cmd,path)unlesscmd.is_a?(Array)raise"System commands must be given as an array of strings"endvars={"PWD"=>path}options={chdir: path}@cmd_output=""@cmd_status=0Open3.popen3(vars,*cmd,options)do|stdin,stdout,stderr,wait_thr|@cmd_output<<stdout.read@cmd_output<<stderr.read@cmd_status=wait_thr.value.exitstatusend[@cmd_output,@cmd_status]endendendend