liquid 4.0.3 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
 - data/History.md +54 -0
 - data/README.md +6 -0
 - data/lib/liquid/block.rb +31 -14
 - data/lib/liquid/block_body.rb +166 -54
 - data/lib/liquid/condition.rb +41 -20
 - data/lib/liquid/context.rb +107 -52
 - data/lib/liquid/document.rb +47 -9
 - data/lib/liquid/drop.rb +4 -2
 - data/lib/liquid/errors.rb +20 -18
 - data/lib/liquid/expression.rb +29 -34
 - data/lib/liquid/extensions.rb +2 -0
 - data/lib/liquid/file_system.rb +6 -4
 - data/lib/liquid/forloop_drop.rb +11 -4
 - data/lib/liquid/i18n.rb +5 -3
 - data/lib/liquid/interrupts.rb +3 -1
 - data/lib/liquid/lexer.rb +30 -23
 - data/lib/liquid/locales/en.yml +3 -1
 - data/lib/liquid/parse_context.rb +20 -4
 - data/lib/liquid/parse_tree_visitor.rb +2 -2
 - data/lib/liquid/parser.rb +30 -18
 - data/lib/liquid/parser_switching.rb +17 -3
 - data/lib/liquid/partial_cache.rb +24 -0
 - data/lib/liquid/profiler/hooks.rb +26 -14
 - data/lib/liquid/profiler.rb +67 -86
 - data/lib/liquid/range_lookup.rb +13 -3
 - data/lib/liquid/register.rb +6 -0
 - data/lib/liquid/resource_limits.rb +47 -8
 - data/lib/liquid/standardfilters.rb +95 -46
 - data/lib/liquid/static_registers.rb +44 -0
 - data/lib/liquid/strainer_factory.rb +36 -0
 - data/lib/liquid/strainer_template.rb +53 -0
 - data/lib/liquid/tablerowloop_drop.rb +6 -4
 - data/lib/liquid/tag/disableable.rb +22 -0
 - data/lib/liquid/tag/disabler.rb +21 -0
 - data/lib/liquid/tag.rb +28 -6
 - data/lib/liquid/tags/assign.rb +24 -10
 - data/lib/liquid/tags/break.rb +8 -3
 - data/lib/liquid/tags/capture.rb +11 -8
 - data/lib/liquid/tags/case.rb +40 -27
 - data/lib/liquid/tags/comment.rb +5 -3
 - data/lib/liquid/tags/continue.rb +8 -3
 - data/lib/liquid/tags/cycle.rb +25 -14
 - data/lib/liquid/tags/decrement.rb +6 -3
 - data/lib/liquid/tags/echo.rb +34 -0
 - data/lib/liquid/tags/for.rb +68 -44
 - data/lib/liquid/tags/if.rb +39 -23
 - data/lib/liquid/tags/ifchanged.rb +11 -10
 - data/lib/liquid/tags/include.rb +34 -47
 - data/lib/liquid/tags/increment.rb +7 -3
 - data/lib/liquid/tags/raw.rb +14 -11
 - data/lib/liquid/tags/render.rb +84 -0
 - data/lib/liquid/tags/table_row.rb +23 -19
 - data/lib/liquid/tags/unless.rb +23 -15
 - data/lib/liquid/template.rb +53 -72
 - data/lib/liquid/template_factory.rb +9 -0
 - data/lib/liquid/tokenizer.rb +18 -10
 - data/lib/liquid/usage.rb +8 -0
 - data/lib/liquid/utils.rb +13 -3
 - data/lib/liquid/variable.rb +46 -41
 - data/lib/liquid/variable_lookup.rb +11 -6
 - data/lib/liquid/version.rb +2 -1
 - data/lib/liquid.rb +17 -5
 - data/test/integration/assign_test.rb +74 -5
 - data/test/integration/blank_test.rb +11 -8
 - data/test/integration/block_test.rb +47 -1
 - data/test/integration/capture_test.rb +18 -10
 - data/test/integration/context_test.rb +609 -5
 - data/test/integration/document_test.rb +4 -2
 - data/test/integration/drop_test.rb +67 -83
 - data/test/integration/error_handling_test.rb +73 -61
 - data/test/integration/expression_test.rb +46 -0
 - data/test/integration/filter_test.rb +53 -42
 - data/test/integration/hash_ordering_test.rb +5 -3
 - data/test/integration/output_test.rb +26 -24
 - data/test/integration/parsing_quirks_test.rb +19 -7
 - data/test/integration/{render_profiling_test.rb → profiler_test.rb} +84 -25
 - data/test/integration/security_test.rb +30 -21
 - data/test/integration/standard_filter_test.rb +385 -281
 - data/test/integration/tag/disableable_test.rb +59 -0
 - data/test/integration/tag_test.rb +45 -0
 - data/test/integration/tags/break_tag_test.rb +4 -2
 - data/test/integration/tags/continue_tag_test.rb +4 -2
 - data/test/integration/tags/echo_test.rb +13 -0
 - data/test/integration/tags/for_tag_test.rb +107 -51
 - data/test/integration/tags/if_else_tag_test.rb +5 -3
 - data/test/integration/tags/include_tag_test.rb +70 -54
 - data/test/integration/tags/increment_tag_test.rb +4 -2
 - data/test/integration/tags/liquid_tag_test.rb +116 -0
 - data/test/integration/tags/raw_tag_test.rb +14 -11
 - data/test/integration/tags/render_tag_test.rb +213 -0
 - data/test/integration/tags/standard_tag_test.rb +38 -31
 - data/test/integration/tags/statements_test.rb +23 -21
 - data/test/integration/tags/table_row_test.rb +2 -0
 - data/test/integration/tags/unless_else_tag_test.rb +4 -2
 - data/test/integration/template_test.rb +132 -124
 - data/test/integration/trim_mode_test.rb +78 -44
 - data/test/integration/variable_test.rb +74 -32
 - data/test/test_helper.rb +113 -22
 - data/test/unit/block_unit_test.rb +19 -24
 - data/test/unit/condition_unit_test.rb +79 -77
 - data/test/unit/file_system_unit_test.rb +6 -4
 - data/test/unit/i18n_unit_test.rb +7 -5
 - data/test/unit/lexer_unit_test.rb +11 -9
 - data/test/{integration → unit}/parse_tree_visitor_test.rb +16 -2
 - data/test/unit/parser_unit_test.rb +37 -35
 - data/test/unit/partial_cache_unit_test.rb +128 -0
 - data/test/unit/regexp_unit_test.rb +17 -15
 - data/test/unit/static_registers_unit_test.rb +156 -0
 - data/test/unit/strainer_factory_unit_test.rb +100 -0
 - data/test/unit/strainer_template_unit_test.rb +82 -0
 - data/test/unit/tag_unit_test.rb +5 -3
 - data/test/unit/tags/case_tag_unit_test.rb +3 -1
 - data/test/unit/tags/for_tag_unit_test.rb +4 -2
 - data/test/unit/tags/if_tag_unit_test.rb +3 -1
 - data/test/unit/template_factory_unit_test.rb +12 -0
 - data/test/unit/template_unit_test.rb +19 -10
 - data/test/unit/tokenizer_unit_test.rb +26 -19
 - data/test/unit/variable_unit_test.rb +51 -49
 - metadata +76 -50
 - data/lib/liquid/strainer.rb +0 -66
 - data/lib/liquid/truffle.rb +0 -5
 - data/test/truffle/truffle_test.rb +0 -9
 - data/test/unit/context_unit_test.rb +0 -489
 - data/test/unit/strainer_unit_test.rb +0 -164
 
