curlybars 1.3.1 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/curlybars/node/if_else.rb +1 -1
- data/lib/curlybars/node/unless_else.rb +1 -1
- data/lib/curlybars/rendering_support.rb +1 -1
- data/lib/curlybars/version.rb +1 -1
- data/spec/integration/node/helper_spec.rb +12 -0
- data/spec/integration/node/if_spec.rb +2 -2
- data/spec/integration/node/unless_else_spec.rb +2 -2
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 92b6cb3082b3fc52f509b72511b93937529f57170d4f8751f989e17727418889
|
4
|
+
data.tar.gz: cbe9843e0852ccdb2bd9aabcb4c77e4856de40e60bbc01f6dc10d17e3987754a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a3cb40974bd6568a73b5640452403da9b40e63da6bc152fadd4ea375961cb8c5de21d561f094f5b181359c791ddf4237a0a58022ae2bd3b38d012748ae9eb6b
|
7
|
+
data.tar.gz: 4bd84f5a24ee7fcb3f59fac17844d65638f496f22c263fc1e94c47aac65c84e848718f1695a20421ade814c9e7e98f17b0e10d58b14920fccb33d92987606e6b
|
@@ -101,7 +101,7 @@ module Curlybars
|
|
101
101
|
|
102
102
|
def cached_call(meth)
|
103
103
|
return cached_calls[meth] if cached_calls.key? meth
|
104
|
-
instrument(meth) { cached_calls[meth] = meth.call }
|
104
|
+
instrument(meth) { cached_calls[meth] = meth.call(*arguments_for_signature(meth, [], {})) }
|
105
105
|
end
|
106
106
|
|
107
107
|
def call(helper, helper_path, helper_position, arguments, options, &block)
|
data/lib/curlybars/version.rb
CHANGED
@@ -15,6 +15,18 @@ describe "{{helper context key=value}}" do
|
|
15
15
|
HTML
|
16
16
|
end
|
17
17
|
|
18
|
+
it "calls a helper without arguments in an if statement" do
|
19
|
+
template = Curlybars.compile(<<-HBS)
|
20
|
+
{{#if print_args_and_options}}
|
21
|
+
{{print_args_and_options 'first' 'second'}}
|
22
|
+
{{/if}}
|
23
|
+
HBS
|
24
|
+
|
25
|
+
expect(eval(template)).to resemble(<<-HTML)
|
26
|
+
first, second, key=
|
27
|
+
HTML
|
28
|
+
end
|
29
|
+
|
18
30
|
it "passes two arguments and options" do
|
19
31
|
template = Curlybars.compile(<<-HBS)
|
20
32
|
{{print_args_and_options 'first' 'second' key='value'}}
|
@@ -140,7 +140,7 @@ describe "{{#if}}...{{/if}}" do
|
|
140
140
|
expect(errors).not_to be_empty
|
141
141
|
end
|
142
142
|
|
143
|
-
it "validates
|
143
|
+
it "validates without errors the helper as condition" do
|
144
144
|
dependency_tree = { helper: :helper }
|
145
145
|
|
146
146
|
source = <<-HBS
|
@@ -149,7 +149,7 @@ describe "{{#if}}...{{/if}}" do
|
|
149
149
|
|
150
150
|
errors = Curlybars.validate(dependency_tree, source)
|
151
151
|
|
152
|
-
expect(errors).
|
152
|
+
expect(errors).to be_empty
|
153
153
|
end
|
154
154
|
end
|
155
155
|
end
|
@@ -96,7 +96,7 @@ describe "{{#unless}}...{{else}}...{{/unless}}" do
|
|
96
96
|
expect(errors).not_to be_empty
|
97
97
|
end
|
98
98
|
|
99
|
-
it "validates
|
99
|
+
it "validates without errors when using a helper in the condition" do
|
100
100
|
dependency_tree = { helper: :helper }
|
101
101
|
|
102
102
|
source = <<-HBS
|
@@ -105,7 +105,7 @@ describe "{{#unless}}...{{else}}...{{/unless}}" do
|
|
105
105
|
|
106
106
|
errors = Curlybars.validate(dependency_tree, source)
|
107
107
|
|
108
|
-
expect(errors).
|
108
|
+
expect(errors).to be_empty
|
109
109
|
end
|
110
110
|
|
111
111
|
it "validates with errors the nested unless_template" do
|
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.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Libo Cannici
|
@@ -10,10 +10,11 @@ authors:
|
|
10
10
|
- Mauro Codella
|
11
11
|
- Luís Almeida
|
12
12
|
- Andreas Garnæs
|
13
|
+
- Augusto Silva
|
13
14
|
autorequire:
|
14
15
|
bindir: bin
|
15
16
|
cert_chain: []
|
16
|
-
date: 2020-
|
17
|
+
date: 2020-09-29 00:00:00.000000000 Z
|
17
18
|
dependencies:
|
18
19
|
- !ruby/object:Gem::Dependency
|
19
20
|
name: actionpack
|
@@ -190,7 +191,7 @@ dependencies:
|
|
190
191
|
description: |-
|
191
192
|
A view layer for your Rails apps that separates structure and logic, using Handlebars templates.
|
192
193
|
Strongly inspired by Curly Template gem by Daniel Schierbeck.
|
193
|
-
email:
|
194
|
+
email: vikings@zendesk.com
|
194
195
|
executables: []
|
195
196
|
extensions: []
|
196
197
|
extra_rdoc_files: []
|
@@ -292,7 +293,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
292
293
|
- !ruby/object:Gem::Version
|
293
294
|
version: '0'
|
294
295
|
requirements: []
|
295
|
-
rubygems_version: 3.0.
|
296
|
+
rubygems_version: 3.0.3
|
296
297
|
signing_key:
|
297
298
|
specification_version: 4
|
298
299
|
summary: Create your views using Handlebars templates!
|