Class: Hermetic::Backends::Null

Inherits:
Base
  • Object
show all
Defined in:
lib/hermetic/backends/null.rb

Overview

Disabled: code execution is off. Fails loud on run — a silent no-op would look like a sandbox while providing none.

Constant Summary

Constants inherited from Base

Base::OFF_HOST_TRUST, Base::TIMEOUT_EXIT

Instance Attribute Summary

Attributes inherited from Base

#limits, #trust

Instance Method Summary collapse

Methods inherited from Base

#backend_name, #off_host?

Constructor Details

#initializeNull

Returns a new instance of Null.



6
7
8
# File 'lib/hermetic/backends/null.rb', line 6

def initialize
  super(trust: :none)
end

Instance Method Details

#enabled?Boolean

Returns:

  • (Boolean)


10
# File 'lib/hermetic/backends/null.rb', line 10

def enabled? = false

#runObject

Raises:



12
13
14
15
16
# File 'lib/hermetic/backends/null.rb', line 12

def run(*, **)
  raise DisabledError,
        "code execution is disabled (Null backend) — construct a real one: " \
        "Hermetic.hosted / .gvisor / .firecracker / .docker"
end