| 
         @@ -1,3 +1,5 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # frozen_string_literal: true
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
       1 
3 
     | 
    
         
             
            require 'test_helper'
         
     | 
| 
       2 
4 
     | 
    
         | 
| 
       3 
5 
     | 
    
         
             
            class VariableUnitTest < Minitest::Test
         
     | 
| 
         @@ -5,108 +7,108 @@ class VariableUnitTest < Minitest::Test 
     | 
|
| 
       5 
7 
     | 
    
         | 
| 
       6 
8 
     | 
    
         
             
              def test_variable
         
     | 
| 
       7 
9 
     | 
    
         
             
                var = create_variable('hello')
         
     | 
| 
       8 
     | 
    
         
            -
                assert_equal 
     | 
| 
      
 10 
     | 
    
         
            +
                assert_equal(VariableLookup.new('hello'), var.name)
         
     | 
| 
       9 
11 
     | 
    
         
             
              end
         
     | 
| 
       10 
12 
     | 
    
         | 
| 
       11 
13 
     | 
    
         
             
              def test_filters
         
     | 
| 
       12 
14 
     | 
    
         
             
                var = create_variable('hello | textileze')
         
     | 
| 
       13 
     | 
    
         
            -
                assert_equal 
     | 
| 
       14 
     | 
    
         
            -
                assert_equal 
     | 
| 
      
 15 
     | 
    
         
            +
                assert_equal(VariableLookup.new('hello'), var.name)
         
     | 
| 
      
 16 
     | 
    
         
            +
                assert_equal([['textileze', []]], var.filters)
         
     | 
| 
       15 
17 
     | 
    
         | 
| 
       16 
18 
     | 
    
         
             
                var = create_variable('hello | textileze | paragraph')
         
     | 
| 
       17 
     | 
    
         
            -
                assert_equal 
     | 
| 
       18 
     | 
    
         
            -
                assert_equal 
     | 
| 
      
 19 
     | 
    
         
            +
                assert_equal(VariableLookup.new('hello'), var.name)
         
     | 
| 
      
 20 
     | 
    
         
            +
                assert_equal([['textileze', []], ['paragraph', []]], var.filters)
         
     | 
| 
       19 
21 
     | 
    
         | 
| 
       20 
22 
     | 
    
         
             
                var = create_variable(%( hello | strftime: '%Y'))
         
     | 
| 
       21 
     | 
    
         
            -
                assert_equal 
     | 
| 
       22 
     | 
    
         
            -
                assert_equal 
     | 
| 
      
 23 
     | 
    
         
            +
                assert_equal(VariableLookup.new('hello'), var.name)
         
     | 
| 
      
 24 
     | 
    
         
            +
                assert_equal([['strftime', ['%Y']]], var.filters)
         
     | 
| 
       23 
25 
     | 
    
         | 
| 
       24 
26 
     | 
    
         
             
                var = create_variable(%( 'typo' | link_to: 'Typo', true ))
         
     | 
| 
       25 
     | 
    
         
            -
                assert_equal 
     | 
| 
       26 
     | 
    
         
            -
                assert_equal 
     | 
| 
      
 27 
     | 
    
         
            +
                assert_equal('typo', var.name)
         
     | 
| 
      
 28 
     | 
    
         
            +
                assert_equal([['link_to', ['Typo', true]]], var.filters)
         
     | 
| 
       27 
29 
     | 
    
         | 
| 
       28 
30 
     | 
    
         
             
                var = create_variable(%( 'typo' | link_to: 'Typo', false ))
         
     | 
| 
       29 
     | 
    
         
            -
                assert_equal 
     | 
| 
       30 
     | 
    
         
            -
                assert_equal 
     | 
| 
      
 31 
     | 
    
         
            +
                assert_equal('typo', var.name)
         
     | 
| 
      
 32 
     | 
    
         
            +
                assert_equal([['link_to', ['Typo', false]]], var.filters)
         
     | 
| 
       31 
33 
     | 
    
         | 
| 
       32 
34 
     | 
    
         
             
                var = create_variable(%( 'foo' | repeat: 3 ))
         
     | 
| 
       33 
     | 
    
         
            -
                assert_equal 
     | 
| 
       34 
     | 
    
         
            -
                assert_equal 
     | 
| 
      
 35 
     | 
    
         
            +
                assert_equal('foo', var.name)
         
     | 
| 
      
 36 
     | 
    
         
            +
                assert_equal([['repeat', [3]]], var.filters)
         
     | 
| 
       35 
37 
     | 
    
         | 
| 
       36 
38 
     | 
    
         
             
                var = create_variable(%( 'foo' | repeat: 3, 3 ))
         
     | 
| 
       37 
     | 
    
         
            -
                assert_equal 
     | 
| 
       38 
     | 
    
         
            -
                assert_equal 
     | 
| 
      
 39 
     | 
    
         
            +
                assert_equal('foo', var.name)
         
     | 
| 
      
 40 
     | 
    
         
            +
                assert_equal([['repeat', [3, 3]]], var.filters)
         
     | 
| 
       39 
41 
     | 
    
         | 
| 
       40 
42 
     | 
    
         
             
                var = create_variable(%( 'foo' | repeat: 3, 3, 3 ))
         
     | 
| 
       41 
     | 
    
         
            -
                assert_equal 
     | 
| 
       42 
     | 
    
         
            -
                assert_equal 
     | 
| 
      
 43 
     | 
    
         
            +
                assert_equal('foo', var.name)
         
     | 
| 
      
 44 
     | 
    
         
            +
                assert_equal([['repeat', [3, 3, 3]]], var.filters)
         
     | 
| 
       43 
45 
     | 
    
         | 
| 
       44 
46 
     | 
    
         
             
                var = create_variable(%( hello | strftime: '%Y, okay?'))
         
     | 
| 
       45 
     | 
    
         
            -
                assert_equal 
     | 
| 
       46 
     | 
    
         
            -
                assert_equal 
     | 
| 
      
 47 
     | 
    
         
            +
                assert_equal(VariableLookup.new('hello'), var.name)
         
     | 
| 
      
 48 
     | 
    
         
            +
                assert_equal([['strftime', ['%Y, okay?']]], var.filters)
         
     | 
| 
       47 
49 
     | 
    
         | 
| 
       48 
50 
     | 
    
         
             
                var = create_variable(%( hello | things: "%Y, okay?", 'the other one'))
         
     | 
| 
       49 
     | 
    
         
            -
                assert_equal 
     | 
| 
       50 
     | 
    
         
            -
                assert_equal 
     | 
