liquid-c 0.0.3 → 4.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/workflows/liquid.yml +45 -0
- data/.gitignore +4 -0
- data/.rubocop.yml +14 -0
- data/Gemfile +14 -5
- data/README.md +29 -5
- data/Rakefile +13 -62
- data/ext/liquid_c/block.c +495 -47
- data/ext/liquid_c/block.h +28 -2
- data/ext/liquid_c/c_buffer.c +42 -0
- data/ext/liquid_c/c_buffer.h +76 -0
- data/ext/liquid_c/context.c +233 -0
- data/ext/liquid_c/context.h +70 -0
- data/ext/liquid_c/document_body.c +89 -0
- data/ext/liquid_c/document_body.h +59 -0
- data/ext/liquid_c/expression.c +116 -0
- data/ext/liquid_c/expression.h +24 -0
- data/ext/liquid_c/extconf.rb +22 -6
- data/ext/liquid_c/intutil.h +22 -0
- data/ext/liquid_c/lexer.c +6 -2
- data/ext/liquid_c/lexer.h +18 -3
- data/ext/liquid_c/liquid.c +77 -6
- data/ext/liquid_c/liquid.h +24 -1
- data/ext/liquid_c/parse_context.c +76 -0
- data/ext/liquid_c/parse_context.h +13 -0
- data/ext/liquid_c/parser.c +141 -68
- data/ext/liquid_c/parser.h +4 -2
- data/ext/liquid_c/raw.c +110 -0
- data/ext/liquid_c/raw.h +6 -0
- data/ext/liquid_c/resource_limits.c +279 -0
- data/ext/liquid_c/resource_limits.h +23 -0
- data/ext/liquid_c/stringutil.h +44 -0
- data/ext/liquid_c/tokenizer.c +177 -18
- data/ext/liquid_c/tokenizer.h +21 -6
- data/ext/liquid_c/usage.c +18 -0
- data/ext/liquid_c/usage.h +9 -0
- data/ext/liquid_c/variable.c +196 -20
- data/ext/liquid_c/variable.h +18 -1
- data/ext/liquid_c/variable_lookup.c +44 -0
- data/ext/liquid_c/variable_lookup.h +8 -0
- data/ext/liquid_c/vm.c +588 -0
- data/ext/liquid_c/vm.h +25 -0
- data/ext/liquid_c/vm_assembler.c +491 -0
- data/ext/liquid_c/vm_assembler.h +240 -0
- data/ext/liquid_c/vm_assembler_pool.c +97 -0
- data/ext/liquid_c/vm_assembler_pool.h +27 -0
- data/lib/liquid/c/compile_ext.rb +44 -0
- data/lib/liquid/c/version.rb +3 -1
- data/lib/liquid/c.rb +224 -49
- data/liquid-c.gemspec +21 -12
- data/performance/c_profile.rb +23 -0
- data/performance.rb +6 -4
- data/rakelib/compile.rake +15 -0
- data/rakelib/integration_test.rake +43 -0
- data/rakelib/performance.rake +43 -0
- data/rakelib/rubocop.rake +6 -0
- data/rakelib/unit_test.rake +14 -0
- data/test/integration_test.rb +11 -0
- data/test/liquid_test_helper.rb +21 -0
- data/test/test_helper.rb +14 -2
- data/test/unit/block_test.rb +130 -0
- data/test/unit/context_test.rb +83 -0
- data/test/unit/expression_test.rb +186 -0
- data/test/unit/gc_stress_test.rb +28 -0
- data/test/unit/raw_test.rb +19 -0
- data/test/unit/resource_limits_test.rb +50 -0
- data/test/unit/tokenizer_test.rb +90 -20
- data/test/unit/variable_test.rb +214 -58
- metadata +80 -17
- data/.travis.yml +0 -6
- data/test/liquid_test.rb +0 -11
data/test/unit/variable_test.rb
CHANGED
@@ -1,106 +1,262 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
-
|
2
|
+
# frozen_string_literal: true
|
3
3
|
|
4
|
-
|
4
|
+
require "test_helper"
|
5
|
+
|
6
|
+
class VariableTest < Minitest::Test
|
5
7
|
def test_variable_parse
|
6
|
-
assert_equal
|
7
|
-
assert_equal
|
8
|
-
assert_equal
|
9
|
-
assert_equal
|
10
|
-
assert_equal
|
11
|
-
assert_equal
|
12
|
-
assert_equal
|
13
|
-
assert_equal [lookup('a-2'), []], variable_parse('a-2')
|
8
|
+
assert_equal("world", variable_strict_parse("hello").render!({ "hello" => "world" }))
|
9
|
+
assert_equal("world", variable_strict_parse('"world"').render!)
|
10
|
+
assert_equal("answer", variable_strict_parse('hello["world"]').render!({ "hello" => { "world" => "answer" } }))
|
11
|
+
assert_equal("answer", variable_strict_parse("question?").render!({ "question?" => "answer" }))
|
12
|
+
assert_equal("value", variable_strict_parse("[meta]").render!({ "meta" => "key", "key" => "value" }))
|
13
|
+
assert_equal("result", variable_strict_parse("a-b").render!({ "a-b" => "result" }))
|
14
|
+
assert_equal("result", variable_strict_parse("a-2").render!({ "a-2" => "result" }))
|
14
15
|
end
|
15
16
|
|
16
17
|
def test_strictness
|
17
|
-
assert_raises(Liquid::SyntaxError) {
|
18
|
-
assert_raises(Liquid::SyntaxError) {
|
19
|
-
assert_raises(Liquid::SyntaxError) {
|
20
|
-
assert_raises(Liquid::SyntaxError) {
|
21
|
-
assert_raises(Liquid::SyntaxError) {
|
22
|
-
|
23
|
-
['a .b', 'a. b', 'a . b'].each do |var|
|
24
|
-
assert_raises(Liquid::SyntaxError) { variable_parse(var) }
|
25
|
-
end
|
18
|
+
assert_raises(Liquid::SyntaxError) { variable_strict_parse(' hello["world\']" ') }
|
19
|
+
assert_raises(Liquid::SyntaxError) { variable_strict_parse(" -..") }
|
20
|
+
assert_raises(Liquid::SyntaxError) { variable_strict_parse("question?mark") }
|
21
|
+
assert_raises(Liquid::SyntaxError) { variable_strict_parse("123.foo") }
|
22
|
+
assert_raises(Liquid::SyntaxError) { variable_strict_parse(" | nothing") }
|
26
23
|
|
27
|
-
[
|
28
|
-
assert_raises(Liquid::SyntaxError) {
|
24
|
+
["a -b", "a- b", "a - b"].each do |var|
|
25
|
+
assert_raises(Liquid::SyntaxError) { variable_strict_parse(var) }
|
29
26
|
end
|
30
27
|
end
|
31
28
|
|
32
29
|
def test_literals
|
33
|
-
assert_equal
|
34
|
-
assert_equal
|
35
|
-
assert_equal
|
30
|
+
assert_equal("", variable_strict_parse("").render!)
|
31
|
+
assert_equal("true", variable_strict_parse("true").render!)
|
32
|
+
assert_equal("", variable_strict_parse("nil").render!)
|
33
|
+
assert_equal("123.4", variable_strict_parse("123.4").render!)
|
34
|
+
|
35
|
+
assert_equal("blank_value", variable_strict_parse("[blank]").render!({ "" => "blank_value" }))
|
36
|
+
assert_equal("result", variable_strict_parse("[true][blank]").render!({ true => { "" => "result" } }))
|
37
|
+
assert_equal("result", variable_strict_parse('x["size"]').render!({ "x" => { "size" => "result" } }))
|
38
|
+
assert_equal("result", variable_strict_parse("blank.x").render!({ "blank" => { "x" => "result" } }))
|
39
|
+
assert_equal("result", variable_strict_parse('blank["x"]').render!({ "blank" => { "x" => "result" } }))
|
40
|
+
end
|
41
|
+
|
42
|
+
module InspectCallFilters
|
43
|
+
def filter1(input, *args)
|
44
|
+
inspect_call(__method__, input, args)
|
45
|
+
end
|
46
|
+
|
47
|
+
def filter2(input, *args)
|
48
|
+
inspect_call(__method__, input, args)
|
49
|
+
end
|
50
|
+
|
51
|
+
private
|
36
52
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
assert_equal [lookup('x["size"]'), []], variable_parse('x["size"]')
|
53
|
+
def inspect_call(filter_name, input, args)
|
54
|
+
"{ filter: #{filter_name.inspect}, input: #{input.inspect}, args: #{args.inspect} }"
|
55
|
+
end
|
41
56
|
end
|
42
57
|
|
43
58
|
def test_variable_filter
|
44
|
-
|
45
|
-
|
46
|
-
|
59
|
+
context = { "name" => "Bob" }
|
60
|
+
|
61
|
+
filter1_output = variable_strict_parse("name | filter1").render!(context, filters: [InspectCallFilters])
|
62
|
+
assert_equal('{ filter: :filter1, input: "Bob", args: [] }', filter1_output)
|
63
|
+
|
64
|
+
filter2_output = variable_strict_parse("name | filter1 | filter2").render!(context, filters: [InspectCallFilters])
|
65
|
+
assert_equal("{ filter: :filter2, input: #{filter1_output.inspect}, args: [] }", filter2_output)
|
47
66
|
end
|
48
67
|
|
49
68
|
def test_variable_filter_args
|
50
|
-
|
51
|
-
|
69
|
+
context = { "name" => "Bob", "abc" => "xyz" }
|
70
|
+
render_opts = { filters: [InspectCallFilters] }
|
52
71
|
|
53
|
-
|
72
|
+
filter1_output = variable_strict_parse("name | filter1: abc").render!(context, render_opts)
|
73
|
+
assert_equal('{ filter: :filter1, input: "Bob", args: ["xyz"] }', filter1_output)
|
54
74
|
|
55
|
-
|
56
|
-
|
75
|
+
filter2_output = variable_strict_parse("name | filter1: abc | filter2: abc").render!(context, render_opts)
|
76
|
+
assert_equal("{ filter: :filter2, input: #{filter1_output.inspect}, args: [\"xyz\"] }", filter2_output)
|
57
77
|
|
58
|
-
|
59
|
-
variable_parse('name | filter : a , b : c , d : e')
|
78
|
+
context = { "name" => "Bob", "a" => 1, "c" => 3, "e" => 5 }
|
60
79
|
|
61
|
-
|
62
|
-
|
80
|
+
output = variable_strict_parse("name | filter1 : a , b : c , d : e").render!(context, render_opts)
|
81
|
+
assert_equal('{ filter: :filter1, input: "Bob", args: [1, {"b"=>3, "d"=>5}] }', output)
|
82
|
+
|
83
|
+
assert_raises(Liquid::SyntaxError) do
|
84
|
+
variable_strict_parse("name | filter : a : b : c : d : e")
|
63
85
|
end
|
64
86
|
end
|
65
87
|
|
66
88
|
def test_unicode_strings
|
67
|
-
|
68
|
-
|
89
|
+
string_content = "å߀êùidhtлsԁѵ߀ráƙìstɦeƅêstpcmáѕterrãcêcհèrr"
|
90
|
+
assert_equal(string_content, variable_strict_parse("\"#{string_content}\"").render!)
|
69
91
|
end
|
70
92
|
|
71
93
|
def test_broken_unicode_errors
|
72
94
|
err = assert_raises(Liquid::SyntaxError) do
|
73
95
|
Liquid::Template.parse("test {{ \xC2\xA0 test }}", error_mode: :strict)
|
74
96
|
end
|
75
|
-
assert
|
97
|
+
assert(err.message)
|
76
98
|
end
|
77
99
|
|
78
100
|
def test_callbacks
|
79
|
-
variable_parses = 0
|
80
101
|
variable_fallbacks = 0
|
81
102
|
|
82
103
|
callbacks = {
|
83
|
-
|
84
|
-
variable_fallback: lambda { variable_fallbacks += 1 }
|
104
|
+
variable_fallback: lambda { variable_fallbacks += 1 },
|
85
105
|
}
|
86
106
|
|
87
|
-
Liquid::
|
88
|
-
assert_equal
|
89
|
-
assert_equal 0, variable_fallbacks
|
107
|
+
Liquid::Template.parse("{{abc}}", error_mode: :lax, stats_callbacks: callbacks)
|
108
|
+
assert_equal(0, variable_fallbacks)
|
90
109
|
|
91
|
-
Liquid::
|
92
|
-
assert_equal
|
93
|
-
assert_equal 1, variable_fallbacks
|
110
|
+
Liquid::Template.parse("{{@!#}}", error_mode: :lax, stats_callbacks: callbacks)
|
111
|
+
assert_equal(1, variable_fallbacks)
|
94
112
|
end
|
95
113
|
|
96
|
-
|
114
|
+
def test_write_string
|
115
|
+
output = Liquid::Template.parse("{{ str }}").render({ "str" => "foo" })
|
116
|
+
assert_equal("foo", output)
|
117
|
+
end
|
118
|
+
|
119
|
+
def test_write_fixnum
|
120
|
+
output = Liquid::Template.parse("{{ num }}").render({ "num" => 123456 })
|
121
|
+
assert_equal("123456", output)
|
122
|
+
end
|
123
|
+
|
124
|
+
def test_write_array
|
125
|
+
output = Liquid::Template.parse("{{ ary }}").render({ "ary" => ["foo", 123, ["nested", "ary"], nil, 0.5] })
|
126
|
+
assert_equal("foo123nestedary0.5", output)
|
127
|
+
end
|
128
|
+
|
129
|
+
def test_write_nil
|
130
|
+
output = Liquid::Template.parse("{{ obj }}").render({ "obj" => nil })
|
131
|
+
assert_equal("", output)
|
132
|
+
end
|
133
|
+
|
134
|
+
class StringConvertible
|
135
|
+
def initialize(as_string)
|
136
|
+
@as_string = as_string
|
137
|
+
end
|
138
|
+
|
139
|
+
def to_s
|
140
|
+
@as_string
|
141
|
+
end
|
142
|
+
|
143
|
+
def to_liquid
|
144
|
+
self
|
145
|
+
end
|
146
|
+
end
|
147
|
+
|
148
|
+
def test_write_to_s_convertible_object
|
149
|
+
output = Liquid::Template.parse("{{ obj }}").render!({ "obj" => StringConvertible.new("foo") })
|
150
|
+
assert_equal("foo", output)
|
151
|
+
end
|
152
|
+
|
153
|
+
def test_write_object_with_broken_to_s
|
154
|
+
template = Liquid::Template.parse("{{ obj }}")
|
155
|
+
exc = assert_raises(TypeError) do
|
156
|
+
template.render!({ "obj" => StringConvertible.new(123) })
|
157
|
+
end
|
158
|
+
assert_equal(
|
159
|
+
"VariableTest::StringConvertible#to_s returned a non-String convertible value of type Integer",
|
160
|
+
exc.message
|
161
|
+
)
|
162
|
+
end
|
163
|
+
|
164
|
+
class DerivedString < String
|
165
|
+
def to_s
|
166
|
+
self
|
167
|
+
end
|
168
|
+
end
|
169
|
+
|
170
|
+
def test_write_derived_string
|
171
|
+
output = Liquid::Template.parse("{{ obj }}").render!({ "obj" => DerivedString.new("bar") })
|
172
|
+
assert_equal("bar", output)
|
173
|
+
end
|
174
|
+
|
175
|
+
def test_filter_without_args
|
176
|
+
output = Liquid::Template.parse("{{ var | upcase }}").render({ "var" => "Hello" })
|
177
|
+
assert_equal("HELLO", output)
|
178
|
+
end
|
179
|
+
|
180
|
+
def test_filter_with_const_arg
|
181
|
+
output = Liquid::Template.parse("{{ x | plus: 2 }}").render({ "x" => 3 })
|
182
|
+
assert_equal("5", output)
|
183
|
+
end
|
184
|
+
|
185
|
+
def test_filter_with_variable_arg
|
186
|
+
output = Liquid::Template.parse("{{ x | plus: y }}").render({ "x" => 10, "y" => 123 })
|
187
|
+
assert_equal("133", output)
|
188
|
+
end
|
97
189
|
|
98
|
-
def
|
99
|
-
|
100
|
-
|
190
|
+
def test_filter_with_variable_arg_after_const_arg
|
191
|
+
output = Liquid::Template.parse("{{ ary | slice: 1, 2 }}").render({ "ary" => [1, 2, 3, 4] })
|
192
|
+
assert_equal("23", output)
|
101
193
|
end
|
102
194
|
|
103
|
-
def
|
104
|
-
Liquid::
|
195
|
+
def test_filter_with_const_keyword_arg
|
196
|
+
output = Liquid::Template.parse("{{ value | default: 'None' }}").render({ "value" => false })
|
197
|
+
assert_equal("None", output)
|
198
|
+
|
199
|
+
output = Liquid::Template.parse("{{ value | default: 'None', allow_false: true }}").render({ "value" => false })
|
200
|
+
assert_equal("false", output)
|
201
|
+
end
|
202
|
+
|
203
|
+
def test_filter_with_variable_keyword_arg
|
204
|
+
template = Liquid::Template.parse("{{ value | default: 'None', allow_false: false_allowed }}")
|
205
|
+
|
206
|
+
assert_equal("None", template.render({ "value" => false, "false_allowed" => false }))
|
207
|
+
assert_equal("false", template.render({ "value" => false, "false_allowed" => true }))
|
208
|
+
end
|
209
|
+
|
210
|
+
def test_filter_error
|
211
|
+
output = Liquid::Template.parse("before ({{ ary | concat: 2 }}) after").render({ "ary" => [1] })
|
212
|
+
assert_equal("before (Liquid error: concat filter requires an array argument) after", output)
|
213
|
+
end
|
214
|
+
|
215
|
+
def test_render_variable_object
|
216
|
+
variable = Liquid::Variable.new("ary | concat: ary2", Liquid::ParseContext.new)
|
217
|
+
assert_instance_of(Liquid::C::VariableExpression, variable.name)
|
218
|
+
|
219
|
+
context = Liquid::Context.new("ary" => [1], "ary2" => [2])
|
220
|
+
assert_equal([1, 2], variable.render(context))
|
221
|
+
|
222
|
+
context["ary2"] = 2
|
223
|
+
exc = assert_raises(Liquid::ArgumentError) do
|
224
|
+
variable.render(context)
|
225
|
+
end
|
226
|
+
assert_equal("Liquid error: concat filter requires an array argument", exc.message)
|
227
|
+
end
|
228
|
+
|
229
|
+
def test_filter_argument_error_translation
|
230
|
+
variable = Liquid::Variable.new("'some words' | split", Liquid::ParseContext.new)
|
231
|
+
context = Liquid::Context.new
|
232
|
+
exc = assert_raises(Liquid::ArgumentError) { variable.render(context) }
|
233
|
+
assert_equal("Liquid error: wrong number of arguments (given 1, expected 2)", exc.message)
|
234
|
+
end
|
235
|
+
|
236
|
+
class IntegerDrop < Liquid::Drop
|
237
|
+
def initialize(value)
|
238
|
+
super()
|
239
|
+
@value = value.to_i
|
240
|
+
end
|
241
|
+
|
242
|
+
def to_liquid_value
|
243
|
+
@value
|
244
|
+
end
|
245
|
+
end
|
246
|
+
|
247
|
+
def test_to_liquid_value_on_variable_lookup
|
248
|
+
context = {
|
249
|
+
"number" => IntegerDrop.new("1"),
|
250
|
+
"list" => [1, 2, 3, 4, 5],
|
251
|
+
}
|
252
|
+
|
253
|
+
output = variable_strict_parse("list[number]").render!(context)
|
254
|
+
assert_equal("2", output)
|
255
|
+
end
|
256
|
+
|
257
|
+
private
|
258
|
+
|
259
|
+
def variable_strict_parse(markup)
|
260
|
+
Liquid::Template.parse("{{#{markup}}}", error_mode: :strict)
|
105
261
|
end
|
106
262
|
end
|
metadata
CHANGED
@@ -1,43 +1,58 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: liquid-c
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
+
- Justin Li
|
7
8
|
- Dylan Thacker-Smith
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date:
|
12
|
+
date: 2022-02-08 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: liquid
|
15
16
|
requirement: !ruby/object:Gem::Requirement
|
16
17
|
requirements:
|
17
|
-
- - "
|
18
|
+
- - ">="
|
18
19
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
20
|
+
version: 5.0.1
|
20
21
|
type: :runtime
|
21
22
|
prerelease: false
|
22
23
|
version_requirements: !ruby/object:Gem::Requirement
|
23
24
|
requirements:
|
24
|
-
- - "
|
25
|
+
- - ">="
|
25
26
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
27
|
+
version: 5.0.1
|
27
28
|
- !ruby/object:Gem::Dependency
|
28
29
|
name: bundler
|
29
30
|
requirement: !ruby/object:Gem::Requirement
|
30
31
|
requirements:
|
31
|
-
- - "
|
32
|
+
- - ">="
|
32
33
|
- !ruby/object:Gem::Version
|
33
34
|
version: '1.5'
|
34
35
|
type: :development
|
35
36
|
prerelease: false
|
36
37
|
version_requirements: !ruby/object:Gem::Requirement
|
37
38
|
requirements:
|
38
|
-
- - "
|
39
|
+
- - ">="
|
39
40
|
- !ruby/object:Gem::Version
|
40
41
|
version: '1.5'
|
42
|
+
- !ruby/object:Gem::Dependency
|
43
|
+
name: minitest
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - ">="
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: '0'
|
49
|
+
type: :development
|
50
|
+
prerelease: false
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - ">="
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '0'
|
41
56
|
- !ruby/object:Gem::Dependency
|
42
57
|
name: rake
|
43
58
|
requirement: !ruby/object:Gem::Requirement
|
@@ -82,43 +97,85 @@ dependencies:
|
|
82
97
|
version: '0'
|
83
98
|
description:
|
84
99
|
email:
|
85
|
-
-
|
100
|
+
- gems@shopify.com
|
86
101
|
executables: []
|
87
102
|
extensions:
|
88
103
|
- ext/liquid_c/extconf.rb
|
89
104
|
extra_rdoc_files: []
|
90
105
|
files:
|
106
|
+
- ".github/workflows/liquid.yml"
|
91
107
|
- ".gitignore"
|
92
|
-
- ".
|
108
|
+
- ".rubocop.yml"
|
93
109
|
- Gemfile
|
94
110
|
- LICENSE.txt
|
95
111
|
- README.md
|
96
112
|
- Rakefile
|
97
113
|
- ext/liquid_c/block.c
|
98
114
|
- ext/liquid_c/block.h
|
115
|
+
- ext/liquid_c/c_buffer.c
|
116
|
+
- ext/liquid_c/c_buffer.h
|
117
|
+
- ext/liquid_c/context.c
|
118
|
+
- ext/liquid_c/context.h
|
119
|
+
- ext/liquid_c/document_body.c
|
120
|
+
- ext/liquid_c/document_body.h
|
121
|
+
- ext/liquid_c/expression.c
|
122
|
+
- ext/liquid_c/expression.h
|
99
123
|
- ext/liquid_c/extconf.rb
|
124
|
+
- ext/liquid_c/intutil.h
|
100
125
|
- ext/liquid_c/lexer.c
|
101
126
|
- ext/liquid_c/lexer.h
|
102
127
|
- ext/liquid_c/liquid.c
|
103
128
|
- ext/liquid_c/liquid.h
|
129
|
+
- ext/liquid_c/parse_context.c
|
130
|
+
- ext/liquid_c/parse_context.h
|
104
131
|
- ext/liquid_c/parser.c
|
105
132
|
- ext/liquid_c/parser.h
|
133
|
+
- ext/liquid_c/raw.c
|
134
|
+
- ext/liquid_c/raw.h
|
135
|
+
- ext/liquid_c/resource_limits.c
|
136
|
+
- ext/liquid_c/resource_limits.h
|
137
|
+
- ext/liquid_c/stringutil.h
|
106
138
|
- ext/liquid_c/tokenizer.c
|
107
139
|
- ext/liquid_c/tokenizer.h
|
140
|
+
- ext/liquid_c/usage.c
|
141
|
+
- ext/liquid_c/usage.h
|
108
142
|
- ext/liquid_c/variable.c
|
109
143
|
- ext/liquid_c/variable.h
|
144
|
+
- ext/liquid_c/variable_lookup.c
|
145
|
+
- ext/liquid_c/variable_lookup.h
|
146
|
+
- ext/liquid_c/vm.c
|
147
|
+
- ext/liquid_c/vm.h
|
148
|
+
- ext/liquid_c/vm_assembler.c
|
149
|
+
- ext/liquid_c/vm_assembler.h
|
150
|
+
- ext/liquid_c/vm_assembler_pool.c
|
151
|
+
- ext/liquid_c/vm_assembler_pool.h
|
110
152
|
- lib/liquid/c.rb
|
153
|
+
- lib/liquid/c/compile_ext.rb
|
111
154
|
- lib/liquid/c/version.rb
|
112
155
|
- liquid-c.gemspec
|
113
156
|
- performance.rb
|
114
|
-
-
|
157
|
+
- performance/c_profile.rb
|
158
|
+
- rakelib/compile.rake
|
159
|
+
- rakelib/integration_test.rake
|
160
|
+
- rakelib/performance.rake
|
161
|
+
- rakelib/rubocop.rake
|
162
|
+
- rakelib/unit_test.rake
|
163
|
+
- test/integration_test.rb
|
164
|
+
- test/liquid_test_helper.rb
|
115
165
|
- test/test_helper.rb
|
166
|
+
- test/unit/block_test.rb
|
167
|
+
- test/unit/context_test.rb
|
168
|
+
- test/unit/expression_test.rb
|
169
|
+
- test/unit/gc_stress_test.rb
|
170
|
+
- test/unit/raw_test.rb
|
171
|
+
- test/unit/resource_limits_test.rb
|
116
172
|
- test/unit/tokenizer_test.rb
|
117
173
|
- test/unit/variable_test.rb
|
118
|
-
homepage:
|
174
|
+
homepage: https://github.com/shopify/liquid-c
|
119
175
|
licenses:
|
120
176
|
- MIT
|
121
|
-
metadata:
|
177
|
+
metadata:
|
178
|
+
allowed_push_host: https://rubygems.org
|
122
179
|
post_install_message:
|
123
180
|
rdoc_options: []
|
124
181
|
require_paths:
|
@@ -127,20 +184,26 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
127
184
|
requirements:
|
128
185
|
- - ">="
|
129
186
|
- !ruby/object:Gem::Version
|
130
|
-
version:
|
187
|
+
version: 2.5.0
|
131
188
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
132
189
|
requirements:
|
133
190
|
- - ">="
|
134
191
|
- !ruby/object:Gem::Version
|
135
192
|
version: '0'
|
136
193
|
requirements: []
|
137
|
-
|
138
|
-
rubygems_version: 2.2.2
|
194
|
+
rubygems_version: 3.2.20
|
139
195
|
signing_key:
|
140
196
|
specification_version: 4
|
141
197
|
summary: Liquid performance extension in C
|
142
198
|
test_files:
|
143
|
-
- test/
|
199
|
+
- test/integration_test.rb
|
200
|
+
- test/liquid_test_helper.rb
|
144
201
|
- test/test_helper.rb
|
202
|
+
- test/unit/block_test.rb
|
203
|
+
- test/unit/context_test.rb
|
204
|
+
- test/unit/expression_test.rb
|
205
|
+
- test/unit/gc_stress_test.rb
|
206
|
+
- test/unit/raw_test.rb
|
207
|
+
- test/unit/resource_limits_test.rb
|
145
208
|
- test/unit/tokenizer_test.rb
|
146
209
|
- test/unit/variable_test.rb
|
data/.travis.yml
DELETED
data/test/liquid_test.rb
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
liquid_lib_dir = $LOAD_PATH.detect{ |p| File.exists?(File.join(p, 'liquid.rb')) }
|
2
|
-
liquid_test_dir = File.join(File.dirname(liquid_lib_dir), 'test')
|
3
|
-
$LOAD_PATH << liquid_test_dir
|
4
|
-
|
5
|
-
require 'test_helper'
|
6
|
-
require 'liquid/c'
|
7
|
-
|
8
|
-
test_files = FileList[File.join(liquid_test_dir, 'integration/**/*_test.rb')]
|
9
|
-
test_files.each do |test_file|
|
10
|
-
require test_file
|
11
|
-
end
|