def add_exit_status(code)
      code = 0 if code.nil?
      if code.is_a?(Process::Status)
        @exit_status = code.exitstatus.to_i
        @pid = Rye.sysinfo.vm == :java ? '-1' : code.pid
      else
        @exit_status = code.to_i
      end
    end
def add_exit_status(code)
      code = 0 if code.nil?
      if code.is_a?(Process::Status)
        @exit_status = code.exitstatus.to_i
        @pid = Rye.sysinfo.vm == :java ? '-1' : code.pid
      else
        @exit_status = code.to_i
      end
    end
Parse the exit code.
 * +code+ an exit code string or integer or Process::Status object
 For example, when running a command via Rye.shell, this method
 is send $? which is Process::Status object. Via Rye::Box.run_command
 it's just an exit code returned by Net::SSH.

 In JRuby, if +code+ is a Process::Status object, @pid will be
 set to -1 (JRuby doesn't return the pid).

 Returns the exit code as an Integer.