From dc78e565ab915706a20ab3beae15ce9477052b7c Mon Sep 17 00:00:00 2001 From: Dylan Thacker-Smith Date: Thu, 27 Feb 2014 22:29:04 -0500 Subject: [PATCH] Move the parse method out of Tag, only blocks need the body parsed. The parse method should be renamed to something like parse_body, since that is how it is used, and no non-block tags were using the parse method. --- lib/liquid/block.rb | 5 +++++ lib/liquid/tag.rb | 3 --- lib/liquid/tags/include.rb | 3 --- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/liquid/block.rb b/lib/liquid/block.rb index df97dc92..631bae6c 100644 --- a/lib/liquid/block.rb +++ b/lib/liquid/block.rb @@ -5,6 +5,11 @@ module Liquid FullToken = /\A#{TagStart}\s*(\w+)\s*(.*)?#{TagEnd}\z/om ContentOfVariable = /\A#{VariableStart}(.*)#{VariableEnd}\z/om + def initialize(tag_name, markup, tokens) + super + parse(tokens) + end + def blank? @blank || false end diff --git a/lib/liquid/tag.rb b/lib/liquid/tag.rb index 3df10458..68d0c737 100644 --- a/lib/liquid/tag.rb +++ b/lib/liquid/tag.rb @@ -19,9 +19,6 @@ module Liquid @options = options end - def parse(tokens) - end - def name self.class.name.downcase end diff --git a/lib/liquid/tags/include.rb b/lib/liquid/tags/include.rb index d8319327..f73ef2fc 100644 --- a/lib/liquid/tags/include.rb +++ b/lib/liquid/tags/include.rb @@ -35,9 +35,6 @@ module Liquid end end - def parse(tokens) - end - def blank? false end