| 
      
 51 
     | 
    
         
            +
                assert_equal(VariableLookup.new('hello'), var.name)
         
     | 
| 
      
 52 
     | 
    
         
            +
                assert_equal([['things', ['%Y, okay?', 'the other one']]], var.filters)
         
     | 
| 
       51 
53 
     | 
    
         
             
              end
         
     | 
| 
       52 
54 
     | 
    
         | 
| 
       53 
55 
     | 
    
         
             
              def test_filter_with_date_parameter
         
     | 
| 
       54 
56 
     | 
    
         
             
                var = create_variable(%( '2006-06-06' | date: "%m/%d/%Y"))
         
     | 
| 
       55 
     | 
    
         
            -
                assert_equal 
     | 
| 
       56 
     | 
    
         
            -
                assert_equal 
     | 
| 
      
 57 
     | 
    
         
            +
                assert_equal('2006-06-06', var.name)
         
     | 
| 
      
 58 
     | 
    
         
            +
                assert_equal([['date', ['%m/%d/%Y']]], var.filters)
         
     | 
| 
       57 
59 
     | 
    
         
             
              end
         
     | 
| 
       58 
60 
     | 
    
         | 
| 
       59 
61 
     | 
    
         
             
              def test_filters_without_whitespace
         
     | 
| 
       60 
62 
     | 
    
         
             
                var = create_variable('hello | textileze | paragraph')
         
     | 
| 
       61 
     | 
    
         
            -
                assert_equal 
     | 
| 
       62 
     | 
    
         
            -
                assert_equal 
     | 
| 
      
 63 
     | 
    
         
            +
                assert_equal(VariableLookup.new('hello'), var.name)
         
     | 
| 
      
 64 
     | 
    
         
            +
                assert_equal([['textileze', []], ['paragraph', []]], var.filters)
         
     | 
| 
       63 
65 
     | 
    
         | 
| 
       64 
66 
     | 
    
         
             
                var = create_variable('hello|textileze|paragraph')
         
     | 
| 
       65 
     | 
    
         
            -
                assert_equal 
     | 
| 
       66 
     | 
    
         
            -
                assert_equal 
     | 
| 
      
 67 
     | 
    
         
            +
                assert_equal(VariableLookup.new('hello'), var.name)
         
     | 
| 
      
 68 
     | 
    
         
            +
                assert_equal([['textileze', []], ['paragraph', []]], var.filters)
         
     | 
| 
       67 
69 
     | 
    
         | 
| 
       68 
70 
     | 
    
         
             
                var = create_variable("hello|replace:'foo','bar'|textileze")
         
     | 
| 
       69 
     | 
    
         
            -
                assert_equal 
     | 
| 
       70 
     | 
    
         
            -
                assert_equal 
     | 
| 
      
 71 
     | 
    
         
            +
                assert_equal(VariableLookup.new('hello'), var.name)
         
     | 
| 
      
 72 
     | 
    
         
            +
                assert_equal([['replace', ['foo', 'bar']], ['textileze', []]], var.filters)
         
     | 
| 
       71 
73 
     | 
    
         
             
              end
         
     | 
| 
       72 
74 
     | 
    
         | 
| 
       73 
75 
     | 
    
         
             
              def test_symbol
         
     | 
| 
       74 
76 
     | 
    
         
             
                var = create_variable("http://disney.com/logo.gif | image: 'med' ", error_mode: :lax)
         
     | 
| 
       75 
     | 
    
         
            -
                assert_equal 
     | 
| 
       76 
     | 
    
         
            -
                assert_equal 
     | 
| 
      
 77 
     | 
    
         
            +
                assert_equal(VariableLookup.new('http://disney.com/logo.gif'), var.name)
         
     | 
| 
      
 78 
     | 
    
         
            +
                assert_equal([['image', ['med']]], var.filters)
         
     | 
| 
       77 
79 
     | 
    
         
             
              end
         
     | 
| 
       78 
80 
     | 
    
         | 
| 
       79 
81 
     | 
    
         
             
              def test_string_to_filter
         
     | 
| 
       80 
82 
     | 
    
         
             
                var = create_variable("'http://disney.com/logo.gif' | image: 'med' ")
         
     | 
| 
       81 
     | 
    
         
            -
                assert_equal 
     | 
| 
       82 
     | 
    
         
            -
                assert_equal 
     | 
| 
      
 83 
     | 
    
         
            +
                assert_equal('http://disney.com/logo.gif', var.name)
         
     | 
| 
      
 84 
     | 
    
         
            +
                assert_equal([['image', ['med']]], var.filters)
         
     | 
| 
       83 
85 
     | 
    
         
             
              end
         
     | 
| 
       84 
86 
     | 
    
         | 
| 
       85 
87 
     | 
    
         
             
              def test_string_single_quoted
         
     | 
| 
       86 
88 
     | 
    
         
             
                var = create_variable(%( "hello" ))
         
     | 
| 
       87 
     | 
    
         
            -
                assert_equal 
     | 
| 
      
 89 
     | 
    
         
            +
                assert_equal('hello', var.name)
         
     | 
| 
       88 
90 
     | 
    
         
             
              end
         
     | 
| 
       89 
91 
     | 
    
         | 
| 
       90 
92 
     | 
    
         
             
              def test_string_double_quoted
         
     | 
| 
       91 
93 
     | 
    
         
             
                var = create_variable(%( 'hello' ))
         
     | 
| 
       92 
     | 
    
         
            -
                assert_equal 
     | 
| 
      
 94 
     | 
    
         
            +
                assert_equal('hello', var.name)
         
     | 
| 
       93 
95 
     | 
    
         
             
              end
         
     | 
| 
       94 
96 
     | 
    
         | 
| 
       95 
97 
     | 
    
         
             
              def test_integer
         
     | 
| 
       96 
98 
     | 
    
         
             
                var = create_variable(%( 1000 ))
         
     | 
| 
       97 
     | 
    
         
            -
                assert_equal 
     | 
| 
      
 99 
     | 
    
         
            +
                assert_equal(1000, var.name)
         
     | 
| 
       98 
100 
     | 
    
         
             
              end
         
     | 
| 
       99 
101 
     | 
    
         | 
| 
       100 
102 
     | 
    
         
             
              def test_float
         
     | 
| 
       101 
103 
     | 
    
         
             
                var = create_variable(%( 1000.01 ))
         
     | 
| 
       102 
     | 
    
         
            -
                assert_equal 
     | 
| 
      
 104 
     | 
    
         
            +
                assert_equal(1000.01, var.name)
         
     | 
| 
       103 
105 
     | 
    
         
             
              end
         
     | 
| 
       104 
106 
     | 
    
         | 
| 
       105 
107 
     | 
    
         
             
              def test_dashes
         
     | 
| 
       106 
     | 
    
         
            -
                assert_equal 
     | 
| 
       107 
     | 
    
         
            -
                assert_equal 
     | 
| 
      
 108 
     | 
    
         
            +
                assert_equal(VariableLookup.new('foo-bar'), create_variable('foo-bar').name)
         
     | 
