Module: RubyGaurden

Defined in:
lib/ruby_gaurden.rb,
lib/ruby_gaurden/bed.rb,
lib/ruby_gaurden/error.rb,
lib/ruby_gaurden/version.rb,
lib/ruby_gaurden/bindings.rb,
lib/ruby_gaurden/bridging.rb,
lib/ruby_gaurden/bed_error.rb,
lib/ruby_gaurden/execution.rb,
lib/ruby_gaurden/thread_safety.rb,
lib/ruby_gaurden/timeout_error.rb,
lib/ruby_gaurden/execution_error.rb,
lib/ruby_gaurden/compilation_error.rb,
lib/ruby_gaurden/runtime_environment.rb

Defined Under Namespace

Modules: Bindings, Bridging, Execution, RuntimeEnvironment, ThreadSafety Classes: Bed, BedError, CompilationError, Error, ExecutionError, TimeoutError

Constant Summary collapse

VERSION =
'0.1.0'

Class Method Summary collapse

Class Method Details

.currentObject?

Returns the current sandbox proxy instance if running inside a sandbox.

Returns:

  • (Object, nil)

    The proxy instance or nil if outside a sandbox.



28
29
30
# File 'lib/ruby_gaurden.rb', line 28

def current
  nil
end

.executeObject

Convenience method to execute Ruby code in a fresh, one-off sandbox.

Parameters:

  • args (Array)

    Arguments passed to Bed.execute.

Returns:

  • (Object)

    The result of the execution.



35
36
37
# File 'lib/ruby_gaurden.rb', line 35

def execute(...)
  Bed.execute(...)
end

.planted?Boolean

Checks if the current execution context is inside a sandbox.

Returns:

  • (Boolean)

    true if inside a sandbox, false otherwise.



22
23
24
# File 'lib/ruby_gaurden.rb', line 22

def planted?
  false
end