From a67e2a0a00da4f45e4a74f141739e83e4ad7b840 Mon Sep 17 00:00:00 2001 From: Dylan Thacker-Smith Date: Fri, 25 Jul 2014 13:09:08 -0400 Subject: [PATCH] Remove unused Block#end_tag method. Although the method is called, it is defined with an empty body and not overridden to do anything else. --- History.md | 1 + lib/liquid/block.rb | 8 +------- lib/liquid/tags/raw.rb | 5 +---- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/History.md b/History.md index abc498f..486eb94 100644 --- a/History.md +++ b/History.md @@ -3,6 +3,7 @@ ## 3.0.0 / not yet released / branch "master" * ... +* Removed Block#end_tag. Instead, override parse with `super` followed by your code. See #446 [Dylan Thacker-Smith, dylanahsmith] * Fixed condition with wrong data types, see #423 [Bogdan Gusiev] * Add url_encode to standard filters, see #421 [Derrick Reimer, djreimer] * Add uniq to standard filters [Florian Weingarten, fw42] diff --git a/lib/liquid/block.rb b/lib/liquid/block.rb index 2e0ef9a..7de23e2 100644 --- a/lib/liquid/block.rb +++ b/lib/liquid/block.rb @@ -23,10 +23,7 @@ module Liquid # if we found the proper block delimiter just end parsing here and let the outer block # proceed - if block_delimiter == $1 - end_tag - return - end + return if block_delimiter == $1 # fetch the tag from registered blocks if tag = Template.tags[$1] @@ -77,9 +74,6 @@ module Liquid all_warnings end - def end_tag - end - def unknown_tag(tag, params, tokens) case tag when 'else'.freeze diff --git a/lib/liquid/tags/raw.rb b/lib/liquid/tags/raw.rb index 0980ee1..59e52c9 100644 --- a/lib/liquid/tags/raw.rb +++ b/lib/liquid/tags/raw.rb @@ -8,10 +8,7 @@ module Liquid while token = tokens.shift if token =~ FullTokenPossiblyInvalid @nodelist << $1 if $1 != "".freeze - if block_delimiter == $2 - end_tag - return - end + return if block_delimiter == $2 end @nodelist << token if not token.empty? end