class MXC::Result
The outcome of a command that ran in a sandbox.
result = MXC.run("python3 build.py") result.success? # => true result.stdout # => "built 3 files\n"
Attributes
Returns the backend that ran the command, such as :bubblewrap.
Returns the host:port destinations the network allow-list refused.
Returns the exit code, or nil when the command timed out.
Returns everything the command wrote to standard error.
Returns everything the command wrote to standard output.
Returns MXC’s warnings about the sandbox, as Strings.
Public Instance Methods
Source
# File lib/mxc/result.rb, line 39 def success? !timed_out? && exit_code.zero? end
Returns true when the command exited with status 0 before its timeout.
Source
# File lib/mxc/result.rb, line 44 def timed_out? @timed_out end
Returns true when the command ran out of time and was stopped.
Source
# File lib/mxc/result.rb, line 49 def to_h { stdout:, stderr:, exit_code:, timed_out: timed_out?, warnings:, blocked:, backend: } end
Returns the result as a Hash.