class DebugBar::RecipeBook::Default
A default RecipeBook
with recipes useful for Rails applications.
Public Instance Methods
exception_recipe()
click to toggle source
# File lib/debug-bar/recipe_book/default.rb, line 33 def exception_recipe return Proc.new do |b| exception = b.eval("request.env[\"action_dispatch.exception\"]") if exception [ 'Exception', exception.awesome_print_html + exception.backtrace.awesome_print_html, {:id => 'exceptions'} ] else nil end end end
host_recipe()
click to toggle source
# File lib/debug-bar/recipe_book/default.rb, line 48 def host_recipe return Proc.new do |b| host = Socket.gethostname ['Host', host.awesome_print_html, { id: 'host' }] end end
params_recipe(opts={})
click to toggle source
Displays params in a user readable fashion.
If the :cutoff option is given, it auto-hides when the params are more characters in length than the cutoff, otherwise it defaults to a sane length.
# File lib/debug-bar/recipe_book/default.rb, line 16 def params_recipe(opts={}) return Proc.new do |b| params_s = b[:params].awesome_print_html ['Params', params_s, {:id => 'params'}] end end
session_recipe()
click to toggle source
Displays the session in a pretty printed way.
# File lib/debug-bar/recipe_book/default.rb, line 24 def session_recipe return Proc.new {|b| ['Session', b[:session].awesome_print_html, {:id => 'session'}]} end