Compare commits

..

5 Commits

Author SHA1 Message Date
James MacAulay
0417c9e723 Gem v2.1.2 2010-07-09 09:17:10 -04:00
James MacAulay
ffd48880e2 Gem v2.1.1 2010-07-09 09:11:49 -04:00
James MacAulay
6b79f25c87 rake release 2010-07-09 09:11:41 -04:00
James MacAulay
ff829e7996 fix if tag parsing with expressions starting with and/or 2010-07-07 16:48:23 -04:00
James MacAulay
d53a4e1834 rake default task is 'test' 2010-07-06 16:01:15 -04:00
4 changed files with 23 additions and 3 deletions

View File

@@ -4,6 +4,8 @@ require 'rake'
require 'rake/testtask'
require 'rake/gempackagetask'
task :default => 'test'
Rake::TestTask.new(:test) do |t|
t.libs << "lib"
t.libs << "test"
@@ -16,6 +18,11 @@ Rake::GemPackageTask.new(gemspec) do |pkg|
pkg.gem_spec = gemspec
end
desc "build the gem and release it to rubygems.org"
task :release => :gem do
sh "gem push pkg/liquid-#{gemspec.version}.gem"
end
namespace :profile do

View File

@@ -14,7 +14,7 @@ module Liquid
class If < Block
SyntaxHelp = "Syntax Error in tag 'if' - Valid syntax: if [expression]"
Syntax = /(#{QuotedFragment})\s*([=!<>a-z_]+)?\s*(#{QuotedFragment})?/
ExpressionsAndOperators = /(?:and|or|(?:\s*(?!\b(?:and|or)\b)(?:#{QuotedFragment}|\S+)\s*)+)/
ExpressionsAndOperators = /(?:\b(?:and|or)\b|(?:\s*(?!\b(?:and|or)\b)(?:#{QuotedFragment}|\S+)\s*)+)/
def initialize(tag_name, markup, tokens)

View File

@@ -1,10 +1,9 @@
Gem::Specification.new do |s|
s.name = %q{liquid}
s.version = "2.1.0"
s.version = "2.1.2"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Tobias Luetke"]
s.date = %q{2009-04-13}
s.description = %q{A secure, non-evaling end user template engine with aesthetic markup.}
s.email = %q{tobi@leetsoft.com}
s.extra_rdoc_files = ["History.txt", "Manifest.txt", "README.txt"]

View File

@@ -44,6 +44,20 @@ class IfElseTest < Test::Unit::TestCase
end
end
def test_comparison_of_expressions_starting_with_and_or_or
assigns = {'order' => {'items_count' => 0}, 'android' => {'name' => 'Roy'}}
assert_nothing_raised do
assert_template_result( "YES",
"{% if android.name == 'Roy' %}YES{% endif %}",
assigns)
end
assert_nothing_raised do
assert_template_result( "YES",
"{% if order.items_count == 0 %}YES{% endif %}",
assigns)
end
end
def test_if_and
assert_template_result(' YES ','{% if true and true %} YES {% endif %}')
assert_template_result('','{% if false and true %} YES {% endif %}')