| 
      
 109 
     | 
    
         
            +
                assert_equal(VariableLookup.new('foo-bar-2'), create_variable('foo-bar-2').name)
         
     | 
| 
       108 
110 
     | 
    
         | 
| 
       109 
     | 
    
         
            -
                with_error_mode 
     | 
| 
      
 111 
     | 
    
         
            +
                with_error_mode(:strict) do
         
     | 
| 
       110 
112 
     | 
    
         
             
                  assert_raises(Liquid::SyntaxError) { create_variable('foo - bar') }
         
     | 
| 
       111 
113 
     | 
    
         
             
                  assert_raises(Liquid::SyntaxError) { create_variable('-foo') }
         
     | 
| 
       112 
114 
     | 
    
         
             
                  assert_raises(Liquid::SyntaxError) { create_variable('2foo') }
         
     | 
| 
         @@ -115,24 +117,24 @@ class VariableUnitTest < Minitest::Test 
     | 
|
| 
       115 
117 
     | 
    
         | 
| 
       116 
118 
     | 
    
         
             
              def test_string_with_special_chars
         
     | 
| 
       117 
119 
     | 
    
         
             
                var = create_variable(%( 'hello! $!@.;"ddasd" ' ))
         
     | 
| 
       118 
     | 
    
         
            -
                assert_equal 
     | 
| 
      
 120 
     | 
    
         
            +
                assert_equal('hello! $!@.;"ddasd" ', var.name)
         
     | 
| 
       119 
121 
     | 
    
         
             
              end
         
     | 
| 
       120 
122 
     | 
    
         | 
| 
       121 
123 
     | 
    
         
             
              def test_string_dot
         
     | 
| 
       122 
124 
     | 
    
         
             
                var = create_variable(%( test.test ))
         
     | 
| 
       123 
     | 
    
         
            -
                assert_equal 
     | 
| 
      
 125 
     | 
    
         
            +
                assert_equal(VariableLookup.new('test.test'), var.name)
         
     | 
| 
       124 
126 
     | 
    
         
             
              end
         
     | 
| 
       125 
127 
     | 
    
         | 
| 
       126 
128 
     | 
    
         
             
              def test_filter_with_keyword_arguments
         
     | 
| 
       127 
129 
     | 
    
         
             
                var = create_variable(%( hello | things: greeting: "world", farewell: 'goodbye'))
         
     | 
| 
       128 
     | 
    
         
            -
                assert_equal 
     | 
| 
       129 
     | 
    
         
            -
                assert_equal 
     | 
| 
      
 130 
     | 
    
         
            +
                assert_equal(VariableLookup.new('hello'), var.name)
         
     | 
| 
      
 131 
     | 
    
         
            +
                assert_equal([['things', [], { 'greeting' => 'world', 'farewell' => 'goodbye' }]], var.filters)
         
     | 
| 
       130 
132 
     | 
    
         
             
              end
         
     | 
| 
       131 
133 
     | 
    
         | 
| 
       132 
134 
     | 
    
         
             
              def test_lax_filter_argument_parsing
         
     | 
| 
       133 
135 
     | 
    
         
             
                var = create_variable(%( number_of_comments | pluralize: 'comment': 'comments' ), error_mode: :lax)
         
     | 
| 
       134 
     | 
    
         
            -
                assert_equal 
     | 
| 
       135 
     | 
    
         
            -
                assert_equal 
     | 
| 
      
 136 
     | 
    
         
            +
                assert_equal(VariableLookup.new('number_of_comments'), var.name)
         
     | 
| 
      
 137 
     | 
    
         
            +
                assert_equal([['pluralize', ['comment', 'comments']]], var.filters)
         
     | 
| 
       136 
138 
     | 
    
         
             
              end
         
     | 
| 
       137 
139 
     | 
    
         | 
| 
       138 
140 
     | 
    
         
             
              def test_strict_filter_argument_parsing
         
     | 
| 
         @@ -145,13 +147,13 @@ class VariableUnitTest < Minitest::Test 
     | 
|
| 
       145 
147 
     | 
    
         | 
| 
       146 
148 
     | 
    
         
             
              def test_output_raw_source_of_variable
         
     | 
| 
       147 
149 
     | 
    
         
             
                var = create_variable(%( name_of_variable | upcase ))
         
     | 
| 
       148 
     | 
    
         
            -
                assert_equal 
     | 
| 
      
 150 
     | 
    
         
            +
                assert_equal(" name_of_variable | upcase ", var.raw)
         
     | 
| 
       149 
151 
     | 
    
         
             
              end
         
     | 
| 
       150 
152 
     | 
    
         | 
| 
       151 
153 
     | 
    
         
             
              def test_variable_lookup_interface
         
     | 
| 
       152 
154 
     | 
    
         
             
                lookup = VariableLookup.new('a.b.c')
         
     | 
| 
       153 
     | 
    
         
            -
                assert_equal 
     | 
| 
       154 
     | 
    
         
            -
                assert_equal 
     | 
| 
      
 155 
     | 
    
         
            +
                assert_equal('a', lookup.name)
         
     | 
| 
      
 156 
     | 
    
         
            +
                assert_equal(['b', 'c'], lookup.lookups)
         
     | 
| 
       155 
157 
     | 
    
         
             
              end
         
     | 
| 
       156 
158 
     | 
    
         | 
| 
       157 
159 
     | 
    
         
             
              private
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: liquid
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version:  
     | 
| 
      
 4 
     | 
    
         
            +
              version: 5.1.0
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Tobias Lütke
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date:  
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2021-09-15 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: rake
         
     | 
| 
         @@ -16,14 +16,14 @@ dependencies: 
     | 
|
| 
       16 
16 
     | 
    
         
             
                requirements:
         
     | 
| 
       17 
17 
     | 
    
         
             
                - - "~>"
         
     | 
| 
       18 
18 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       19 
     | 
    
         
            -
                    version: ' 
     | 
| 
      
 19 
     | 
    
         
            +
                    version: '13.0'
         
     | 
| 
       20 
20 
     | 
    
         
             
              type: :development
         
     | 
| 
       21 
21 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       22 
22 
     | 
    
         
             
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       23 
23 
     | 
    
         
             
                requirements:
         
     | 
| 
       24 
24 
     | 
    
         
             
                - - "~>"
         
     | 
| 
       25 
25 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       26 
     | 
    
         
            -
                    version: ' 
     | 
| 
      
 26 
     | 
    
         
            +
                    version: '13.0'
         
     | 
| 
       27 
27 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       28 
28 
     | 
    
         
             
              name: minitest
         
     | 
| 
       29 
29 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
         @@ -70,14 +70,20 @@ files: 
     | 
|
| 
       70 
70 
     | 
    
         
             
            - lib/liquid/parse_tree_visitor.rb
         
     | 
| 
       71 
71 
     | 
    
         
             
            - lib/liquid/parser.rb
         
     | 
| 
       72 
72 
     | 
    
         
             
            - lib/liquid/parser_switching.rb
         
     | 
