jbuilder 2.2.6 → 2.2.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +9 -1
- data/Appraisals +5 -0
- data/CHANGELOG.md +4 -0
- data/gemfiles/rails_4_2.gemfile +11 -0
- data/jbuilder.gemspec +1 -1
- data/lib/jbuilder.rb +2 -1
- data/lib/jbuilder/blank.rb +7 -0
- data/test/jbuilder_template_test.rb +21 -0
- data/test/test_helper.rb +5 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e99a9ab21f1d52d88b6de5b930ca5bd8a504948f
|
4
|
+
data.tar.gz: 8cd28fb1bd10fd3d22ef5a5455c0b7855f4d0e0c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b1364a2ff7640fc119b93e410877fb6979d28306176bb894f4511c05671ef79c2288829959d1c12960b9fe63662eb8606a9588452867fbedab42904408200317
|
7
|
+
data.tar.gz: 53dd379414c1c9c66caa31a43555d05904922bb32e661ac440530549bb32bce282eea873e85c691330f30f42715113a2295f2ab3dd48a99792d8fcc8e1a47baa
|
data/.travis.yml
CHANGED
@@ -15,10 +15,18 @@ gemfile:
|
|
15
15
|
- gemfiles/rails_3_2.gemfile
|
16
16
|
- gemfiles/rails_4_0.gemfile
|
17
17
|
- gemfiles/rails_4_1.gemfile
|
18
|
+
- gemfiles/rails_4_2.gemfile
|
18
19
|
|
19
20
|
matrix:
|
20
|
-
|
21
|
+
exclude:
|
22
|
+
- rvm: 2.2
|
23
|
+
gemfile: gemfiles/rails_3_0.gemfile
|
24
|
+
- rvm: 2.2
|
25
|
+
gemfile: gemfiles/rails_3_1.gemfile
|
21
26
|
- rvm: 2.2
|
27
|
+
gemfile: gemfiles/rails_3_2.gemfile
|
28
|
+
|
29
|
+
allow_failures:
|
22
30
|
- rvm: jruby-19mode
|
23
31
|
- rvm: rbx
|
24
32
|
- rvm: ruby-head
|
data/Appraisals
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
2.2.7
|
4
|
+
-----
|
5
|
+
* [Make Blank object serializable with Marshal](https://github.com/rails/jbuilder/commit/7083f28d8b665aa60d0d1b1927ae88bb5c6290ba)
|
6
|
+
|
3
7
|
2.2.6
|
4
8
|
-----
|
5
9
|
* [Make sure dependency tracker loads after template handler](https://github.com/rails/jbuilder/commit/3ba404b1207b557e14771c90b8832bc01ae67a42)
|
data/jbuilder.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'jbuilder'
|
3
|
-
s.version = '2.2.
|
3
|
+
s.version = '2.2.7'
|
4
4
|
s.authors = ['David Heinemeier Hansson', 'Pavel Pravosud']
|
5
5
|
s.email = ['david@37signals.com', 'pavel@pravosud.com']
|
6
6
|
s.summary = 'Create JSON structures via a Builder-style DSL'
|
data/lib/jbuilder.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'jbuilder/jbuilder'
|
2
|
+
require 'jbuilder/blank'
|
2
3
|
require 'jbuilder/key_formatter'
|
3
4
|
require 'jbuilder/errors'
|
4
5
|
require 'multi_json'
|
@@ -21,7 +22,7 @@ class Jbuilder
|
|
21
22
|
new(*args, &block).target!
|
22
23
|
end
|
23
24
|
|
24
|
-
BLANK =
|
25
|
+
BLANK = Blank.new
|
25
26
|
|
26
27
|
def set!(key, value = BLANK, *args, &block)
|
27
28
|
result = if block
|
@@ -190,6 +190,27 @@ class JbuilderTemplateTest < ActionView::TestCase
|
|
190
190
|
assert_equal '{"posts":[]}', json
|
191
191
|
end
|
192
192
|
|
193
|
+
test 'cache an empty block' do
|
194
|
+
undef_context_methods :fragment_name_with_digest, :cache_fragment_name
|
195
|
+
|
196
|
+
render_jbuilder <<-JBUILDER
|
197
|
+
json.cache! 'nothing' do
|
198
|
+
end
|
199
|
+
JBUILDER
|
200
|
+
|
201
|
+
json = nil
|
202
|
+
|
203
|
+
assert_nothing_raised do
|
204
|
+
json = render_jbuilder <<-JBUILDER
|
205
|
+
json.foo 'bar'
|
206
|
+
json.cache! 'nothing' do
|
207
|
+
end
|
208
|
+
JBUILDER
|
209
|
+
end
|
210
|
+
|
211
|
+
assert_equal 'bar', MultiJson.load(json)['foo']
|
212
|
+
end
|
213
|
+
|
193
214
|
test 'fragment caching a JSON object' do
|
194
215
|
undef_context_methods :fragment_name_with_digest, :cache_fragment_name
|
195
216
|
|
data/test/test_helper.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require "bundler/setup"
|
2
|
+
require "active_support"
|
2
3
|
require "rails/version"
|
3
4
|
|
4
5
|
if Rails::VERSION::STRING > "4.0"
|
@@ -7,4 +8,7 @@ else
|
|
7
8
|
require "test/unit"
|
8
9
|
end
|
9
10
|
|
10
|
-
|
11
|
+
|
12
|
+
if ActiveSupport.respond_to?(:test_order=)
|
13
|
+
ActiveSupport.test_order = :random
|
14
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jbuilder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2015-02-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -66,6 +66,7 @@ files:
|
|
66
66
|
- gemfiles/rails_3_2.gemfile
|
67
67
|
- gemfiles/rails_4_0.gemfile
|
68
68
|
- gemfiles/rails_4_1.gemfile
|
69
|
+
- gemfiles/rails_4_2.gemfile
|
69
70
|
- jbuilder.gemspec
|
70
71
|
- lib/generators/rails/jbuilder_generator.rb
|
71
72
|
- lib/generators/rails/scaffold_controller_generator.rb
|
@@ -73,6 +74,7 @@ files:
|
|
73
74
|
- lib/generators/rails/templates/index.json.jbuilder
|
74
75
|
- lib/generators/rails/templates/show.json.jbuilder
|
75
76
|
- lib/jbuilder.rb
|
77
|
+
- lib/jbuilder/blank.rb
|
76
78
|
- lib/jbuilder/dependency_tracker.rb
|
77
79
|
- lib/jbuilder/errors.rb
|
78
80
|
- lib/jbuilder/jbuilder.rb
|
@@ -105,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
105
107
|
version: '0'
|
106
108
|
requirements: []
|
107
109
|
rubyforge_project:
|
108
|
-
rubygems_version: 2.4.
|
110
|
+
rubygems_version: 2.4.5
|
109
111
|
signing_key:
|
110
112
|
specification_version: 4
|
111
113
|
summary: Create JSON structures via a Builder-style DSL
|