mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-12 23:40:45 -07:00
Merge branch 'master' of git://github.com/mhw/liquid into mhw/master
This commit is contained in:
+1
-9
@@ -22,7 +22,7 @@
|
|||||||
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
||||||
|
|
||||||
module Liquid
|
module Liquid
|
||||||
FilterSperator = /\|/
|
FilterSeparator = /\|/
|
||||||
ArgumentSeparator = ','
|
ArgumentSeparator = ','
|
||||||
FilterArgumentSeparator = ':'
|
FilterArgumentSeparator = ':'
|
||||||
VariableAttributeSeparator = '.'
|
VariableAttributeSeparator = '.'
|
||||||
@@ -60,11 +60,3 @@ require 'liquid/module_ex'
|
|||||||
# Load all the tags of the standard library
|
# Load all the tags of the standard library
|
||||||
#
|
#
|
||||||
Dir[File.dirname(__FILE__) + '/liquid/tags/*.rb'].each { |f| require f }
|
Dir[File.dirname(__FILE__) + '/liquid/tags/*.rb'].each { |f| require f }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -19,8 +19,8 @@ module Liquid
|
|||||||
@filters = []
|
@filters = []
|
||||||
if match = markup.match(/\s*(#{QuotedFragment})/)
|
if match = markup.match(/\s*(#{QuotedFragment})/)
|
||||||
@name = match[1]
|
@name = match[1]
|
||||||
if markup.match(/#{FilterSperator}\s*(.*)/)
|
if markup.match(/#{FilterSeparator}\s*(.*)/)
|
||||||
filters = Regexp.last_match(1).split(/#{FilterSperator}/)
|
filters = Regexp.last_match(1).split(/#{FilterSeparator}/)
|
||||||
|
|
||||||
filters.each do |f|
|
filters.each do |f|
|
||||||
if matches = f.match(/\s*(\w+)/)
|
if matches = f.match(/\s*(\w+)/)
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
#!/usr/bin/env ruby
|
#!/usr/bin/env ruby
|
||||||
require File.dirname(__FILE__) + '/helper'
|
require File.dirname(__FILE__) + '/helper'
|
||||||
|
|
||||||
|
|
||||||
module MoneyFilter
|
module MoneyFilter
|
||||||
def money(input)
|
def money(input)
|
||||||
sprintf(' %d$ ', input)
|
sprintf(' %d$ ', input)
|
||||||
@@ -18,7 +17,6 @@ module CanadianMoneyFilter
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
class FiltersTest < Test::Unit::TestCase
|
class FiltersTest < Test::Unit::TestCase
|
||||||
include Liquid
|
include Liquid
|
||||||
|
|
||||||
@@ -94,5 +92,4 @@ class FiltersInTemplate < Test::Unit::TestCase
|
|||||||
assert_equal " 1000$ CAD ", Template.parse("{{1000 | money}}").render(nil, CanadianMoneyFilter)
|
assert_equal " 1000$ CAD ", Template.parse("{{1000 | money}}").render(nil, CanadianMoneyFilter)
|
||||||
assert_equal " 1000$ CAD ", Template.parse("{{1000 | money}}").render(nil, [CanadianMoneyFilter])
|
assert_equal " 1000$ CAD ", Template.parse("{{1000 | money}}").render(nil, [CanadianMoneyFilter])
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user