Sha256: 1b204c898f5e14e6b27e2cca96258c008732e8a589635f739dccd3854b8da909
Contents?: true
Size: 1007 Bytes
Versions: 7
Compression:
Stored size: 1007 Bytes
Contents
# encoding: utf-8 module Rack class Webconsole # A sandbox to evaluate Ruby in. It is responsible for retrieving local # variables stored in `@locals`, and resetting the environment. # class Sandbox # Catches all the undefined local variables and tries to retrieve them # from `@locals`. If it doesn't find them, it falls back to the default # method missing behavior. def method_missing(method, *args, &block) @locals ||= {} @locals[method.to_sym] || super(method, *args, &block) end # Makes the console use a fresh, new {Sandbox} with all local variables # resetted. # # @return [String] 'ok' to make the user notice. def reload! $sandbox = Sandbox.new 'ok' end # Returns the current page request object for inspection purposes. # # @return [Rack::Request] the current page request object. def request Webconsole::Repl.request end end end end
Version data entries
7 entries across 7 versions & 2 rubygems