liquid 3.0.0 → 3.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 15b38ad40486ed2c0f9af07847fd0328c1ebcd76
4
- data.tar.gz: 1bf5887d011005c058d0ed524d03e40926c96d59
3
+ metadata.gz: 764c2e81dc860fd817e71e6fd689b45a66bfee70
4
+ data.tar.gz: 2340fffb775ff15bfac14cb84df48a5a5556225f
5
5
  SHA512:
6
- metadata.gz: 176f0aa1184d56a180447e3353d90dc31a24b7c203c107dd80446520667b4f87a9f91eed07c7f0cfbd53c9f69572f2d818201d98d11b3ba1c21e4635f657a8ca
7
- data.tar.gz: 81da9c0069bccfc02de2e5da4e78d1b8dddf2b382018c5e50d7c32a5a56c6df0b1f06187c78274b7e6f170d8d5d475e776f31f903663a861df636565c946e567
6
+ metadata.gz: 6315676f23fbe9883c76df24f32ff92668febe745cb7d632004b77d07938fab98d76ed62a1afea594a1ff1c341cc1c1d83dbe13754064aedb1c2c947a1f62db4
7
+ data.tar.gz: 5516c2fe89c5e55fdfa788521cc7b3973e47ef9a206c942d2d8c1e3c184ed692ef65dcca596f273ef84b3b568c013a7275852d120d41008472cb8160aa36278b
@@ -11,7 +11,7 @@ module Liquid
11
11
  # in a sidebar or footer.
12
12
  #
13
13
  class Capture < Block
