lib/heathen/executioner.rb
# Executes the given argument vector with Open3.popen3.
# Returns the pid and exit status as Numeric, stdout and
# stderr as Strings.
#
Executes the given argument vector with Open3.popen3.
Returns the pid and exit status as Numeric, stdout and
stderr as Strings.
Executes the given argument vector with Open3 . popen3 . Returns the pid and exit status as Numeric stdout and stderr as Strings .
def _execute(*argv, options)
        command = argv.shift
        Open3.popen3(ENV, [ command, "heathen: #{command}" ], *argv,
          :chdir => options[:dir] || Dir.getwd
        ) do |stdin, stdout, stderr, wait_thr|
          pid = wait_thr[:pid]
          logger.info "[#{pid}] spawn '#{command} #{argv.join(' ')}'"
          stdin.close
          if options[:binary]
            stdout.binmode
            stderr.binmode
          end
          out = Thread.new { stdout.read }.value
          err = Thread.new { stderr.read }.value
          [pid, wait_thr.value, out, err]
        end
      end
def _execute ( * argv , options ) command = argv . shift Open3 . popen3 ( ENV , [ command , "heathen: #{command}" ] , * argv , :chdir => options [ :dir ] || Dir . getwd ) do | stdin , stdout , stderr , wait_thr | pid = wait_thr [ :pid ] logger . info "[#{pid}] spawn '#{command} #{argv.join(' ')}'" stdin . close if options [ :binary ] stdout . binmode stderr . binmode end out = Thread . new { stdout . read } . value err = Thread . new { stderr . read } . value [ pid , wait_thr . value , out , err ] end end
Executes the given argument vector with Open3.popen3.
Executes the given argument vector with Open3 . popen3 .
argv
<not_specific>
options
<not_specific>