Remove trailing whitespace

This commit is contained in:
Marcus Stollsteimer
2012-11-18 10:29:22 +01:00
parent afc3944a4a
commit b48ad7da3a
2 changed files with 13 additions and 13 deletions
+9 -9
View File
@@ -1,11 +1,11 @@
module Liquid
class Include < Tag
Syntax = /(#{QuotedFragment}+)(\s+(?:with|for)\s+(#{QuotedFragment}+))?/o
def initialize(tag_name, markup, tokens)
def initialize(tag_name, markup, tokens)
if markup =~ Syntax
@template_name = $1
@template_name = $1
@variable_name = $3
@attributes = {}
@@ -19,15 +19,15 @@ module Liquid
super
end
def parse(tokens)
end
def render(context)
source = _read_template_from_file_system(context)
partial = Liquid::Template.parse(source)
variable = context[@variable_name || @template_name[1..-2]]
context.stack do
@attributes.each do |key, value|
context[key] = context[value]
@@ -44,11 +44,11 @@ module Liquid
end
end
end
private
def _read_template_from_file_system(context)
file_system = context.registers[:file_system] || Liquid::Template.file_system
# make read_template_file call backwards-compatible.
case file_system.method(:read_template_file).arity
when 1
@@ -61,5 +61,5 @@ module Liquid
end
end
Template.register_tag('include', Include)
Template.register_tag('include', Include)
end
+4 -4
View File
@@ -9,25 +9,25 @@ module Liquid
class Unless < If
def render(context)
context.stack do
# First condition is interpreted backwards ( if not )
first_block = @blocks.first
unless first_block.evaluate(context)
return render_all(first_block.attachment, context)
end
# After the first condition unless works just like if
@blocks[1..-1].each do |block|
if block.evaluate(context)
return render_all(block.attachment, context)
end
end
''
end
end
end
Template.register_tag('unless', Unless)
end