Module: Exeggutor

Defined in:
lib/exeggutor.rb

Defined Under Namespace

Classes: ProcessError, ProcessHandle, ProcessResult

Class Method Summary collapse

Class Method Details

.run_popen3(args, env, chdir) ⇒ Object



136
137
138
139
140
141
142
143
144
145
# File 'lib/exeggutor.rb', line 136

def self.run_popen3(args, env, chdir)
  # Use this weird [args[0], args[0]] thing for the case where a command with just one arg is being run
  opts = {}
  opts[:chdir] = chdir if chdir
  if env
    Open3.popen3(env, [args[0], args[0]], *args.drop(1), opts)
  else
    Open3.popen3([args[0], args[0]], *args.drop(1), opts)
  end
end