Class Grit::Process
In: lib/grit/process.rb
lib/grit/jruby.rb
Parent: Object

Override the Grit::Process class‘s popen4 and waitpid methods to work around various quirks in JRuby.

Methods

new   popen4   success?   waitpid  

Classes and Modules

Class Grit::Process::MaximumOutputExceeded
Class Grit::Process::TimeoutExceeded

Constants

BUFSIZE = (32 * 1024)   Maximum buffer size for reading
FakeStatus = Struct.new(:pid, :exitstatus, :success?, :fake?)   JRuby always raises ECHILD on pids returned from its IO.popen4 method for some reason. Return a fake Process::Status object.

Attributes

err  [R]  All data written to the child process‘s stderr stream as a String.
out  [R]  All data written to the child process‘s stdout stream as a String.
runtime  [R]  Total command execution time (wall-clock time)
status  [R]  A Process::Status object with information on how the child exited.

Public Class methods

Create and execute a new process.

argv - Array of [command, arg1, …] strings to use as the new

          process's argv. When argv is a String, the shell is used
          to interpret the command.

env - The new process‘s environment variables. This is merged with

          the current environment as if by ENV.merge(env).

options - Additional options:

            :input   => str to write str to the process's stdin.
            :timeout => int number of seconds before we given up.
            :max     => total number of output bytes
          A subset of Process:spawn options are also supported on all
          platforms:
            :chdir => str to start the process in different working dir.

Returns a new Process instance that has already executed to completion. The out, err, and status attributes are immediately available.

Public Instance methods

Use JRuby‘s built in IO.popen4 but emulate the special spawn env and options arguments as best we can.

Determine if the process did exit with a zero exit status.

[Validate]