jb 0.6.0 → 0.6.1

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: 6ca467cd19f3fca6dbde7da0700ab9b6c3b5c01c1ba64a27e1ddbf355308997e
4
- data.tar.gz: 2219ef6038f54814c87dd9a43cc8e89e61385867c408e4756b037e0b73fc5fd6
3
+ metadata.gz: 85a34b7b4a0cd8cd4bfd32bc44021c6047f7c78dc77b3bce9fafe43ab0d82830
4
+ data.tar.gz: de224b08f0492fa32932377cb7c4c4052a5160cb76e5c25b5f75da47be32602d
5
5
  SHA512:
6
- metadata.gz: 64d1623fff2ed66f5772f95181b88b657ec92708be1604968798f5bf83a8e20f3ddc46bebb636694ea55b13460fca592b3ca13afadbdb26ac98354e2df0f9532
7
- data.tar.gz: 5ecf819da2af617a4681ac9f29d89d2cff1e3eb342c7c018ab229b12df8090a6039d74a4675903e8239a3b96afd1bba09b433a9849a4fe163f95101e2746bfb9
6
+ metadata.gz: d7614ee922fd93b2d30fa51e8525da65a395c4a3dc82d26d535e53fe4a78886037b7ef0672bf417e56544242a06c31baec4d389e46385490767144a66038fa1c
7
+ data.tar.gz: b29639a9d5fbee1e1c0a77218dbfa110744dcf1b9819c26de0ead0b86c5afea3e696cf9122c804bf1e932ce27179cc11c3cd07e29ab614194f07b1c1f7aece76
@@ -1,7 +1,7 @@
1
1
  sudo: false
2
2
  language: ruby
3
3
 
4
- before_install: gem update bundler
4
+ before_install: gem up --system && gem i bundler -v '<2'
5
5
 
6
6
  rvm:
7
7
  - 2.6.0
data/README.md CHANGED
@@ -176,12 +176,11 @@ It's also possible to render collections of partials:
176
176
 
177
177
  ```ruby
178
178
  render partial: 'posts/post', collection: @posts, as: :post
179
-
180
- # or
181
-
182
- render @post.comments
183
179
  ```
184
180
 
181
+ > NOTE: Don't use `render @post.comments` because if the collection is empty,
182
+ `render` will return `nil` instead of an empty array.
183
+
185
184
  You can pass any objects into partial templates with or without `:locals` option.
186
185
 
187
186
  ```ruby
@@ -194,7 +193,7 @@ render 'sub_template', user: user
194
193
 
195
194
  You can of course include Ruby `nil` as a Hash value if you want. That would become `null` in the JSON.
196
195
 
197
- To prevent Jb from including null values in the output, Active Support provides `Hash#compact!` method for you:
196
+ You can use `Hash#compact`/`!` method to prevent including `null` values in the output:
198
197
 
199
198
  ```ruby
200
199
  {foo: nil, bar: 'bar'}.compact
data/jb.gemspec CHANGED
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
23
23
 
24
24
  spec.add_dependency 'multi_json'
25
25
 
26
- spec.add_development_dependency "bundler", "~> 1.12"
26
+ spec.add_development_dependency 'bundler'
27
27
  spec.add_development_dependency 'rake'
28
28
  spec.add_development_dependency 'test-unit-rails'
29
29
  spec.add_development_dependency 'rails'
@@ -5,8 +5,8 @@ module Jb
5
5
  class_attribute :default_format
6
6
  self.default_format = :json
7
7
 
8
- def self.call(template)
9
- template.source
8
+ def self.call(template, source=nil)
9
+ source || template.source
10
10
  end
11
11
 
12
12
  def self.handles_encoding?
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Jb
4
- VERSION = '0.6.0'
4
+ VERSION = '0.6.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Akira Matsuda
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-01-03 00:00:00.000000000 Z
11
+ date: 2019-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_json
@@ -28,16 +28,16 @@ dependencies:
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '1.12'
33
+ version: '0'
34
34
  type: :development
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: '1.12'
40
+ version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -144,7 +144,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
144
144
  - !ruby/object:Gem::Version
145
145
  version: '0'
146
146
  requirements: []
147
- rubygems_version: 3.0.1
147
+ rubyforge_project:
148
+ rubygems_version: 2.7.8
148
149
  signing_key:
149
150
  specification_version: 4
150
151
  summary: Faster and simpler Jbuilder alternative