Class: Gemlings::Sandbox::BoxExecutor
- Inherits:
-
ForkExecutor
- Object
- Executor
- ForkExecutor
- Gemlings::Sandbox::BoxExecutor
- Defined in:
- lib/gemlings/sandbox.rb
Overview
Ruby 4.0+: Fork with Ruby::Box namespace isolation. Agent code runs in a separate process AND a separate namespace, so monkey-patches, constants, and class variables can't leak into the host.
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Executor
Class Method Details
.available? ⇒ Boolean
75 76 77 |
# File 'lib/gemlings/sandbox.rb', line 75 def self.available? super && defined?(Ruby::Box) && Ruby::Box.enabled? end |
Instance Method Details
#call(timeout, &block) ⇒ Object
79 80 81 82 83 84 |
# File 'lib/gemlings/sandbox.rb', line 79 def call(timeout, &block) super(timeout) do box = Ruby::Box.new block.call(box) end end |