| 
      
 73 
     | 
    
         
            +
            - lib/liquid/partial_cache.rb
         
     | 
| 
       73 
74 
     | 
    
         
             
            - lib/liquid/profiler.rb
         
     | 
| 
       74 
75 
     | 
    
         
             
            - lib/liquid/profiler/hooks.rb
         
     | 
| 
       75 
76 
     | 
    
         
             
            - lib/liquid/range_lookup.rb
         
     | 
| 
      
 77 
     | 
    
         
            +
            - lib/liquid/register.rb
         
     | 
| 
       76 
78 
     | 
    
         
             
            - lib/liquid/resource_limits.rb
         
     | 
| 
       77 
79 
     | 
    
         
             
            - lib/liquid/standardfilters.rb
         
     | 
| 
       78 
     | 
    
         
            -
            - lib/liquid/ 
     | 
| 
      
 80 
     | 
    
         
            +
            - lib/liquid/static_registers.rb
         
     | 
| 
      
 81 
     | 
    
         
            +
            - lib/liquid/strainer_factory.rb
         
     | 
| 
      
 82 
     | 
    
         
            +
            - lib/liquid/strainer_template.rb
         
     | 
| 
       79 
83 
     | 
    
         
             
            - lib/liquid/tablerowloop_drop.rb
         
     | 
| 
       80 
84 
     | 
    
         
             
            - lib/liquid/tag.rb
         
     | 
| 
      
 85 
     | 
    
         
            +
            - lib/liquid/tag/disableable.rb
         
     | 
| 
      
 86 
     | 
    
         
            +
            - lib/liquid/tag/disabler.rb
         
     | 
| 
       81 
87 
     | 
    
         
             
            - lib/liquid/tags/assign.rb
         
     | 
| 
       82 
88 
     | 
    
         
             
            - lib/liquid/tags/break.rb
         
     | 
| 
       83 
89 
     | 
    
         
             
            - lib/liquid/tags/capture.rb
         
     | 
| 
         @@ -86,17 +92,20 @@ files: 
     | 
|
| 
       86 
92 
     | 
    
         
             
            - lib/liquid/tags/continue.rb
         
     | 
| 
       87 
93 
     | 
    
         
             
            - lib/liquid/tags/cycle.rb
         
     | 
| 
       88 
94 
     | 
    
         
             
            - lib/liquid/tags/decrement.rb
         
     | 
| 
      
 95 
     | 
    
         
            +
            - lib/liquid/tags/echo.rb
         
     | 
| 
       89 
96 
     | 
    
         
             
            - lib/liquid/tags/for.rb
         
     | 
| 
       90 
97 
     | 
    
         
             
            - lib/liquid/tags/if.rb
         
     | 
| 
       91 
98 
     | 
    
         
             
            - lib/liquid/tags/ifchanged.rb
         
     | 
| 
       92 
99 
     | 
    
         
             
            - lib/liquid/tags/include.rb
         
     | 
| 
       93 
100 
     | 
    
         
             
            - lib/liquid/tags/increment.rb
         
     | 
| 
       94 
101 
     | 
    
         
             
            - lib/liquid/tags/raw.rb
         
     | 
| 
      
 102 
     | 
    
         
            +
            - lib/liquid/tags/render.rb
         
     | 
| 
       95 
103 
     | 
    
         
             
            - lib/liquid/tags/table_row.rb
         
     | 
| 
       96 
104 
     | 
    
         
             
            - lib/liquid/tags/unless.rb
         
     | 
| 
       97 
105 
     | 
    
         
             
            - lib/liquid/template.rb
         
     | 
| 
      
 106 
     | 
    
         
            +
            - lib/liquid/template_factory.rb
         
     | 
| 
       98 
107 
     | 
    
         
             
            - lib/liquid/tokenizer.rb
         
     | 
| 
       99 
     | 
    
         
            -
            - lib/liquid/ 
     | 
| 
      
 108 
     | 
    
         
            +
            - lib/liquid/usage.rb
         
     | 
| 
       100 
109 
     | 
    
         
             
            - lib/liquid/utils.rb
         
     | 
| 
       101 
110 
     | 
    
         
             
            - lib/liquid/variable.rb
         
     | 
| 
       102 
111 
     | 
    
         
             
            - lib/liquid/variable_lookup.rb
         
     | 
| 
         @@ -110,21 +119,26 @@ files: 
     | 
|
| 
       110 
119 
     | 
    
         
             
            - test/integration/document_test.rb
         
     | 
| 
       111 
120 
     | 
    
         
             
            - test/integration/drop_test.rb
         
     | 
| 
       112 
121 
     | 
    
         
             
            - test/integration/error_handling_test.rb
         
     | 
| 
      
 122 
     | 
    
         
            +
            - test/integration/expression_test.rb
         
     | 
| 
       113 
123 
     | 
    
         
             
            - test/integration/filter_test.rb
         
     | 
| 
       114 
124 
     | 
    
         
             
            - test/integration/hash_ordering_test.rb
         
     | 
| 
       115 
125 
     | 
    
         
             
            - test/integration/output_test.rb
         
     | 
| 
       116 
     | 
    
         
            -
            - test/integration/parse_tree_visitor_test.rb
         
     | 
| 
       117 
126 
     | 
    
         
             
            - test/integration/parsing_quirks_test.rb
         
     | 
| 
       118 
     | 
    
         
            -
            - test/integration/ 
     | 
| 
      
 127 
     | 
    
         
            +
            - test/integration/profiler_test.rb
         
     | 
| 
       119 
128 
     | 
    
         
             
            - test/integration/security_test.rb
         
     | 
| 
       120 
129 
     | 
    
         
             
            - test/integration/standard_filter_test.rb
         
     | 
| 
      
 130 
     | 
    
         
            +
            - test/integration/tag/disableable_test.rb
         
     | 
| 
      
 131 
     | 
    
         
            +
            - test/integration/tag_test.rb
         
     | 
| 
       121 
132 
     | 
    
         
             
            - test/integration/tags/break_tag_test.rb
         
     | 
| 
       122 
133 
     | 
    
         
             
            - test/integration/tags/continue_tag_test.rb
         
     | 
| 
      
 134 
     | 
    
         
            +
            - test/integration/tags/echo_test.rb
         
     | 
| 
       123 
135 
     | 
    
         
             
            - test/integration/tags/for_tag_test.rb
         
     | 
| 
       124 
136 
     | 
    
         
             
            - test/integration/tags/if_else_tag_test.rb
         
     | 
| 
       125 
137 
     | 
    
         
             
            - test/integration/tags/include_tag_test.rb
         
     | 
| 
       126 
138 
     | 
    
         
             
            - test/integration/tags/increment_tag_test.rb
         
     | 
| 
      
 139 
     | 
    
         
            +
            - test/integration/tags/liquid_tag_test.rb
         
     | 
| 
       127 
140 
     | 
    
         
             
            - test/integration/tags/raw_tag_test.rb
         
     | 
| 
      
 141 
     | 
    
         
            +
            - test/integration/tags/render_tag_test.rb
         
     | 
| 
       128 
