Merge pull request #553 from Shopify/cherry-pick-lookup

Liquid 3.0.2
This commit is contained in:
Justin Li
2015-04-27 11:56:13 -04:00
6 changed files with 21 additions and 4 deletions

View File

@@ -1,8 +1,16 @@
# Liquid Version History
## 3.0.0 / not yet released / branch "master"
## 3.0.2 / 2015-04-24 / branch "3-0-stable"
* Expose VariableLookup private members (#551) [Justin Li, pushrax]
* Documentation fixes
## 3.0.1 / 2015-01-23
* Remove duplicate `index0` key in TableRow tag (#502) [Alfred Xing]
## 3.0.0 / 2014-11-12
* ...
* Removed Block#end_tag. Instead, override parse with `super` followed by your code. See #446 [Dylan Thacker-Smith, dylanahsmith]
* Fixed condition with wrong data types, see #423 [Bogdan Gusiev]
* Add url_encode to standard filters, see #421 [Derrick Reimer, djreimer]

View File

@@ -3,7 +3,7 @@ require File.dirname(__FILE__) + '/if'
module Liquid
# Unless is a conditional just like 'if' but works on the inverse logic.
#
# {% unless x < 0 %} x is greater than zero {% end %}
# {% unless x < 0 %} x is greater than zero {% endunless %}
#
class Unless < If
def render(context)

View File

@@ -3,6 +3,8 @@ module Liquid
SQUARE_BRACKETED = /\A\[(.*)\]\z/m
COMMAND_METHODS = ['size'.freeze, 'first'.freeze, 'last'.freeze]
attr_reader :name, :lookups
def self.parse(markup)
new(markup)
end

View File

@@ -1,4 +1,4 @@
# encoding: utf-8
module Liquid
VERSION = "3.0.1"
VERSION = "3.0.2"
end

View File

@@ -1,5 +1,6 @@
#!/usr/bin/env ruby
ENV["MT_NO_EXPECTATIONS"] = "1"
require 'minitest/autorun'
require 'spy/integration'

View File

@@ -136,4 +136,10 @@ class VariableUnitTest < Minitest::Test
var = Variable.new(%! name_of_variable | upcase !)
assert_equal " name_of_variable | upcase ", var.raw
end
def test_variable_lookup_interface
lookup = VariableLookup.new('a.b.c')
assert_equal 'a', lookup.name
assert_equal ['b', 'c'], lookup.lookups
end
end