Remove unnecessary blank? code

This commit is contained in:
Florian Weingarten
2014-07-22 21:19:12 +00:00
parent 5fc1929b73
commit 1e0e9f1f31
7 changed files with 7 additions and 22 deletions
+2 -2
View File
@@ -11,7 +11,7 @@ module Liquid
end
def blank?
@blank || false
@blank
end
def parse(tokens)
@@ -49,7 +49,7 @@ module Liquid
else
raise SyntaxError.new(options[:locale].t("errors.syntax.tag_termination".freeze, :token => token, :tag_end => TagEnd.inspect))
end
when token.start_with?(VARSTART)
when token.start_with?(VARSTART)
new_var = create_variable(token)
@nodelist << new_var
@children << new_var
+4 -3
View File
@@ -31,7 +31,7 @@ module Liquid
end
def blank?
@blank || false
false
end
def parse_with_selected_parser(markup)
@@ -50,11 +50,12 @@ module Liquid
end
private
def strict_parse_with_error_context(markup)
strict_parse(markup)
rescue SyntaxError => e
e.message << " in \"#{markup.strip}\""
raise e
end
end # Tag
end # Liquid
end
end
-1
View File
@@ -1,5 +1,4 @@
module Liquid
# Capture stores the result of a block into a variable without rendering it inplace.
#
# {% capture heading %}
+1 -4
View File
@@ -43,11 +43,8 @@ module Liquid
end
end
def blank?
false
end
private
def variables_from_string(markup)
markup.split(',').collect do |var|
var =~ /\s*(#{QuotedFragment})\s*/o
-4
View File
@@ -38,10 +38,6 @@ module Liquid
def parse(tokens)
end
def blank?
false
end
def render(context)
partial = load_cached_partial(context)
variable = context[@variable_name || @template_name[1..-2]]
-4
View File
@@ -25,10 +25,6 @@ module Liquid
context.environments.first[@variable] = value + 1
value.to_s
end
def blank?
false
end
end
Template.register_tag('increment'.freeze, Increment)
@@ -60,10 +60,6 @@ class CustomInclude < Liquid::Tag
def parse(tokens)
end
def blank?
false
end
def render(context)
@template_name[1..-2]
end