Merge pull request #364 from collectiveidea/instrument-rendering-with-hooks

Profiling the rendering of a liquid template
This commit is contained in:
Florian Weingarten
2014-08-13 23:04:29 +02:00
13 changed files with 427 additions and 9 deletions
+5
View File
@@ -14,6 +14,7 @@ module Liquid
FilterParser = /(?:\s+|#{QuotedFragment}|#{ArgumentSeparator})+/o
EasyParse = /\A *(\w+(?:\.\w+)*) *\z/
attr_accessor :filters, :name, :warnings
attr_accessor :line_number
def initialize(markup, options = {})
@markup = markup
@@ -34,6 +35,10 @@ module Liquid
end
end
def raw
@markup
end
def lax_parse(markup)
@filters = []
if markup =~ /\s*(#{QuotedFragment})(.*)/om