From b48ad7da3ac2d75e2d3ad695badf74b7e0c69c61 Mon Sep 17 00:00:00 2001 From: Marcus Stollsteimer Date: Sun, 18 Nov 2012 10:29:22 +0100 Subject: [PATCH] Remove trailing whitespace --- lib/liquid/tags/include.rb | 18 +++++++++--------- lib/liquid/tags/unless.rb | 8 ++++---- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/liquid/tags/include.rb b/lib/liquid/tags/include.rb index 97c5f479..07c9221b 100644 --- a/lib/liquid/tags/include.rb +++ b/lib/liquid/tags/include.rb @@ -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 diff --git a/lib/liquid/tags/unless.rb b/lib/liquid/tags/unless.rb index 2581d25b..e5614811 100644 --- a/lib/liquid/tags/unless.rb +++ b/lib/liquid/tags/unless.rb @@ -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