jbuilder 2.7.0 → 2.8.0

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
- SHA1:
3
- metadata.gz: 45c3afb337be47562a40f26a3ca88c30c866a6bf
4
- data.tar.gz: 735bc2cec1ed339e9ed9ab106d039fb6c877f486
2
+ SHA256:
3
+ metadata.gz: 7c134282537dc64d7253ed11314a8ee31402b4fe994626a955b57f308d8bc082
4
+ data.tar.gz: eebcdba24d5b41aaf87009296fbb63dd4628677b09955ed7c385e048ad3034a2
5
5
  SHA512:
6
- metadata.gz: e2ba8f0402fb0f931a85a7a3d64af40908076ed3a0acdc47af4c250ed77b19606ac0203bc30640b832bf7a73ae5ee69448f2a837eea4347838f6beb23c7ea40c
7
- data.tar.gz: c8c798a98892a6b131944a1d3eba848cee0e7ec8a3a4a81bac765dec866c03f5d3c6e70c736692d81c2680d46f7d6d74eb4ac56a270250c2bcb9148685cb278e
6
+ metadata.gz: 563cfe1ba9e191ed286ca80f77d7ea41737bb402cd257859ec5ffbf3ee77b7a7b041c3cb433d035f10a68a04df2e186140942a98b78b32d7b6d6e64a6514ff44
7
+ data.tar.gz: 8c7e23e0e0aa6abdc56f5a14d4b3ea4c7aa4abdc515d3d8fc8e10385c97733e4f5174a861ffc8fda3913623f90dbb878e7547eec917ebb5d9589d46d9d04c3ba
@@ -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.5
11
- - 2.3.1
12
- - 2.4.0
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 "railties", "~> 4.2.0"
3
- gem "actionpack", "~> 4.2.0"
4
- gem "activemodel", "~> 4.2.0"
2
+ gem "rails", "~> 4.2.0"
5
3
  end
6
4
 
7
- appraise "rails-5-0" do
8
- gem "railties", "~> 5.0.0"
9
- gem "actionpack", "~> 5.0.0"
10
- gem "activemodel", "~> 5.0.0"
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
- gem "railties", ">= 5.1.0", "< 5.2"
15
- gem "actionpack", ">= 5.1.0", "< 5.2"
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
@@ -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
 
@@ -1,4 +1,4 @@
1
- Copyright (c) 2011-2017 David Heinemeier Hansson, 37signals
1
+ Copyright (c) 2011-2018 David Heinemeier Hansson, 37signals
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
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
@@ -6,8 +6,6 @@ gem "rake"
6
6
  gem "mocha", require: false
7
7
  gem "appraisal"
8
8
  gem "pry"
9
- gem "railties", "~> 4.2.0"
10
- gem "actionpack", "~> 4.2.0"
11
- gem "activemodel", "~> 4.2.0"
9
+ gem "rails", "~> 4.2.0"
12
10
 
13
11
  gemspec path: "../"
@@ -6,8 +6,6 @@ gem "rake"
6
6
  gem "mocha", require: false
7
7
  gem "appraisal"
8
8
  gem "pry"
9
- gem "railties", "~> 5.0.0"
10
- gem "actionpack", "~> 5.0.0"
11
- gem "activemodel", "~> 5.0.0"
9
+ gem "rails", ">= 5.0.0", "< 5.1"
12
10
 
13
11
  gemspec path: "../"
@@ -6,8 +6,6 @@ gem "rake"
6
6
  gem "mocha", require: false
7
7
  gem "appraisal"
8
8
  gem "pry"
9
- gem "railties", ">= 5.1.0", "< 5.2"
10
- gem "actionpack", ">= 5.1.0", "< 5.2"
11
- gem "activemodel", ">= 5.1.0", "< 5.2"
9
+ gem "rails", ">= 5.1.0", "< 5.2"
12
10
 
13
11
  gemspec path: "../"
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'jbuilder'
3
- s.version = '2.7.0'
3
+ s.version = '2.8.0'
4
4
  s.authors = 'David Heinemeier Hansson'
5
5
  s.email = 'david@basecamp.com'
6
6
  s.summary = 'Create JSON structures via a Builder-style DSL'
@@ -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?(:fragment_cache_key)
155
- key = @context.fragment_cache_key(key)
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 collecton calls' do
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 fragment_cache_key" do
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(:fragment_cache_key).with("cachekey")
326
+ @context.expects(:combined_fragment_cache_key).with("cachekey")
327
327
 
328
328
  jbuild <<-JBUILDER
329
329
  json.cache! "cachekey" do
@@ -49,7 +49,7 @@ end
49
49
 
50
50
 
51
51
  class JbuilderTest < ActiveSupport::TestCase
52
- setup do
52
+ teardown do
53
53
  Jbuilder.send :class_variable_set, '@@key_formatter', nil
54
54
  end
55
55
 
@@ -1,6 +1,8 @@
1
1
  require "bundler/setup"
2
2
  require "active_support"
3
+ require 'active_support/core_ext/array/access'
3
4
  require "rails/version"
5
+ require "jbuilder"
4
6
 
5
7
  if Rails::VERSION::STRING > "4.0"
6
8
  require "active_support/testing/autorun"
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.7.0
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: 2017-06-05 00:00:00.000000000 Z
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.11
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