142 
     | 
    
         
             
            - test/integration/tags/standard_tag_test.rb
         
     | 
| 
       129 
143 
     | 
    
         
             
            - test/integration/tags/statements_test.rb
         
     | 
| 
       130 
144 
     | 
    
         
             
            - test/integration/tags/table_row_test.rb
         
     | 
| 
         @@ -133,27 +147,31 @@ files: 
     | 
|
| 
       133 
147 
     | 
    
         
             
            - test/integration/trim_mode_test.rb
         
     | 
| 
       134 
148 
     | 
    
         
             
            - test/integration/variable_test.rb
         
     | 
| 
       135 
149 
     | 
    
         
             
            - test/test_helper.rb
         
     | 
| 
       136 
     | 
    
         
            -
            - test/truffle/truffle_test.rb
         
     | 
| 
       137 
150 
     | 
    
         
             
            - test/unit/block_unit_test.rb
         
     | 
| 
       138 
151 
     | 
    
         
             
            - test/unit/condition_unit_test.rb
         
     | 
| 
       139 
     | 
    
         
            -
            - test/unit/context_unit_test.rb
         
     | 
| 
       140 
152 
     | 
    
         
             
            - test/unit/file_system_unit_test.rb
         
     | 
| 
       141 
153 
     | 
    
         
             
            - test/unit/i18n_unit_test.rb
         
     | 
| 
       142 
154 
     | 
    
         
             
            - test/unit/lexer_unit_test.rb
         
     | 
| 
      
 155 
     | 
    
         
            +
            - test/unit/parse_tree_visitor_test.rb
         
     | 
| 
       143 
156 
     | 
    
         
             
            - test/unit/parser_unit_test.rb
         
     | 
| 
      
 157 
     | 
    
         
            +
            - test/unit/partial_cache_unit_test.rb
         
     | 
| 
       144 
158 
     | 
    
         
             
            - test/unit/regexp_unit_test.rb
         
     | 
| 
       145 
     | 
    
         
            -
            - test/unit/ 
     | 
| 
      
 159 
     | 
    
         
            +
            - test/unit/static_registers_unit_test.rb
         
     | 
| 
      
 160 
     | 
    
         
            +
            - test/unit/strainer_factory_unit_test.rb
         
     | 
| 
      
 161 
     | 
    
         
            +
            - test/unit/strainer_template_unit_test.rb
         
     | 
| 
       146 
162 
     | 
    
         
             
            - test/unit/tag_unit_test.rb
         
     | 
| 
       147 
163 
     | 
    
         
             
            - test/unit/tags/case_tag_unit_test.rb
         
     | 
| 
       148 
164 
     | 
    
         
             
            - test/unit/tags/for_tag_unit_test.rb
         
     | 
| 
       149 
165 
     | 
    
         
             
            - test/unit/tags/if_tag_unit_test.rb
         
     | 
| 
      
 166 
     | 
    
         
            +
            - test/unit/template_factory_unit_test.rb
         
     | 
| 
       150 
167 
     | 
    
         
             
            - test/unit/template_unit_test.rb
         
     | 
| 
       151 
168 
     | 
    
         
             
            - test/unit/tokenizer_unit_test.rb
         
     | 
| 
       152 
169 
     | 
    
         
             
            - test/unit/variable_unit_test.rb
         
     | 
| 
       153 
170 
     | 
    
         
             
            homepage: http://www.liquidmarkup.org
         
     | 
| 
       154 
171 
     | 
    
         
             
            licenses:
         
     | 
| 
       155 
172 
     | 
    
         
             
            - MIT
         
     | 
| 
       156 
     | 
    
         
            -
            metadata: 
     | 
| 
      
 173 
     | 
    
         
            +
            metadata:
         
     | 
| 
      
 174 
     | 
    
         
            +
              allowed_push_host: https://rubygems.org
         
     | 
| 
       157 
175 
     | 
    
         
             
            post_install_message: 
         
     | 
| 
       158 
176 
     | 
    
         
             
            rdoc_options: []
         
     | 
| 
       159 
177 
     | 
    
         
             
            require_paths:
         
     | 
| 
         @@ -162,64 +180,72 @@ required_ruby_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       162 
180 
     | 
    
         
             
              requirements:
         
     | 
| 
       163 
181 
     | 
    
         
             
              - - ">="
         
     | 
| 
       164 
182 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       165 
     | 
    
         
            -
                  version: 2. 
     | 
| 
      
 183 
     | 
    
         
            +
                  version: 2.5.0
         
     | 
| 
       166 
184 
     | 
    
         
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         
     | 
| 
       167 
185 
     | 
    
         
             
              requirements:
         
     | 
| 
       168 
186 
     | 
    
         
             
              - - ">="
         
     | 
| 
       169 
187 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       170 
188 
     | 
    
         
             
                  version: 1.3.7
         
     | 
| 
       171 
189 
     | 
    
         
             
            requirements: []
         
     | 
| 
       172 
     | 
    
         
            -
            rubygems_version: 3. 
     | 
| 
      
 190 
     | 
    
         
            +
            rubygems_version: 3.2.20
         
     | 
| 
       173 
191 
     | 
    
         
             
            signing_key: 
         
     | 
| 
       174 
192 
     | 
    
         
             
            specification_version: 4
         
     | 
| 
       175 
193 
     | 
    
         
             
            summary: A secure, non-evaling end user template engine with aesthetic markup.
         
     | 
| 
       176 
194 
     | 
    
         
             
            test_files:
         
     | 
| 
       177 
     | 
    
         
            -
            - test/ 
     | 
| 
      
 195 
     | 
    
         
            +
            - test/test_helper.rb
         
     | 
| 
      
 196 
     | 
    
         
            +
            - test/fixtures/en_locale.yml
         
     | 
| 
      
 197 
     | 
    
         
            +
            - test/unit/strainer_factory_unit_test.rb
         
     | 
| 
      
 198 
     | 
    
         
            +
            - test/unit/regexp_unit_test.rb
         
     | 
| 
      
 199 
     | 
    
         
            +
            - test/unit/static_registers_unit_test.rb
         
     | 
| 
      
 200 
     | 
    
         
            +
            - test/unit/template_unit_test.rb
         
     | 
| 
      
 201 
     | 
    
         
            +
            - test/unit/partial_cache_unit_test.rb
         
     | 
| 
       178 
202 
     | 
    
         
             
            - test/unit/block_unit_test.rb
         
     | 
| 
       179 
     | 
    
         
            -
            - test/unit/ 
     | 
| 
      
 203 
     | 
    
         
            +
            - test/unit/parse_tree_visitor_test.rb
         
     | 
| 
       180 
204 
     | 
    
         
             
            - test/unit/parser_unit_test.rb
         
     | 
| 
       181 
     | 
    
         
            -
            - test/unit/ 
     | 
| 
      
 205 
     | 
    
         
            +
            - test/unit/i18n_unit_test.rb
         
     | 
| 
      
 206 
     | 
    
         
            +
            - test/unit/file_system_unit_test.rb
         
     | 
| 
       182 
