class WebTools::Middleware::Debugger

Attributes

production_mode[R]

Public Class Methods

new(app, *args) click to toggle source
# File lib/web_tools/middleware/debugger.rb, line 8
def initialize(app, *args)
  @app = app
  self.production_mode = true if args.include?(:production)
  self.production_mode ||= false if args.include?(:development)
  self.production_mode ||= (ENV["RACK_ENV"] == :production)
end

Public Instance Methods

_call(env) click to toggle source
# File lib/web_tools/middleware/debugger.rb, line 28
def _call(env)
  @debugger.wrap_call(env) do
    Maglev::Debugger.debug(production_mode) { @app.call(env) }
  end
end
call(env) click to toggle source
# File lib/web_tools/middleware/debugger.rb, line 24
def call(env)
  dup._call(env)
end
production_mode=(bool) click to toggle source
# File lib/web_tools/middleware/debugger.rb, line 15
def production_mode=(bool)
  @production_mode = bool
  if bool
    @debugger = self
  else
    @debugger = InProcessDebugger.new(@app)
  end
end
wrap_call(env) { || ... } click to toggle source
# File lib/web_tools/middleware/debugger.rb, line 34
def wrap_call(env)
  yield
end