Module: Ask::Sandbox
- Defined in:
- lib/ask/sandbox/base.rb,
lib/ask/sandbox/local.rb,
lib/ask/sandbox/docker.rb,
lib/ask/sandbox/daytona.rb,
lib/ask/sandbox/version.rb,
lib/ask-sandbox-providers.rb,
lib/ask/sandbox/cloudflare.rb
Defined Under Namespace
Classes: Base, Cloudflare, ConfigurationError, Daytona, Docker, Error, ExecutionError, Local, ProviderUnavailable, Result
Constant Summary collapse
- VERSION =
"0.1.0"
Instance Attribute Summary collapse
-
#exit_code ⇒ Integer?
readonly
Process exit code (nil if killed by signal).
-
#stderr ⇒ String
readonly
Captured standard error.
-
#stdout ⇒ String
readonly
Captured standard output.
-
#timed_out ⇒ Boolean
readonly
Whether execution was terminated due to timeout.
Class Method Summary collapse
-
.provider ⇒ Ask::Sandbox::Base
The currently configured sandbox provider.
-
.provider=(provider) ⇒ Object
Set the sandbox provider.
Instance Attribute Details
#exit_code ⇒ Integer? (readonly)
Returns process exit code (nil if killed by signal).
31 32 33 34 35 36 |
# File 'lib/ask/sandbox/base.rb', line 31 Result = Data.define(:stdout, :stderr, :exit_code, :timed_out) do # @return [Boolean] true if the command exited successfully (exit code 0) def success? exit_code == 0 end end |
#stderr ⇒ String (readonly)
Returns captured standard error.
31 32 33 34 35 36 |
# File 'lib/ask/sandbox/base.rb', line 31 Result = Data.define(:stdout, :stderr, :exit_code, :timed_out) do # @return [Boolean] true if the command exited successfully (exit code 0) def success? exit_code == 0 end end |
#stdout ⇒ String (readonly)
Returns captured standard output.
31 32 33 34 35 36 |
# File 'lib/ask/sandbox/base.rb', line 31 Result = Data.define(:stdout, :stderr, :exit_code, :timed_out) do # @return [Boolean] true if the command exited successfully (exit code 0) def success? exit_code == 0 end end |
#timed_out ⇒ Boolean (readonly)
Returns whether execution was terminated due to timeout.
31 32 33 34 35 36 |
# File 'lib/ask/sandbox/base.rb', line 31 Result = Data.define(:stdout, :stderr, :exit_code, :timed_out) do # @return [Boolean] true if the command exited successfully (exit code 0) def success? exit_code == 0 end end |
Class Method Details
.provider ⇒ Ask::Sandbox::Base
The currently configured sandbox provider. Defaults to Local (subprocess + rlimits).
17 18 19 |
# File 'lib/ask-sandbox-providers.rb', line 17 def provider @provider ||= Ask::Sandbox::Local.new end |
.provider=(provider) ⇒ Object
Set the sandbox provider.
26 27 28 29 30 31 |
# File 'lib/ask-sandbox-providers.rb', line 26 def provider=(provider) @provider = case provider when Symbol then resolve_provider(provider) else provider end end |