breezy_template 0.5.3 → 0.5.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/test/extensions_test.rb +22 -1
  3. metadata +13 -13
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f5d548e79b99ef27ffa4ab713275effedbbcdfc4
4
- data.tar.gz: 76e6956a4c2d759507c329d09ec2abd3922d3011
3
+ metadata.gz: 194841224366e609e53fb0321ab3dc578436f60a
4
+ data.tar.gz: d9122125e4b9f272f23449f1165ed2b79c4aa1b6
5
5
  SHA512:
6
- metadata.gz: 0c7c4eda5f014c4f52e50f4c79e73c11a9156307ad79eec7e4f81281a63203c9e07bca869c48239df44df06c10b5ef2e96a428eaa9dc9d699645c78c856db05f
7
- data.tar.gz: 73c8dc59cfb93123e8366ccbd2bd31e73f85479de789b34aaefa807bb2d6b31d48c172f4b69dc951bd73e5f7101515d08a31bf6d18a758005ffbb23ed89b56fa
6
+ metadata.gz: 118d61420698fdbed96028190d7909990be69e7b82415d7029892ad457462c6bbd1eb3da296de8979cea4ecd175f6c0148714618106761bd55c5b9c6d6df617c
7
+ data.tar.gz: cccf65ab229f63c4c97011194188518bc9aceb5f1c45735f22400f2e9e0609c956d3eb195d1e82a81ad9015559a68b70e898f0a50f5c529ef68d50c2b456e3bb
@@ -28,6 +28,10 @@ FOOTER_PARTIAL = <<-JBUILDER
28
28
  json.terms "You agree"
29
29
  JBUILDER
30
30
 
31
+ FLATTENED_PARTIAL = <<-JBUILDER
32
+ json.array! [1,2]
33
+ JBUILDER
34
+
31
35
  BlogPost = Struct.new(:id, :body, :author_name)
32
36
  Collection = Struct.new(:id, :name)
33
37
  blog_authors = [ "David Heinemeier Hansson", "Pavel Pravosud" ].cycle
@@ -41,7 +45,8 @@ PARTIALS = {
41
45
  "_blog_post.js.breezy" => BLOG_POST_PARTIAL,
42
46
  "_profile.js.breezy" => PROFILE_PARTIAL,
43
47
  "_footer.js.breezy" => FOOTER_PARTIAL,
44
- "_collection.js.breezy" => COLLECTION_PARTIAL
48
+ "_collection.js.breezy" => COLLECTION_PARTIAL,
49
+ "_flattened.js.breezy" => FLATTENED_PARTIAL
45
50
  }
46
51
 
47
52
  def strip_format(str)
@@ -545,6 +550,22 @@ class BreezyTemplateTest < ActionView::TestCase
545
550
  assert_equal expected, result
546
551
  end
547
552
 
553
+ test "renders the partial as an array and ignores the value" do
554
+ result = jbuild <<-JBUILDER
555
+ json.posts nil, partial: "flattened"
556
+ JBUILDER
557
+
558
+ expected = strip_format(<<-JS)
559
+ (function(){
560
+ var joints={};
561
+ var cache={};
562
+ var defers=[];
563
+ return ({"data":{"posts":[1,2]},"joints":joints,"defers":defers});
564
+ })()
565
+ JS
566
+ assert_equal expected, result
567
+ end
568
+
548
569
  test "caching a value at a node" do
549
570
  undef_context_methods :fragment_name_with_digest, :cache_fragment_name
550
571
 
metadata CHANGED
@@ -1,55 +1,55 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: breezy_template
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Johny Ho
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-01 00:00:00.000000000 Z
11
+ date: 2018-08-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 5.0.0
19
+ version: '5.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 5.0.0
26
+ version: '5.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: activesupport
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 5.0.0
33
+ version: '5.0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 5.0.0
40
+ version: '5.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: multi_json
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '1.2'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '1.2'
55
55
  - !ruby/object:Gem::Dependency
@@ -115,7 +115,7 @@ require_paths:
115
115
  - lib
116
116
  required_ruby_version: !ruby/object:Gem::Requirement
117
117
  requirements:
118
- - - ">="
118
+ - - "~>"
119
119
  - !ruby/object:Gem::Version
120
120
  version: '2.3'
121
121
  required_rubygems_version: !ruby/object:Gem::Requirement