curlybars 1.1.0 → 1.1.1
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ffd4c878a09558bd0d7a796da62d69f5c871634d00a904ac949801b02fdbeeac
|
|
4
|
+
data.tar.gz: 48e2a90bb4b69275bcc619f741a28c0292a0094065a76a8223e2808a397e4f28
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: de10a323a835c7f9909ffc429ea74f178f6da7c189360256bc7b861e0785c4bdc5d8a78e40671245fe3dd45a71d6e971148424ef4f26d4c1d6d898b5a8f46e1c
|
|
7
|
+
data.tar.gz: f9c2f4bebff76ca529dacff54293d5908da92e3939c599d4c2a4138948a13e3074d874bda5303ca69f98c4ab37c4296ff02bf89fa0ad2919a760a79372f16a3b
|
data/lib/curlybars/node/path.rb
CHANGED
|
@@ -127,6 +127,10 @@ module Curlybars
|
|
|
127
127
|
return if helper?(branches)
|
|
128
128
|
message = "`#{path}` cannot resolve to a helper"
|
|
129
129
|
raise Curlybars::Error::Validate.new('not_a_helper', message, position)
|
|
130
|
+
when :not_helper
|
|
131
|
+
return unless helper?(branches)
|
|
132
|
+
message = "`#{path}` resolves to a helper"
|
|
133
|
+
raise Curlybars::Error::Validate.new('is_a_helper', message, position)
|
|
130
134
|
when :anything
|
|
131
135
|
else
|
|
132
136
|
raise "invalid type `#{check_type}`"
|
data/lib/curlybars/version.rb
CHANGED
|
@@ -139,5 +139,17 @@ describe "{{#if}}...{{/if}}" do
|
|
|
139
139
|
|
|
140
140
|
expect(errors).not_to be_empty
|
|
141
141
|
end
|
|
142
|
+
|
|
143
|
+
it "validates with errors the helper as condition" do
|
|
144
|
+
dependency_tree = { helper: :helper }
|
|
145
|
+
|
|
146
|
+
source = <<-HBS
|
|
147
|
+
{{#if helper}}{{/if}}
|
|
148
|
+
HBS
|
|
149
|
+
|
|
150
|
+
errors = Curlybars.validate(dependency_tree, source)
|
|
151
|
+
|
|
152
|
+
expect(errors).not_to be_empty
|
|
153
|
+
end
|
|
142
154
|
end
|
|
143
155
|
end
|
|
@@ -96,6 +96,18 @@ describe "{{#unless}}...{{else}}...{{/unless}}" do
|
|
|
96
96
|
expect(errors).not_to be_empty
|
|
97
97
|
end
|
|
98
98
|
|
|
99
|
+
it "validates with errors the helper as condition" do
|
|
100
|
+
dependency_tree = { helper: :helper }
|
|
101
|
+
|
|
102
|
+
source = <<-HBS
|
|
103
|
+
{{#unless helper}}{{/unless}}
|
|
104
|
+
HBS
|
|
105
|
+
|
|
106
|
+
errors = Curlybars.validate(dependency_tree, source)
|
|
107
|
+
|
|
108
|
+
expect(errors).not_to be_empty
|
|
109
|
+
end
|
|
110
|
+
|
|
99
111
|
it "validates with errors the nested unless_template" do
|
|
100
112
|
dependency_tree = { condition: nil }
|
|
101
113
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: curlybars
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.1.
|
|
4
|
+
version: 1.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Libo Cannici
|
|
@@ -13,7 +13,7 @@ authors:
|
|
|
13
13
|
autorequire:
|
|
14
14
|
bindir: bin
|
|
15
15
|
cert_chain: []
|
|
16
|
-
date: 2018-
|
|
16
|
+
date: 2018-08-16 00:00:00.000000000 Z
|
|
17
17
|
dependencies:
|
|
18
18
|
- !ruby/object:Gem::Dependency
|
|
19
19
|
name: actionpack
|
|
@@ -271,44 +271,44 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
271
271
|
version: '0'
|
|
272
272
|
requirements: []
|
|
273
273
|
rubyforge_project:
|
|
274
|
-
rubygems_version: 2.7.
|
|
274
|
+
rubygems_version: 2.7.3
|
|
275
275
|
signing_key:
|
|
276
276
|
specification_version: 4
|
|
277
277
|
summary: Create your views using Handlebars templates!
|
|
278
278
|
test_files:
|
|
279
|
-
- spec/
|
|
280
|
-
- spec/
|
|
281
|
-
- spec/acceptance/global_helper_spec.rb
|
|
279
|
+
- spec/curlybars/rendering_support_spec.rb
|
|
280
|
+
- spec/curlybars/method_whitelist_spec.rb
|
|
282
281
|
- spec/curlybars/configuration_spec.rb
|
|
283
|
-
- spec/curlybars/
|
|
282
|
+
- spec/curlybars/processor/tilde_spec.rb
|
|
283
|
+
- spec/curlybars/template_handler_spec.rb
|
|
284
284
|
- spec/curlybars/error/compile_spec.rb
|
|
285
|
-
- spec/curlybars/error/lex_spec.rb
|
|
286
|
-
- spec/curlybars/error/parse_spec.rb
|
|
287
285
|
- spec/curlybars/error/render_spec.rb
|
|
286
|
+
- spec/curlybars/error/parse_spec.rb
|
|
288
287
|
- spec/curlybars/error/validate_spec.rb
|
|
289
|
-
- spec/curlybars/
|
|
290
|
-
- spec/curlybars/
|
|
291
|
-
- spec/curlybars/processor/tilde_spec.rb
|
|
292
|
-
- spec/curlybars/rendering_support_spec.rb
|
|
288
|
+
- spec/curlybars/error/lex_spec.rb
|
|
289
|
+
- spec/curlybars/error/base_spec.rb
|
|
293
290
|
- spec/curlybars/safe_buffer_spec.rb
|
|
294
|
-
- spec/curlybars/
|
|
295
|
-
- spec/integration/
|
|
296
|
-
- spec/integration/comment_spec.rb
|
|
291
|
+
- spec/curlybars/lexer_spec.rb
|
|
292
|
+
- spec/integration/processor/tilde_spec.rb
|
|
297
293
|
- spec/integration/exception_spec.rb
|
|
298
|
-
- spec/integration/
|
|
299
|
-
- spec/integration/node/each_else_spec.rb
|
|
300
|
-
- spec/integration/node/each_spec.rb
|
|
294
|
+
- spec/integration/processors_spec.rb
|
|
301
295
|
- spec/integration/node/escape_spec.rb
|
|
302
|
-
- spec/integration/node/
|
|
303
|
-
- spec/integration/node/if_else_spec.rb
|
|
304
|
-
- spec/integration/node/if_spec.rb
|
|
296
|
+
- spec/integration/node/unless_else_spec.rb
|
|
305
297
|
- spec/integration/node/output_spec.rb
|
|
298
|
+
- spec/integration/node/if_spec.rb
|
|
299
|
+
- spec/integration/node/unless_spec.rb
|
|
300
|
+
- spec/integration/node/with_spec.rb
|
|
306
301
|
- spec/integration/node/partial_spec.rb
|
|
307
|
-
- spec/integration/node/
|
|
302
|
+
- spec/integration/node/block_helper_else_spec.rb
|
|
308
303
|
- spec/integration/node/root_spec.rb
|
|
309
304
|
- spec/integration/node/template_spec.rb
|
|
310
|
-
- spec/integration/node/
|
|
311
|
-
- spec/integration/node/
|
|
312
|
-
- spec/integration/node/
|
|
313
|
-
- spec/integration/
|
|
314
|
-
- spec/integration/
|
|
305
|
+
- spec/integration/node/each_spec.rb
|
|
306
|
+
- spec/integration/node/each_else_spec.rb
|
|
307
|
+
- spec/integration/node/helper_spec.rb
|
|
308
|
+
- spec/integration/node/path_spec.rb
|
|
309
|
+
- spec/integration/node/if_else_spec.rb
|
|
310
|
+
- spec/integration/comment_spec.rb
|
|
311
|
+
- spec/integration/cache_spec.rb
|
|
312
|
+
- spec/acceptance/collection_blocks_spec.rb
|
|
313
|
+
- spec/acceptance/global_helper_spec.rb
|
|
314
|
+
- spec/acceptance/application_layout_spec.rb
|