breezy_template 0.9.0 → 0.10.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/breezy_template.rb +7 -5
- data/lib/breezy_template/deferment_extension.rb +14 -3
- data/lib/breezy_template/handler.rb +38 -22
- data/lib/breezy_template/key_formatter.rb +34 -0
- data/lib/breezy_template/partial_extension.rb +20 -30
- data/lib/breezy_template/search_extension.rb +4 -2
- data/test/extensions_test.rb +392 -138
- data/test/template_test.rb +11 -0
- metadata +3 -2
data/test/template_test.rb
CHANGED
@@ -66,6 +66,10 @@ end
|
|
66
66
|
|
67
67
|
|
68
68
|
class TemplateTest < ActiveSupport::TestCase
|
69
|
+
setup do
|
70
|
+
BreezyTemplate.send :class_variable_set, '@@key_formatter', nil
|
71
|
+
end
|
72
|
+
|
69
73
|
test 'single key' do
|
70
74
|
result = jbuild do |json|
|
71
75
|
json.content 'hello'
|
@@ -440,6 +444,13 @@ class TemplateTest < ActiveSupport::TestCase
|
|
440
444
|
# assert_equal 50, result['relations'][1]['age']
|
441
445
|
# end
|
442
446
|
|
447
|
+
# reconsider
|
448
|
+
# test 'initialize via options hash' do
|
449
|
+
# jbuilder = Jbuilder.new(key_formatter: 1, ignore_nil: 2)
|
450
|
+
# assert_equal 1, jbuilder.instance_eval{ @key_formatter }
|
451
|
+
# assert_equal 2, jbuilder.instance_eval{ @ignore_nil }
|
452
|
+
# end
|
453
|
+
|
443
454
|
test 'ignore_nil! without a parameter' do
|
444
455
|
result = jbuild do |json|
|
445
456
|
json.ignore_nil!
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: breezy_template
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.10.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Johny Ho
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-01-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionpack
|
@@ -98,6 +98,7 @@ files:
|
|
98
98
|
- lib/breezy_template/digestor.rb
|
99
99
|
- lib/breezy_template/errors.rb
|
100
100
|
- lib/breezy_template/handler.rb
|
101
|
+
- lib/breezy_template/key_formatter.rb
|
101
102
|
- lib/breezy_template/partial_extension.rb
|
102
103
|
- lib/breezy_template/search_extension.rb
|
103
104
|
- lib/breezy_template/var.rb
|