Class: Rack::Webconsole
- Inherits:
-
Object
- Object
- Rack::Webconsole
- Defined in:
- lib/rack/webconsole.rb,
lib/rack/webconsole/repl.rb,
lib/rack/webconsole/assets.rb,
lib/rack/webconsole/railtie.rb,
lib/rack/webconsole/version.rb,
lib/rack/webconsole/sandbox.rb,
lib/rack/webconsole/asset_helpers.rb
Overview
Webconsole is a Rack middleware that provides an interactive console à la Rails console, but for any kind of Rack application (Rails, Sinatra, Padrino…), accessible from your web application's front-end.
For every request, it normally passes control to the Assets middleware, which injects needed JavaScript, CSS and HTML code for the console to work properly.
It also exposes a special route used by the Repl, a Ruby evaluator which is responsible of keeping state between requests, remembering local variables and giving a true IRB-esque experience.
Defined Under Namespace
Modules: AssetHelpers Classes: Assets, Railtie, Repl, Sandbox
Constant Summary
- VERSION =
rack-webconsole version number.
"0.0.1"
Instance Method Summary (collapse)
-
- (Object) call(env)
Decides where to send the request.
-
- (Webconsole) initialize(app)
constructor
Honor the Rack contract by saving the passed Rack application in an ivar.
Constructor Details
- (Webconsole) initialize(app)
Honor the Rack contract by saving the passed Rack application in an ivar.
31 32 33 |
# File 'lib/rack/webconsole.rb', line 31 def initialize(app) @app = app end |
Instance Method Details
- (Object) call(env)
41 42 43 44 45 46 47 |
# File 'lib/rack/webconsole.rb', line 41 def call(env) if env['PATH_INFO'] == '/webconsole' Repl.new(@app).call(env) else Assets.new(@app).call(env) end end |