Merge pull request #389 from Shopify/remove_unnecessary_blank_stuf

Remove unnecessary blank? code
This commit is contained in:
Florian Weingarten
2014-07-23 15:07:26 +02:00
7 changed files with 7 additions and 22 deletions
+1 -1
View File
@@ -11,7 +11,7 @@ module Liquid
end
def blank?
@blank || false
@blank
end
def parse(tokens)
+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