padrino-helpers 0.14.1.1 → 0.15.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/lib/padrino-helpers/tag_helpers.rb +1 -0
- data/lib/padrino/rendering/erb_template.rb +14 -4
- data/padrino-helpers.gemspec +1 -2
- data/test/helper.rb +1 -1
- data/test/test_tag_helpers.rb +10 -0
- metadata +132 -40
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
OWZhZTBiNjNmZWYyZjcyZmNlZjQ4N2RiOTI5MGM5NjNmOTM1MGQ4MA==
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 8ac2dfdf7cbac9e51f1d7bfbb3a9ef301152775edf61148bfbf615a61522cee9
|
4
|
+
data.tar.gz: ce7424b79c15478c6f9a36f922810e84af9ba1eae4e8c15d7b2a75feb85602e5
|
7
5
|
SHA512:
|
8
|
-
metadata.gz:
|
9
|
-
|
10
|
-
OGM3ZmNhY2YwNmY4OWQ1MjI3ZWU0MjM1MmRjNzhmYzZlZjJmNzNjYTUzYTVl
|
11
|
-
NWI2NTgwNDY1NjYyYzAzZDQxYzBhZjI3NjNiY2Y0ZTI5Yjk2YzY=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
OWViY2JjNzNiZDNlZjc5MjMxMzY3Y2EzNGE2YTNhMWI5YzBlNmEyYWQxMjJk
|
14
|
-
ZGFlOTU3ZjM3NGY4NWM1YTU0YWQ0MmYwNWRlODFlOTg2YzdjNThlNzgwZTJm
|
15
|
-
NTU2ZWZhYTBkNWQ0ODk3M2FlODIyMDc0MDU5NDA4OWRmODcxMTI=
|
6
|
+
metadata.gz: cd675bdc8f32d46dea5b827906fe094f2c8926b5e8986fe3c95659c1a7831a88da839e62715a4509531c4e7ce6fe71d7a0f6263b4b07b58bff2b5f115099914f
|
7
|
+
data.tar.gz: 0cb9e9a1c5cf7df7cec2a5436a69a58d42e22e7c21380bb1f3e0779060e33e2f6419f732ba1873c635dc244230c9d09e14fb2cdf833890c6a334775726b6c439
|
@@ -30,10 +30,20 @@ module Padrino
|
|
30
30
|
super
|
31
31
|
end
|
32
32
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
33
|
+
if ERB.instance_method(:initialize).parameters.assoc(:key) # Ruby 2.6+
|
34
|
+
def prepare
|
35
|
+
@outvar = options[:outvar] || self.class.default_output_variable
|
36
|
+
options[:trim] = '<>' if !(options[:trim] == false) && (options[:trim].nil? || options[:trim] == true)
|
37
|
+
|
38
|
+
@engine = SafeERB.new(data, trim_mode: options[:trim], eoutvar: @outvar)
|
39
|
+
end
|
40
|
+
else
|
41
|
+
def prepare
|
42
|
+
@outvar = options[:outvar] || self.class.default_output_variable
|
43
|
+
options[:trim] = '<>' if !(options[:trim] == false) && (options[:trim].nil? || options[:trim] == true)
|
44
|
+
|
45
|
+
@engine = SafeERB.new(data, options[:safe], options[:trim], @outvar)
|
46
|
+
end
|
37
47
|
end
|
38
48
|
|
39
49
|
def precompiled_preamble(locals)
|
data/padrino-helpers.gemspec
CHANGED
@@ -5,7 +5,6 @@ require File.expand_path("../../padrino-core/lib/padrino-core/version.rb", __FIL
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "padrino-helpers"
|
8
|
-
s.rubyforge_project = "padrino-helpers"
|
9
8
|
s.authors = ["Padrino Team", "Nathan Esquenazi", "Davide D'Agostino", "Arthur Chiu"]
|
10
9
|
s.email = "padrinorb@gmail.com"
|
11
10
|
s.summary = "Helpers for padrino"
|
@@ -25,5 +24,5 @@ Gem::Specification.new do |s|
|
|
25
24
|
|
26
25
|
s.add_dependency("padrino-support", Padrino.version)
|
27
26
|
s.add_dependency("tilt", ">= 1.4.1", "< 3")
|
28
|
-
s.add_dependency("i18n", "
|
27
|
+
s.add_dependency("i18n", ">= 0.6.7", "< 2")
|
29
28
|
end
|
data/test/helper.rb
CHANGED
data/test/test_tag_helpers.rb
CHANGED
@@ -42,6 +42,16 @@ describe "TagHelpers" do
|
|
42
42
|
actual_html = tag(:br, :class => 'Example <foo> & "bar"')
|
43
43
|
assert_equal "<br class=\"Example <foo> & "bar"\" />", actual_html
|
44
44
|
end
|
45
|
+
|
46
|
+
it 'should allow array as attributes' do
|
47
|
+
actual_html = tag(:p, :class => [:foo, :bar])
|
48
|
+
assert_html_has_tag(actual_html, 'p.foo.bar')
|
49
|
+
end
|
50
|
+
|
51
|
+
it 'should allow array as nested attributes' do
|
52
|
+
actual_html = tag(:p, :data => { :foo => [:bar, :baz] })
|
53
|
+
assert_html_has_tag(actual_html, 'p', :'data-foo' => 'bar baz')
|
54
|
+
end
|
45
55
|
end
|
46
56
|
|
47
57
|
describe 'for #content_tag method' do
|
metadata
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: padrino-helpers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.15.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Padrino Team
|
8
8
|
- Nathan Esquenazi
|
9
9
|
- Davide D'Agostino
|
10
10
|
- Arthur Chiu
|
11
|
-
autorequire:
|
11
|
+
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date:
|
14
|
+
date: 2021-04-25 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: padrino-support
|
@@ -19,62 +19,54 @@ dependencies:
|
|
19
19
|
requirements:
|
20
20
|
- - '='
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 0.
|
22
|
+
version: 0.15.1
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
27
|
- - '='
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: 0.
|
29
|
+
version: 0.15.1
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
31
|
name: tilt
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
33
33
|
requirements:
|
34
|
-
- -
|
34
|
+
- - ">="
|
35
35
|
- !ruby/object:Gem::Version
|
36
|
-
version:
|
37
|
-
|
38
|
-
- - <
|
36
|
+
version: 1.4.1
|
37
|
+
- - "<"
|
39
38
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
41
|
-
Mw==
|
39
|
+
version: '3'
|
42
40
|
type: :runtime
|
43
41
|
prerelease: false
|
44
42
|
version_requirements: !ruby/object:Gem::Requirement
|
45
43
|
requirements:
|
46
|
-
- -
|
44
|
+
- - ">="
|
47
45
|
- !ruby/object:Gem::Version
|
48
|
-
version:
|
49
|
-
|
50
|
-
- - <
|
46
|
+
version: 1.4.1
|
47
|
+
- - "<"
|
51
48
|
- !ruby/object:Gem::Version
|
52
|
-
version:
|
53
|
-
Mw==
|
49
|
+
version: '3'
|
54
50
|
- !ruby/object:Gem::Dependency
|
55
51
|
name: i18n
|
56
52
|
requirement: !ruby/object:Gem::Requirement
|
57
53
|
requirements:
|
58
|
-
- -
|
54
|
+
- - ">="
|
59
55
|
- !ruby/object:Gem::Version
|
60
|
-
version:
|
61
|
-
|
62
|
-
- - ! '>='
|
56
|
+
version: 0.6.7
|
57
|
+
- - "<"
|
63
58
|
- !ruby/object:Gem::Version
|
64
|
-
version:
|
65
|
-
MC42Ljc=
|
59
|
+
version: '2'
|
66
60
|
type: :runtime
|
67
61
|
prerelease: false
|
68
62
|
version_requirements: !ruby/object:Gem::Requirement
|
69
63
|
requirements:
|
70
|
-
- -
|
64
|
+
- - ">="
|
71
65
|
- !ruby/object:Gem::Version
|
72
|
-
version:
|
73
|
-
|
74
|
-
- - ! '>='
|
66
|
+
version: 0.6.7
|
67
|
+
- - "<"
|
75
68
|
- !ruby/object:Gem::Version
|
76
|
-
version:
|
77
|
-
MC42Ljc=
|
69
|
+
version: '2'
|
78
70
|
description: Tag helpers, asset helpers, form helpers, form builders and many more
|
79
71
|
helpers for padrino
|
80
72
|
email: padrinorb@gmail.com
|
@@ -83,9 +75,9 @@ extensions: []
|
|
83
75
|
extra_rdoc_files:
|
84
76
|
- README.rdoc
|
85
77
|
files:
|
86
|
-
- .document
|
87
|
-
- .gitignore
|
88
|
-
- .yardopts
|
78
|
+
- ".document"
|
79
|
+
- ".gitignore"
|
80
|
+
- ".yardopts"
|
89
81
|
- LICENSE.txt
|
90
82
|
- README.rdoc
|
91
83
|
- Rakefile
|
@@ -243,25 +235,125 @@ homepage: http://www.padrinorb.com
|
|
243
235
|
licenses:
|
244
236
|
- MIT
|
245
237
|
metadata: {}
|
246
|
-
post_install_message:
|
238
|
+
post_install_message:
|
247
239
|
rdoc_options:
|
248
|
-
- --charset=UTF-8
|
240
|
+
- "--charset=UTF-8"
|
249
241
|
require_paths:
|
250
242
|
- lib
|
251
243
|
required_ruby_version: !ruby/object:Gem::Requirement
|
252
244
|
requirements:
|
253
|
-
- -
|
245
|
+
- - ">="
|
254
246
|
- !ruby/object:Gem::Version
|
255
247
|
version: '0'
|
256
248
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
257
249
|
requirements:
|
258
|
-
- -
|
250
|
+
- - ">="
|
259
251
|
- !ruby/object:Gem::Version
|
260
252
|
version: 1.3.6
|
261
253
|
requirements: []
|
262
|
-
|
263
|
-
|
264
|
-
signing_key:
|
254
|
+
rubygems_version: 3.0.8
|
255
|
+
signing_key:
|
265
256
|
specification_version: 4
|
266
257
|
summary: Helpers for padrino
|
267
|
-
test_files:
|
258
|
+
test_files:
|
259
|
+
- test/fixtures/apps/.components
|
260
|
+
- test/fixtures/apps/.gitignore
|
261
|
+
- test/fixtures/apps/render.rb
|
262
|
+
- test/fixtures/apps/views/article/comment/show.slim
|
263
|
+
- test/fixtures/apps/views/blog/post.erb
|
264
|
+
- test/fixtures/apps/views/layouts/specific.erb
|
265
|
+
- test/fixtures/apps/views/test/post.erb
|
266
|
+
- test/fixtures/layouts/layout.erb
|
267
|
+
- test/fixtures/markup_app/app.rb
|
268
|
+
- test/fixtures/markup_app/views/button_to.erb
|
269
|
+
- test/fixtures/markup_app/views/button_to.haml
|
270
|
+
- test/fixtures/markup_app/views/button_to.slim
|
271
|
+
- test/fixtures/markup_app/views/capture_concat.erb
|
272
|
+
- test/fixtures/markup_app/views/capture_concat.haml
|
273
|
+
- test/fixtures/markup_app/views/capture_concat.slim
|
274
|
+
- test/fixtures/markup_app/views/content_for.erb
|
275
|
+
- test/fixtures/markup_app/views/content_for.haml
|
276
|
+
- test/fixtures/markup_app/views/content_for.slim
|
277
|
+
- test/fixtures/markup_app/views/content_tag.erb
|
278
|
+
- test/fixtures/markup_app/views/content_tag.haml
|
279
|
+
- test/fixtures/markup_app/views/content_tag.slim
|
280
|
+
- test/fixtures/markup_app/views/current_engine.erb
|
281
|
+
- test/fixtures/markup_app/views/current_engine.haml
|
282
|
+
- test/fixtures/markup_app/views/current_engine.slim
|
283
|
+
- test/fixtures/markup_app/views/fields_for.erb
|
284
|
+
- test/fixtures/markup_app/views/fields_for.haml
|
285
|
+
- test/fixtures/markup_app/views/fields_for.slim
|
286
|
+
- test/fixtures/markup_app/views/form_for.erb
|
287
|
+
- test/fixtures/markup_app/views/form_for.haml
|
288
|
+
- test/fixtures/markup_app/views/form_for.slim
|
289
|
+
- test/fixtures/markup_app/views/form_tag.erb
|
290
|
+
- test/fixtures/markup_app/views/form_tag.haml
|
291
|
+
- test/fixtures/markup_app/views/form_tag.slim
|
292
|
+
- test/fixtures/markup_app/views/link_to.erb
|
293
|
+
- test/fixtures/markup_app/views/link_to.haml
|
294
|
+
- test/fixtures/markup_app/views/link_to.slim
|
295
|
+
- test/fixtures/markup_app/views/mail_to.erb
|
296
|
+
- test/fixtures/markup_app/views/mail_to.haml
|
297
|
+
- test/fixtures/markup_app/views/mail_to.slim
|
298
|
+
- test/fixtures/markup_app/views/meta_tag.erb
|
299
|
+
- test/fixtures/markup_app/views/meta_tag.haml
|
300
|
+
- test/fixtures/markup_app/views/meta_tag.slim
|
301
|
+
- test/fixtures/markup_app/views/partials/_erb.erb
|
302
|
+
- test/fixtures/markup_app/views/partials/_haml.haml
|
303
|
+
- test/fixtures/markup_app/views/partials/_slim.slim
|
304
|
+
- test/fixtures/markup_app/views/simple_partial.erb
|
305
|
+
- test/fixtures/markup_app/views/simple_partial.haml
|
306
|
+
- test/fixtures/markup_app/views/simple_partial.slim
|
307
|
+
- test/fixtures/render_app/app.rb
|
308
|
+
- test/fixtures/render_app/views/_deep.erb
|
309
|
+
- test/fixtures/render_app/views/_deep.haml
|
310
|
+
- test/fixtures/render_app/views/_deep.slim
|
311
|
+
- test/fixtures/render_app/views/_foo.haml
|
312
|
+
- test/fixtures/render_app/views/_partial_block_erb.erb
|
313
|
+
- test/fixtures/render_app/views/_partial_block_haml.haml
|
314
|
+
- test/fixtures/render_app/views/_partial_block_slim.slim
|
315
|
+
- test/fixtures/render_app/views/_unsafe.html.builder
|
316
|
+
- test/fixtures/render_app/views/_unsafe_object.html.builder
|
317
|
+
- test/fixtures/render_app/views/current_engine.haml
|
318
|
+
- test/fixtures/render_app/views/current_engines/_erb.erb
|
319
|
+
- test/fixtures/render_app/views/current_engines/_haml.haml
|
320
|
+
- test/fixtures/render_app/views/current_engines/_slim.slim
|
321
|
+
- test/fixtures/render_app/views/dive_inner_erb.erb
|
322
|
+
- test/fixtures/render_app/views/dive_inner_haml.haml
|
323
|
+
- test/fixtures/render_app/views/dive_inner_slim.slim
|
324
|
+
- test/fixtures/render_app/views/dive_outer_erb.erb
|
325
|
+
- test/fixtures/render_app/views/dive_outer_haml.haml
|
326
|
+
- test/fixtures/render_app/views/dive_outer_slim.slim
|
327
|
+
- test/fixtures/render_app/views/double_capture_erb.erb
|
328
|
+
- test/fixtures/render_app/views/double_capture_haml.haml
|
329
|
+
- test/fixtures/render_app/views/double_capture_slim.slim
|
330
|
+
- test/fixtures/render_app/views/erb/test.erb
|
331
|
+
- test/fixtures/render_app/views/explicit_engine.haml
|
332
|
+
- test/fixtures/render_app/views/haml/test.haml
|
333
|
+
- test/fixtures/render_app/views/index.haml
|
334
|
+
- test/fixtures/render_app/views/layouts/application.haml
|
335
|
+
- test/fixtures/render_app/views/render_block_erb.erb
|
336
|
+
- test/fixtures/render_app/views/render_block_haml.haml
|
337
|
+
- test/fixtures/render_app/views/render_block_slim.slim
|
338
|
+
- test/fixtures/render_app/views/ruby_block_capture_erb.erb
|
339
|
+
- test/fixtures/render_app/views/ruby_block_capture_haml.haml
|
340
|
+
- test/fixtures/render_app/views/ruby_block_capture_slim.slim
|
341
|
+
- test/fixtures/render_app/views/template/_user.haml
|
342
|
+
- test/fixtures/render_app/views/template/haml_template.haml
|
343
|
+
- test/fixtures/render_app/views/template/some_template.haml
|
344
|
+
- test/fixtures/render_app/views/wrong_capture_erb.erb
|
345
|
+
- test/fixtures/render_app/views/wrong_capture_haml.haml
|
346
|
+
- test/fixtures/render_app/views/wrong_capture_slim.slim
|
347
|
+
- test/helper.rb
|
348
|
+
- test/test_asset_tag_helpers.rb
|
349
|
+
- test/test_form_builder.rb
|
350
|
+
- test/test_form_helpers.rb
|
351
|
+
- test/test_format_helpers.rb
|
352
|
+
- test/test_helpers.rb
|
353
|
+
- test/test_locale.rb
|
354
|
+
- test/test_number_helpers.rb
|
355
|
+
- test/test_output_helpers.rb
|
356
|
+
- test/test_render_helpers.rb
|
357
|
+
- test/test_rendering.rb
|
358
|
+
- test/test_rendering_extensions.rb
|
359
|
+
- test/test_tag_helpers.rb
|