207 
     | 
    
         
             
            - test/unit/tags/case_tag_unit_test.rb
         
     | 
| 
      
 208 
     | 
    
         
            +
            - test/unit/tags/if_tag_unit_test.rb
         
     | 
| 
       183 
209 
     | 
    
         
             
            - test/unit/tags/for_tag_unit_test.rb
         
     | 
| 
       184 
     | 
    
         
            -
            - test/unit/context_unit_test.rb
         
     | 
| 
       185 
210 
     | 
    
         
             
            - test/unit/tokenizer_unit_test.rb
         
     | 
| 
       186 
     | 
    
         
            -
            - test/unit/ 
     | 
| 
       187 
     | 
    
         
            -
            - test/unit/ 
     | 
| 
       188 
     | 
    
         
            -
            - test/unit/template_unit_test.rb
         
     | 
| 
      
 211 
     | 
    
         
            +
            - test/unit/template_factory_unit_test.rb
         
     | 
| 
      
 212 
     | 
    
         
            +
            - test/unit/lexer_unit_test.rb
         
     | 
| 
       189 
213 
     | 
    
         
             
            - test/unit/condition_unit_test.rb
         
     | 
| 
       190 
     | 
    
         
            -
            - test/unit/ 
     | 
| 
       191 
     | 
    
         
            -
            - test/unit/ 
     | 
| 
       192 
     | 
    
         
            -
            - test/unit/ 
     | 
| 
       193 
     | 
    
         
            -
            - test/integration/ 
     | 
| 
       194 
     | 
    
         
            -
            - test/integration/ 
     | 
| 
       195 
     | 
    
         
            -
            - test/integration/ 
     | 
| 
       196 
     | 
    
         
            -
            - test/integration/blank_test.rb
         
     | 
| 
       197 
     | 
    
         
            -
            - test/integration/parse_tree_visitor_test.rb
         
     | 
| 
       198 
     | 
    
         
            -
            - test/integration/assign_test.rb
         
     | 
| 
       199 
     | 
    
         
            -
            - test/integration/trim_mode_test.rb
         
     | 
| 
      
 214 
     | 
    
         
            +
            - test/unit/tag_unit_test.rb
         
     | 
| 
      
 215 
     | 
    
         
            +
            - test/unit/strainer_template_unit_test.rb
         
     | 
| 
      
 216 
     | 
    
         
            +
            - test/unit/variable_unit_test.rb
         
     | 
| 
      
 217 
     | 
    
         
            +
            - test/integration/error_handling_test.rb
         
     | 
| 
      
 218 
     | 
    
         
            +
            - test/integration/tag_test.rb
         
     | 
| 
      
 219 
     | 
    
         
            +
            - test/integration/filter_test.rb
         
     | 
| 
       200 
220 
     | 
    
         
             
            - test/integration/context_test.rb
         
     | 
| 
       201 
     | 
    
         
            -
            - test/integration/ 
     | 
| 
      
 221 
     | 
    
         
            +
            - test/integration/block_test.rb
         
     | 
| 
      
 222 
     | 
    
         
            +
            - test/integration/template_test.rb
         
     | 
| 
      
 223 
     | 
    
         
            +
            - test/integration/profiler_test.rb
         
     | 
| 
      
 224 
     | 
    
         
            +
            - test/integration/parsing_quirks_test.rb
         
     | 
| 
      
 225 
     | 
    
         
            +
            - test/integration/tag/disableable_test.rb
         
     | 
| 
      
 226 
     | 
    
         
            +
            - test/integration/trim_mode_test.rb
         
     | 
| 
      
 227 
     | 
    
         
            +
            - test/integration/expression_test.rb
         
     | 
| 
      
 228 
     | 
    
         
            +
            - test/integration/output_test.rb
         
     | 
| 
      
 229 
     | 
    
         
            +
            - test/integration/security_test.rb
         
     | 
| 
      
 230 
     | 
    
         
            +
            - test/integration/drop_test.rb
         
     | 
| 
       202 
231 
     | 
    
         
             
            - test/integration/tags/increment_tag_test.rb
         
     | 
| 
       203 
     | 
    
         
            -
            - test/integration/tags/for_tag_test.rb
         
     | 
| 
       204 
     | 
    
         
            -
            - test/integration/tags/standard_tag_test.rb
         
     | 
| 
       205 
     | 
    
         
            -
            - test/integration/tags/table_row_test.rb
         
     | 
| 
       206 
     | 
    
         
            -
            - test/integration/tags/include_tag_test.rb
         
     | 
| 
       207 
232 
     | 
    
         
             
            - test/integration/tags/raw_tag_test.rb
         
     | 
| 
       208 
     | 
    
         
            -
            - test/integration/tags/statements_test.rb
         
     | 
| 
       209 
233 
     | 
    
         
             
            - test/integration/tags/if_else_tag_test.rb
         
     | 
| 
       210 
     | 
    
         
            -
            - test/integration/tags/ 
     | 
| 
       211 
     | 
    
         
            -
            - test/integration/tags/ 
     | 
| 
      
 234 
     | 
    
         
            +
            - test/integration/tags/include_tag_test.rb
         
     | 
| 
      
 235 
     | 
    
         
            +
            - test/integration/tags/statements_test.rb
         
     | 
| 
       212 
236 
     | 
    
         
             
            - test/integration/tags/break_tag_test.rb
         
     | 
| 
       213 
     | 
    
         
            -
            - test/integration/ 
     | 
| 
      
 237 
     | 
    
         
            +
            - test/integration/tags/render_tag_test.rb
         
     | 
| 
      
 238 
     | 
    
         
            +
            - test/integration/tags/continue_tag_test.rb
         
     | 
| 
      
 239 
     | 
    
         
            +
            - test/integration/tags/table_row_test.rb
         
     | 
| 
      
 240 
     | 
    
         
            +
            - test/integration/tags/unless_else_tag_test.rb
         
     | 
| 
      
 241 
     | 
    
         
            +
            - test/integration/tags/echo_test.rb
         
     | 
| 
      
 242 
     | 
    
         
            +
            - test/integration/tags/standard_tag_test.rb
         
     | 
| 
      
 243 
     | 
    
         
            +
            - test/integration/tags/liquid_tag_test.rb
         
     | 
| 
      
 244 
     | 
    
         
            +
            - test/integration/tags/for_tag_test.rb
         
     | 
| 
       214 
245 
     | 
    
         
             
            - test/integration/standard_filter_test.rb
         
     | 
| 
       215 
     | 
    
         
            -
            - test/integration/ 
     | 
| 
       216 
     | 
    
         
            -
            - test/integration/error_handling_test.rb
         
     | 
| 
       217 
     | 
    
         
            -
            - test/integration/template_test.rb
         
     | 
| 
      
 246 
     | 
    
         
            +
            - test/integration/blank_test.rb
         
     | 
| 
       218 
247 
     | 
    
         
             
            - test/integration/document_test.rb
         
     | 
| 
       219 
     | 
    
         
            -
            - test/integration/ 
     | 
| 
       220 
     | 
    
         
            -
            - test/integration/ 
     | 
