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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 73870fb0e93ae950755c3fc00c29374b754f68d2
4
- data.tar.gz: 4c28da6568a999deb23d029e383ec9665b856cf4
3
+ metadata.gz: e99a9ab21f1d52d88b6de5b930ca5bd8a504948f
4
+ data.tar.gz: 8cd28fb1bd10fd3d22ef5a5455c0b7855f4d0e0c
5
5
  SHA512:
6
- metadata.gz: 639230d912f28d68a0da66ea5e0a37a8f726f95656341c16bc44c3478cba79c079f8cfe173bb234590b43c5b59ccfcb5f73e9306968492523ce8cc2ec099b98e
7
- data.tar.gz: 5afb99713b59703654d49d3161e617a9bfc9500fbc61729645c9a37975e475e0907841e8e77604ce2e7dd8d7e4399057556e86956cde64c692475a88703a93a4
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
- allow_failures:
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
@@ -22,3 +22,8 @@ appraise "rails-4-1" do
22
22
  gem "railties", "~> 4.1.0"
23
23
  gem "actionpack", "~> 4.1.0"
24
24
  end
25
+
26
+ appraise "rails-4-2" do
27
+ gem "railties", "~> 4.2.0"
28
+ gem "actionpack", "~> 4.2.0"
29
+ end
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)
@@ -0,0 +1,11 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rake"
6
+ gem "mocha", :require => false
7
+ gem "appraisal"
8
+ gem "railties", "~> 4.2.0"
9
+ gem "actionpack", "~> 4.2.0"
10
+
11
+ gemspec :path => "../"
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.6'
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 = ::Object.new
25
+ BLANK = Blank.new
25
26
 
26
27
  def set!(key, value = BLANK, *args, &block)
27
28
  result = if block
@@ -0,0 +1,7 @@
1
+ class Jbuilder
2
+ class Blank
3
+ def ==(other)
4
+ super || Blank === other
5
+ end
6
+ end
7
+ end
@@ -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
- require "active_support/test_case"
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.6
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: 2014-12-18 00:00:00.000000000 Z
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.3
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