module LRD::DebugHelper

Public Instance Methods

debug_block(name, &block) click to toggle source
# File lib/app/helpers/lrd_debug_helper.rb, line 23
def debug_block(name, &block)
  content = capture(&block)
  title = content_tag(:h2, name.titleize)
  concat(content_tag :fieldset, content, {:id => "#{name}_debug_info", :style => 'display: none;' } )
end
lrd_debug(object) click to toggle source
# File lib/app/helpers/lrd_debug_helper.rb, line 6
def lrd_debug(object)
 "<pre>#{h(pp_s(object))}</pre>"
end
pp_s(*objs) click to toggle source
# File lib/app/helpers/lrd_debug_helper.rb, line 10
def pp_s(*objs)
    s = StringIO.new
    objs.each {|obj|
      PP.pp(obj, s)
    }
    s.rewind
    s.read
end
Also aliased as: pp_to_s
pp_to_s(*objs)
Alias for: pp_s