| 
       221 
     | 
    
         
            -
            - test/integration/ 
     | 
| 
       222 
     | 
    
         
            -
            - test/integration/ 
     | 
| 
       223 
     | 
    
         
            -
            - test/truffle/truffle_test.rb
         
     | 
| 
       224 
     | 
    
         
            -
            - test/fixtures/en_locale.yml
         
     | 
| 
       225 
     | 
    
         
            -
            - test/test_helper.rb
         
     | 
| 
      
 248 
     | 
    
         
            +
            - test/integration/variable_test.rb
         
     | 
| 
      
 249 
     | 
    
         
            +
            - test/integration/hash_ordering_test.rb
         
     | 
| 
      
 250 
     | 
    
         
            +
            - test/integration/assign_test.rb
         
     | 
| 
      
 251 
     | 
    
         
            +
            - test/integration/capture_test.rb
         
     | 
    
        data/lib/liquid/strainer.rb
    DELETED
    
    | 
         @@ -1,66 +0,0 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            require 'set'
         
     | 
| 
       2 
     | 
    
         
            -
             
     | 
| 
       3 
     | 
    
         
            -
            module Liquid
         
     | 
| 
       4 
     | 
    
         
            -
              # Strainer is the parent class for the filters system.
         
     | 
| 
       5 
     | 
    
         
            -
              # New filters are mixed into the strainer class which is then instantiated for each liquid template render run.
         
     | 
| 
       6 
     | 
    
         
            -
              #
         
     | 
| 
       7 
     | 
    
         
            -
              # The Strainer only allows method calls defined in filters given to it via Strainer.global_filter,
         
     | 
| 
       8 
     | 
    
         
            -
              # Context#add_filters or Template.register_filter
         
     | 
| 
       9 
     | 
    
         
            -
              class Strainer #:nodoc:
         
     | 
| 
       10 
     | 
    
         
            -
                @@global_strainer = Class.new(Strainer) do
         
     | 
| 
       11 
     | 
    
         
            -
                  @filter_methods = Set.new
         
     | 
| 
       12 
     | 
    
         
            -
                end
         
     | 
| 
       13 
     | 
    
         
            -
                @@strainer_class_cache = Hash.new do |hash, filters|
         
     | 
| 
       14 
     | 
    
         
            -
                  hash[filters] = Class.new(@@global_strainer) do
         
     | 
| 
       15 
     | 
    
         
            -
                    @filter_methods = @@global_strainer.filter_methods.dup
         
     | 
| 
       16 
     | 
    
         
            -
                    filters.each { |f| add_filter(f) }
         
     | 
| 
       17 
     | 
    
         
            -
                  end
         
     | 
| 
       18 
     | 
    
         
            -
                end
         
     | 
| 
       19 
     | 
    
         
            -
             
     | 
| 
       20 
     | 
    
         
            -
                def initialize(context)
         
     | 
| 
       21 
     | 
    
         
            -
                  @context = context
         
     | 
| 
       22 
     | 
    
         
            -
                end
         
     | 
| 
       23 
     | 
    
         
            -
             
     | 
| 
       24 
     | 
    
         
            -
                class << self
         
     | 
| 
       25 
     | 
    
         
            -
                  attr_reader :filter_methods
         
     | 
| 
       26 
     | 
    
         
            -
                end
         
     | 
| 
       27 
     | 
    
         
            -
             
     | 
| 
       28 
     | 
    
         
            -
                def self.add_filter(filter)
         
     | 
| 
       29 
     | 
    
         
            -
                  raise ArgumentError, "Expected module but got: #{filter.class}" unless filter.is_a?(Module)
         
     | 
| 
       30 
     | 
    
         
            -
                  unless self.include?(filter)
         
     | 
| 
       31 
     | 
    
         
            -
                    invokable_non_public_methods = (filter.private_instance_methods + filter.protected_instance_methods).select { |m| invokable?(m) }
         
     | 
| 
       32 
     | 
    
         
            -
                    if invokable_non_public_methods.any?
         
     | 
| 
       33 
     | 
    
         
            -
                      raise MethodOverrideError, "Filter overrides registered public methods as non public: #{invokable_non_public_methods.join(', ')}"
         
     | 
| 
       34 
     | 
    
         
            -
                    else
         
     | 
| 
       35 
     | 
    
         
            -
                      send(:include, filter)
         
     | 
| 
       36 
     | 
    
         
            -
                      @filter_methods.merge(filter.public_instance_methods.map(&:to_s))
         
     | 
| 
       37 
     | 
    
         
            -
                    end
         
     | 
| 
       38 
     | 
    
         
            -
                  end
         
     | 
| 
       39 
     | 
    
         
            -
                end
         
     | 
| 
       40 
     | 
    
         
            -
             
     | 
| 
       41 
     | 
    
         
            -
                def self.global_filter(filter)
         
     | 
| 
       42 
     | 
    
         
            -
                  @@strainer_class_cache.clear
         
     | 
| 
       43 
     | 
    
         
            -
                  @@global_strainer.add_filter(filter)
         
     | 
| 
       44 
     | 
    
         
            -
                end
         
     | 
| 
       45 
     | 
    
         
            -
             
     | 
| 
       46 
     | 
    
         
            -
                def self.invokable?(method)
         
     | 
| 
       47 
     | 
    
         
            -
                  @filter_methods.include?(method.to_s)
         
     | 
| 
       48 
     | 
    
         
            -
                end
         
     | 
| 
       49 
     | 
    
         
            -
             
     | 
| 
       50 
     | 
    
         
            -
                def self.create(context, filters = [])
         
     | 
| 
       51 
     | 
    
         
            -
                  @@strainer_class_cache[filters].new(context)
         
     | 
| 
       52 
     | 
    
         
            -
                end
         
     | 
| 
       53 
     | 
    
         
            -
             
     | 
| 
       54 
     | 
    
         
            -
                def invoke(method, *args)
         
     | 
| 
       55 
     | 
    
         
            -
                  if self.class.invokable?(method)
         
     | 
| 
       56 
     | 
    
         
            -
                    send(method, *args)
         
     | 
| 
       57 
     | 
    
         
            -
                  elsif @context && @context.strict_filters
         
     | 
| 
       58 
     | 
    
         
            -
                    raise Liquid::UndefinedFilter, "undefined filter #{method}"
         
     | 
| 
       59 
     | 
    
         
            -
                  else
         
     | 
| 
       60 
     | 
    
         
            -
                    args.first
         
     | 
| 
       61 
     | 
    
         
            -
                  end
         
     | 
| 
       62 
     | 
    
         
            -
                rescue ::ArgumentError => e
         
     | 
| 
       63 
     | 
    
         
            -
                  raise Liquid::ArgumentError, e.message, e.backtrace
         
     | 
| 
       64 
     | 
    
         
            -
                end
         
     | 
| 
       65 
     | 
    
         
            -
              end
         
     | 
| 
       66 
     | 
    
         
            -
            end
         
     | 
    
        data/lib/liquid/truffle.rb
    DELETED