Sha256: 41eb4c6b0cccb477f95843c98a70987dc8de5aa95e911cd20150ecc0eac2b212
Contents?: true
Size: 859 Bytes
Versions: 22
Compression:
Stored size: 859 Bytes
Contents
# frozen_string_literal: true module Liquid module BlockBodyProfilingHook def render_node(context, output, node) if (profiler = context.profiler) profiler.profile_node(context.template_name, code: node.raw, line_number: node.line_number) do super end else super end end end BlockBody.prepend(BlockBodyProfilingHook) module DocumentProfilingHook def render_to_output_buffer(context, output) return super unless context.profiler context.profiler.profile(context.template_name) { super } end end Document.prepend(DocumentProfilingHook) module ContextProfilingHook attr_accessor :profiler def new_isolated_subcontext new_context = super new_context.profiler = profiler new_context end end Context.prepend(ContextProfilingHook) end
Version data entries
22 entries across 22 versions & 1 rubygems