jbuilder 2.7.0 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.travis.yml +8 -18
- data/Appraisals +8 -12
- data/CHANGELOG.md +12 -0
- data/MIT-LICENSE +1 -1
- data/README.md +13 -0
- data/gemfiles/rails_4_2.gemfile +1 -3
- data/gemfiles/rails_5_0.gemfile +1 -3
- data/gemfiles/rails_5_1.gemfile +1 -3
- data/jbuilder.gemspec +1 -1
- data/lib/jbuilder/jbuilder_template.rb +2 -2
- data/test/jbuilder_dependency_tracker_test.rb +1 -1
- data/test/jbuilder_template_test.rb +2 -2
- data/test/jbuilder_test.rb +1 -1
- data/test/test_helper.rb +2 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 7c134282537dc64d7253ed11314a8ee31402b4fe994626a955b57f308d8bc082
|
4
|
+
data.tar.gz: eebcdba24d5b41aaf87009296fbb63dd4628677b09955ed7c385e048ad3034a2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 563cfe1ba9e191ed286ca80f77d7ea41737bb402cd257859ec5ffbf3ee77b7a7b041c3cb433d035f10a68a04df2e186140942a98b78b32d7b6d6e64a6514ff44
|
7
|
+
data.tar.gz: 8c7e23e0e0aa6abdc56f5a14d4b3ea4c7aa4abdc515d3d8fc8e10385c97733e4f5174a861ffc8fda3913623f90dbb878e7547eec917ebb5d9589d46d9d04c3ba
|
data/.travis.yml
CHANGED
@@ -3,23 +3,23 @@ language: ruby
|
|
3
3
|
sudo: false
|
4
4
|
cache: bundler
|
5
5
|
|
6
|
+
before_install:
|
7
|
+
- gem update --system
|
8
|
+
- gem install bundler
|
9
|
+
|
6
10
|
rvm:
|
7
11
|
- 1.9
|
8
12
|
- 2.0
|
9
13
|
- 2.1
|
10
|
-
- 2.2.
|
11
|
-
- 2.3.
|
12
|
-
- 2.4.
|
14
|
+
- 2.2.10
|
15
|
+
- 2.3.7
|
16
|
+
- 2.4.4
|
17
|
+
- 2.5.1
|
13
18
|
- ruby-head
|
14
19
|
- jruby-19mode
|
15
20
|
- rbx
|
16
21
|
|
17
22
|
gemfile:
|
18
|
-
- gemfiles/rails_3_0.gemfile
|
19
|
-
- gemfiles/rails_3_1.gemfile
|
20
|
-
- gemfiles/rails_3_2.gemfile
|
21
|
-
- gemfiles/rails_4_0.gemfile
|
22
|
-
- gemfiles/rails_4_1.gemfile
|
23
23
|
- gemfiles/rails_4_2.gemfile
|
24
24
|
- gemfiles/rails_5_0.gemfile
|
25
25
|
- gemfiles/rails_5_1.gemfile
|
@@ -51,16 +51,6 @@ matrix:
|
|
51
51
|
gemfile: gemfiles/rails_5_0.gemfile
|
52
52
|
- rvm: rbx
|
53
53
|
gemfile: gemfiles/rails_5_1.gemfile
|
54
|
-
- rvm: 2.4.0
|
55
|
-
gemfile: gemfiles/rails_3_0.gemfile
|
56
|
-
- rvm: 2.4.0
|
57
|
-
gemfile: gemfiles/rails_3_1.gemfile
|
58
|
-
- rvm: 2.4.0
|
59
|
-
gemfile: gemfiles/rails_3_2.gemfile
|
60
|
-
- rvm: 2.4.0
|
61
|
-
gemfile: gemfiles/rails_4_0.gemfile
|
62
|
-
- rvm: 2.4.0
|
63
|
-
gemfile: gemfiles/rails_4_1.gemfile
|
64
54
|
|
65
55
|
notifications:
|
66
56
|
email: false
|
data/Appraisals
CHANGED
@@ -1,17 +1,13 @@
|
|
1
1
|
appraise "rails-4-2" do
|
2
|
-
gem "
|
3
|
-
gem "actionpack", "~> 4.2.0"
|
4
|
-
gem "activemodel", "~> 4.2.0"
|
2
|
+
gem "rails", "~> 4.2.0"
|
5
3
|
end
|
6
4
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
end
|
5
|
+
if RUBY_VERSION >= "2.2.2"
|
6
|
+
appraise "rails-5-0" do
|
7
|
+
gem "rails", ">= 5.0.0", "< 5.1"
|
8
|
+
end
|
12
9
|
|
13
|
-
appraise "rails-5-1" do
|
14
|
-
|
15
|
-
|
16
|
-
gem "activemodel", ">= 5.1.0", "< 5.2"
|
10
|
+
appraise "rails-5-1" do
|
11
|
+
gem "rails", ">= 5.1.0", "< 5.2"
|
12
|
+
end
|
17
13
|
end
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
2.8.0
|
4
|
+
-----
|
5
|
+
|
6
|
+
* [Replace deprecated fragment_cache_key for Rails 5.2 support](https://github.com/rails/jbuilder/pull/430)
|
7
|
+
|
8
|
+
2.7.0
|
9
|
+
-----
|
10
|
+
|
11
|
+
* [Requires Rails 4+](https://github.com/rails/jbuilder/commit/5207ff394533177fffdd768bfaa6413a0cd16dc8)
|
12
|
+
* [Fix implicitly rendering a JSON partial with the same name as an
|
13
|
+
HTML partial](https://github.com/rails/jbuilder/pull/400)
|
14
|
+
|
3
15
|
2.6.4
|
4
16
|
-----
|
5
17
|
|
data/MIT-LICENSE
CHANGED
data/README.md
CHANGED
@@ -67,6 +67,19 @@ end
|
|
67
67
|
# => {"author": { "name": "David" }}
|
68
68
|
```
|
69
69
|
|
70
|
+
|
71
|
+
To merge existing hash or array to current context:
|
72
|
+
|
73
|
+
``` ruby
|
74
|
+
hash = { author: { name: "David" } }
|
75
|
+
json.post do
|
76
|
+
json.title "Merge HOWTO"
|
77
|
+
json.merge! hash
|
78
|
+
end
|
79
|
+
|
80
|
+
# => "post": { "title": "Merge HOWTO", "author": { "name": "David" } }
|
81
|
+
```
|
82
|
+
|
70
83
|
Top level arrays can be handled directly. Useful for index and other collection actions.
|
71
84
|
|
72
85
|
``` ruby
|
data/gemfiles/rails_4_2.gemfile
CHANGED
data/gemfiles/rails_5_0.gemfile
CHANGED
data/gemfiles/rails_5_1.gemfile
CHANGED
data/jbuilder.gemspec
CHANGED
@@ -151,8 +151,8 @@ class JbuilderTemplate < Jbuilder
|
|
151
151
|
name_options = options.slice(:skip_digest, :virtual_path)
|
152
152
|
key = _fragment_name_with_digest(key, name_options)
|
153
153
|
|
154
|
-
if @context.respond_to?(:
|
155
|
-
key = @context.
|
154
|
+
if @context.respond_to?(:combined_fragment_cache_key)
|
155
|
+
key = @context.combined_fragment_cache_key(key)
|
156
156
|
else
|
157
157
|
key = url_for(key).split('://', 2).last if ::Hash === key
|
158
158
|
end
|
@@ -53,7 +53,7 @@ class JbuilderDependencyTrackerTest < ActiveSupport::TestCase
|
|
53
53
|
assert_equal %w[path/to/partial], dependencies
|
54
54
|
end
|
55
55
|
|
56
|
-
test 'detects partial in indirect
|
56
|
+
test 'detects partial in indirect collection calls' do
|
57
57
|
dependencies = track_dependencies <<-RUBY
|
58
58
|
json.comments @post.comments, partial: 'comments/comment', as: :comment
|
59
59
|
RUBY
|
@@ -320,10 +320,10 @@ class JbuilderTemplateTest < ActionView::TestCase
|
|
320
320
|
JBUILDER
|
321
321
|
end
|
322
322
|
|
323
|
-
test "fragment caching uses
|
323
|
+
test "fragment caching uses combined_fragment_cache_key" do
|
324
324
|
undef_context_methods :fragment_name_with_digest, :cache_fragment_name
|
325
325
|
|
326
|
-
@context.expects(:
|
326
|
+
@context.expects(:combined_fragment_cache_key).with("cachekey")
|
327
327
|
|
328
328
|
jbuild <<-JBUILDER
|
329
329
|
json.cache! "cachekey" do
|
data/test/jbuilder_test.rb
CHANGED
data/test/test_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jbuilder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-11-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -99,7 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
99
99
|
version: '0'
|
100
100
|
requirements: []
|
101
101
|
rubyforge_project:
|
102
|
-
rubygems_version: 2.6
|
102
|
+
rubygems_version: 2.7.6
|
103
103
|
signing_key:
|
104
104
|
specification_version: 4
|
105
105
|
summary: Create JSON structures via a Builder-style DSL
|