curlybars 0.9.13 → 1.0.0

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
  SHA256:
3
- metadata.gz: 301f06415961a13ec43df1d5e9a665a8acf4b82a1bf7c4b3b13c2c9a8e4927c1
4
- data.tar.gz: 239584a824c472cfb8990eb5f5222c97af8099dcde44ae260570d9ca7cf67dd6
3
+ metadata.gz: e86729cf7e665a9656c00df42c9f56248484560cce0d3403104f2618ba432574
4
+ data.tar.gz: df3684adb9eb3c9f948ab24c969754acdd5a488df6f5af14b957a18e88e5d41d
5
5
  SHA512:
6
- metadata.gz: b6aacd59a3eaacb5a98b7e7ba084d4b49ba65fe77caae1d227c7fb8469d5e238667fd1c3811d3c778adeca3a6911e04f88fac961d5a2c275ca8a492ea952dd42
7
- data.tar.gz: c7fae34b0cf744d87f72062ea07ffa7d2508e3f2d9f4c260b89c66054f0b2e016bb2d4ee28c3017fc5b1156b3c0581f18f215de1facbcd3650bcdecda4c58b08
6
+ metadata.gz: 9a89b6d7e86e26d178c818425ecb16e1316bec5faea92a3b2cb3d3381ead039a78269ca7f7efe613a9c6b3bc7e85b9190593e4d37c3293d6b773c2b262cb19c4
7
+ data.tar.gz: 3fd65df86c5eece1752ef2ed656dfad0c909f04f92c591ef5246235a3e9a787c87f51990da4ee9acb379228cb06731e54f8e9402fa28f8dee856319449c1319f
@@ -58,3 +58,4 @@ module Curlybars
58
58
  r(/.*?(?=\\|{{|\z)/m) { |text| [:TEXT, text] }
59
59
  end
60
60
  end
61
+ # rubocop:enable Style/RegexpLiteral, Style/Semicolon
@@ -1,3 +1,3 @@
1
1
  module Curlybars
2
- VERSION = '0.9.13'.freeze
2
+ VERSION = '1.0.0'.freeze
3
3
  end
@@ -1,4 +1,3 @@
1
- # rubocop:disable Layout/AlignArray
2
1
  describe Curlybars::Lexer do
3
2
  describe "{{!-- ... --}}" do
4
3
  it "skips begin of block comment" do
@@ -181,6 +180,7 @@ describe Curlybars::Lexer do
181
180
  end
182
181
  end
183
182
 
183
+ # rubocop:disable Layout/AlignArray
184
184
  describe "{{#if path}}...{{else}}...{{/if}}" do
185
185
  it "is lexed" do
186
186
  expect(lex('{{#if path}} text {{else}} text {{/if}}')).to produce(
@@ -298,6 +298,7 @@ describe Curlybars::Lexer do
298
298
  )
299
299
  end
300
300
  end
301
+ # rubocop:enable Layout/AlignArray
301
302
 
302
303
  describe "{{#with path}}...{{/with}}" do
303
304
  it "is lexed" do
@@ -111,7 +111,7 @@ describe Curlybars::MethodWhitelist do
111
111
  end
112
112
 
113
113
  it "supports procs in schema" do
114
- dummy_class.class_eval { allow_methods settings: ->() { { color_1: nil } } }
114
+ dummy_class.class_eval { allow_methods settings: -> { { color_1: nil } } }
115
115
 
116
116
  expect(dummy_class.methods_schema).to eq(settings: { color_1: nil })
117
117
  end
@@ -76,7 +76,7 @@ describe Curlybars::RenderingSupport do
76
76
  expect(rendering.path('method', rendering.position(0, 1))).to eq :method
77
77
  end
78
78
 
79
- it "returns the method in the current context" do
79
+ it "returns the sub presenter method in the current context" do
80
80
  sub = double(:sub_presenter)
81
81
  allow_all_methods(sub)
82
82
  allow(sub).to receive(:method) { :method }
@@ -218,7 +218,7 @@ describe Curlybars::RenderingSupport do
218
218
 
219
219
  describe "#call" do
220
220
  it "calls with no arguments a method with no parameters" do
221
- method = ->() { :return }
221
+ method = -> { :return }
222
222
  arguments = []
223
223
 
224
224
  output = rendering.call(method, "method", position, arguments, :options, &block)
@@ -226,7 +226,7 @@ describe Curlybars::RenderingSupport do
226
226
  end
227
227
 
228
228
  it "calls with one argument a method with no parameters, discarding the parameter" do
229
- method = ->() { :return }
229
+ method = -> { :return }
230
230
  arguments = [:argument]
231
231
 
232
232
  output = rendering.call(method, "method", position, arguments, :options, &block)
@@ -140,7 +140,7 @@ describe Curlybars::TemplateHandler do
140
140
  expect(context.content_for(:foo)).to eq("bar")
141
141
  end
142
142
 
143
- context "caching" do
143
+ describe "caching" do
144
144
  before do
145
145
  allow(template).to receive(:source) { "{{bar}}" }
146
146
  allow(context).to receive(:bar) { "BAR" }
@@ -22,7 +22,7 @@ describe "{{#each collection}}...{{else}}...{{/each}}" do
22
22
  HTML
23
23
  end
24
24
 
25
- it "uses else_template when collection is not empty" do
25
+ it "uses else_template when collection is empty" do
26
26
  allow(presenter).to receive(:allows_method?).with(:empty_collection) { true }
27
27
  allow(presenter).to receive(:empty_collection) { [] }
28
28
 
@@ -39,7 +39,7 @@ describe "{{#each collection}}...{{else}}...{{/each}}" do
39
39
  HTML
40
40
  end
41
41
 
42
- it "uses each_template when collection is not empty" do
42
+ it "renders {{path}} when collection is not empty" do
43
43
  path_presenter_class = Class.new(Curlybars::Presenter) do
44
44
  presents :path
45
45
  allow_methods :path
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: 0.9.13
4
+ version: 1.0.0
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-01-11 00:00:00.000000000 Z
16
+ date: 2018-01-23 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: actionpack
@@ -91,34 +91,6 @@ dependencies:
91
91
  - - "~>"
92
92
  - !ruby/object:Gem::Version
93
93
  version: '3.5'
94
- - !ruby/object:Gem::Dependency
95
- name: genspec
96
- requirement: !ruby/object:Gem::Requirement
97
- requirements:
98
- - - ">="
99
- - !ruby/object:Gem::Version
100
- version: '0'
101
- type: :development
102
- prerelease: false
103
- version_requirements: !ruby/object:Gem::Requirement
104
- requirements:
105
- - - ">="
106
- - !ruby/object:Gem::Version
107
- version: '0'
108
- - !ruby/object:Gem::Dependency
109
- name: private_gem
110
- requirement: !ruby/object:Gem::Requirement
111
- requirements:
112
- - - ">="
113
- - !ruby/object:Gem::Version
114
- version: '0'
115
- type: :development
116
- prerelease: false
117
- version_requirements: !ruby/object:Gem::Requirement
118
- requirements:
119
- - - ">="
120
- - !ruby/object:Gem::Version
121
- version: '0'
122
94
  - !ruby/object:Gem::Dependency
123
95
  name: railties
124
96
  requirement: !ruby/object:Gem::Requirement
@@ -173,47 +145,31 @@ dependencies:
173
145
  requirements:
174
146
  - - "~>"
175
147
  - !ruby/object:Gem::Version
176
- version: 0.51.0
148
+ version: 0.52.1
177
149
  type: :development
178
150
  prerelease: false
179
151
  version_requirements: !ruby/object:Gem::Requirement
180
152
  requirements:
181
153
  - - "~>"
182
154
  - !ruby/object:Gem::Version
183
- version: 0.51.0
155
+ version: 0.52.1
184
156
  - !ruby/object:Gem::Dependency
185
157
  name: rubocop-rspec
186
158
  requirement: !ruby/object:Gem::Requirement
187
159
  requirements:
188
160
  - - "~>"
189
161
  - !ruby/object:Gem::Version
190
- version: 1.19.0
162
+ version: 1.22.0
191
163
  type: :development
192
164
  prerelease: false
193
165
  version_requirements: !ruby/object:Gem::Requirement
194
166
  requirements:
195
167
  - - "~>"
196
168
  - !ruby/object:Gem::Version
197
- version: 1.19.0
198
- - !ruby/object:Gem::Dependency
199
- name: wwtd
200
- requirement: !ruby/object:Gem::Requirement
201
- requirements:
202
- - - ">="
203
- - !ruby/object:Gem::Version
204
- version: 0.5.3
205
- type: :development
206
- prerelease: false
207
- version_requirements: !ruby/object:Gem::Requirement
208
- requirements:
209
- - - ">="
210
- - !ruby/object:Gem::Version
211
- version: 0.5.3
169
+ version: 1.22.0
212
170
  description: |-
213
- A view layer for your Rails apps that separates
214
- structure and logic, using Handlebars templates.
215
-
216
- Strongly inspired by Curly Template gem by Daniel Schierbeck
171
+ A view layer for your Rails apps that separates structure and logic, using Handlebars templates.
172
+ Strongly inspired by Curly Template gem by Daniel Schierbeck.
217
173
  email: libo@zendesk.com
218
174
  executables: []
219
175
  extensions: []
@@ -315,7 +271,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
315
271
  version: '0'
316
272
  requirements: []
317
273
  rubyforge_project:
318
- rubygems_version: 2.7.3
274
+ rubygems_version: 2.7.4
319
275
  signing_key:
320
276
  specification_version: 4
321
277
  summary: Create your views using Handlebars templates!