14
- Syntax = /(\w+)/
14
+ Syntax = /(#{VariableSignature}+)/o
15
15
 
16
16
  def initialize(tag_name, markup, options)
17
17
  super
@@ -42,7 +42,6 @@ module Liquid
42
42
  'index0'.freeze => index,
43
43
  'col'.freeze => col + 1,
44
44
  'col0'.freeze => col,
45
- 'index0'.freeze => index,
46
45
  'rindex'.freeze => length - index,
47
46
  'rindex0'.freeze => length - index - 1,
48
47
  'first'.freeze => (index == 0),
@@ -1,4 +1,4 @@
1
1
  # encoding: utf-8
2
2
  module Liquid
3
- VERSION = "3.0.0"
3
+ VERSION = "3.0.1"
4
4
  end
@@ -3,6 +3,16 @@ require 'test_helper'
3
3
  class AssignTest < Minitest::Test
4
4
  include Liquid
5
5
 
6
+ def test_assign_with_hyphen_in_variable_name
7
+ template_source = <<-END_TEMPLATE
8
+ {% assign this-thing = 'Print this-thing' %}
9
+ {{ this-thing }}
10
+ END_TEMPLATE
11
+ template = Template.parse(template_source)
12
+ rendered = template.render!
13
+ assert_equal "Print this-thing", rendered.strip
14
+ end
15
+
6
16
  def test_assigned_variable
7
17
  assert_template_result('.foo.',
8
18
  '{% assign foo = values %}.{{ foo[0] }}.',
@@ -7,6 +7,16 @@ class CaptureTest < Minitest::Test
7
7
  assert_template_result("test string", "{% capture 'var' %}test string{% endcapture %}{{var}}", {})
8
8
  end
9
9
 
10
+ def test_capture_with_hyphen_in_variable_name
11
+ template_source = <<-END_TEMPLATE
12
+ {% capture this-thing %}Print this-thing{% endcapture %}
13
+ {{ this-thing }}
14
+ END_TEMPLATE
15
+ template = Template.parse(template_source)
16
+ rendered = template.render!
17
+ assert_equal "Print this-thing", rendered.strip
18
+ end
19
+
10
20
  def test_capture_to_variable_from_outer_scope_if_existing
11
21
  template_source = <<-END_TEMPLATE
12
22
  {% assign var = '' %}
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: 3.0.0
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Luetke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-12 00:00:00.000000000 Z
11
+ date: 2015-01-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -161,53 +161,53 @@ required_rubygems_version: !ruby/object:Gem::Requirement
161
161
  version: 1.3.7
162
162
  requirements: []
163
163
  rubyforge_project:
164
- rubygems_version: 2.2.2
164
+ rubygems_version: 2.2.0
165
165
  signing_key:
166
166
  specification_version: 4
167
167
  summary: A secure, non-evaling end user template engine with aesthetic markup.
168
168
  test_files:
169
- - test/unit/tags/for_tag_unit_test.rb
170
- - test/unit/tags/if_tag_unit_test.rb
171
- - test/unit/tags/case_tag_unit_test.rb
172
- - test/unit/parser_unit_test.rb
173
- - test/unit/condition_unit_test.rb
174
- - test/unit/file_system_unit_test.rb
175
- - test/unit/regexp_unit_test.rb
176
- - test/unit/tag_unit_test.rb
177
- - test/unit/i18n_unit_test.rb
178
- - test/unit/tokenizer_unit_test.rb
179
- - test/unit/strainer_unit_test.rb
180
- - test/unit/template_unit_test.rb
181
- - test/unit/module_ex_unit_test.rb
182
- - test/unit/lexer_unit_test.rb
183
- - test/unit/block_unit_test.rb
184
- - test/unit/context_unit_test.rb
185
- - test/unit/variable_unit_test.rb
186
- - test/test_helper.rb
169
+ - test/fixtures/en_locale.yml
170
+ - test/integration/assign_test.rb
171
+ - test/integration/blank_test.rb
172
+ - test/integration/capture_test.rb
173
+ - test/integration/context_test.rb
174
+ - test/integration/drop_test.rb
175
+ - test/integration/error_handling_test.rb
176
+ - test/integration/filter_test.rb
177
+ - test/integration/hash_ordering_test.rb
178
+ - test/integration/output_test.rb
179
+ - test/integration/parsing_quirks_test.rb
180
+ - test/integration/render_profiling_test.rb
181
+ - test/integration/security_test.rb
182
+ - test/integration/standard_filter_test.rb
183
+ - test/integration/tags/break_tag_test.rb
184
+ - test/integration/tags/continue_tag_test.rb
187
185
  - test/integration/tags/for_tag_test.rb
188
186
  - test/integration/tags/if_else_tag_test.rb
189
187
  - test/integration/tags/include_tag_test.rb
190
- - test/integration/tags/continue_tag_test.rb
188
+ - test/integration/tags/increment_tag_test.rb
191
189
  - test/integration/tags/raw_tag_test.rb
192
- - test/integration/tags/table_row_test.rb
193
190
  - test/integration/tags/standard_tag_test.rb
194
- - test/integration/tags/increment_tag_test.rb
195
- - test/integration/tags/unless_else_tag_test.rb
196
191
  - test/integration/tags/statements_test.rb
197
- - test/integration/tags/break_tag_test.rb
198
- - test/integration/filter_test.rb
199
- - test/integration/render_profiling_test.rb
200
- - test/integration/parsing_quirks_test.rb
201
- - test/integration/drop_test.rb
202
- - test/integration/hash_ordering_test.rb
203
- - test/integration/capture_test.rb
204
- - test/integration/assign_test.rb
205
- - test/integration/output_test.rb
206
- - test/integration/error_handling_test.rb
207
- - test/integration/blank_test.rb
192
+ - test/integration/tags/table_row_test.rb
193
+ - test/integration/tags/unless_else_tag_test.rb
208
194
  - test/integration/template_test.rb
209
- - test/integration/security_test.rb
210
195
  - test/integration/variable_test.rb
211
- - test/integration/standard_filter_test.rb
212
- - test/integration/context_test.rb
213
- - test/fixtures/en_locale.yml
196
+ - test/test_helper.rb
197
+ - test/unit/block_unit_test.rb
198
+ - test/unit/condition_unit_test.rb
199
+ - test/unit/context_unit_test.rb
200
+ - test/unit/file_system_unit_test.rb
201
+ - test/unit/i18n_unit_test.rb
202
+ - test/unit/lexer_unit_test.rb
203
+ - test/unit/module_ex_unit_test.rb
204
+ - test/unit/parser_unit_test.rb
205
+ - test/unit/regexp_unit_test.rb
206
+ - test/unit/strainer_unit_test.rb
207
+ - test/unit/tag_unit_test.rb
208
+ - test/unit/tags/case_tag_unit_test.rb
209
+ - test/unit/tags/for_tag_unit_test.rb
210
+ - test/unit/tags/if_tag_unit_test.rb
211
+ - test/unit/template_unit_test.rb
212
+ - test/unit/tokenizer_unit_test.rb
213
+ - test/unit/variable_unit_test.rb