class Aruba::Processes::InProcess

@private
`#stdin`, ‘#stdout`.
users. Only it’s public methods are part of the public API of aruba, e.g.
‘InProcess` is not meant for direct use - `InProcess.new` - by
Run command in your ruby process

def self.match?(mode)

Use only if mode is in_process
def self.match?(mode)
  mode == :in_process || (mode.is_a?(Class) && mode <= InProcess)
end

def close_io(name)

Close io
def close_io(name)
  unless [:stdin, :stdout, :stderr].include? name
    raise ArgumentError, "Only stdin stdout and stderr are allowed to close"
  end
  get_instance_variable(name.to_sym).close
end

def initialize(cmd, exit_timeout, io_wait_timeout, working_directory, # rubocop:disable Metrics/ParameterLists

rubocop:disable Metrics/ParameterLists
def initialize(cmd, exit_timeout, io_wait_timeout, working_directory, # rubocop:disable Metrics/ParameterLists
               environment = Aruba.platform.environment_variables.hash_from_env,
               main_class = nil, stop_signal = nil, startup_wait_time = 0)
  @cmd               = cmd
  @argv              = arguments
  @stdin             = StringIO.new
  @stdout            = StringIO.new
  @stderr            = StringIO.new
  @kernel            = FakeKernel.new
  super
end

def interactive?

def interactive?
  false
end

def pid

This is the PID of the ruby process! So be careful

Output pid of process
def pid
  $PROCESS_ID
end

def start

Start command
def start
  raise "You need to call aruba.config.main_class = YourMainClass" unless main_class
  @started = true
  Dir.chdir @working_directory do
    before_run
    Aruba.platform.with_environment environment.merge("PWD" => @working_directory) do
      main_class.new(@argv, @stdin, @stdout, @stderr, @kernel).execute!
    end
    after_run
    yield self if block_given?
  end
end

def stderr(*)

Access stderr
def stderr(*)
  @stderr.string
end

def stdin

Access stdin
def stdin
  @stdin.string
end

def stdout(*)

Access stdout
def stdout(*)
  @stdout.string
end

def stop(*)

Stop command
def stop(*)
  @started     = false
  @exit_status = @kernel.exitstatus
end

def terminate

Terminate program
def terminate
  stop
end

def write(input)

Parameters:
  • input (String) --
def write(input)
  @stdin.write input
end