class Rack::Bug::MustachePanel
Also, it’s fun.
generating data you need.
It can be used to track down slow partials and ensure you’re only
rendering.
Mustache views as well as all the variables accessed during view
MustachePanel is a Rack::Bug panel which tracks the time spent rendering
def self.reset
def self.reset Thread.current["rack.bug.mustache.times"] = {} Thread.current["rack.bug.mustache.vars"] = {} end
def self.times
def self.times Thread.current["rack.bug.mustache.times"] ||= {} end
def self.variables
def self.variables Thread.current["rack.bug.mustache.vars"] ||= {} end
def content
def content View.render ensure self.class.reset end
def heading
def heading "{{%.2fms}}" % self.class.times.values.inject(0.0) do |sum, obj| sum + obj end end
def name
def name "mustache" end