jbuilder 2.6.4 → 2.7.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
2
  SHA1:
3
- metadata.gz: e35bd234795a5d5f23c73a30d259ca195e42f6e5
4
- data.tar.gz: 3e884978c900ea0ef14aa7e68e611246b2b74814
3
+ metadata.gz: 45c3afb337be47562a40f26a3ca88c30c866a6bf
4
+ data.tar.gz: 735bc2cec1ed339e9ed9ab106d039fb6c877f486
5
5
  SHA512:
6
- metadata.gz: de29407995773a316901cee9012d9f363366ac02ecd4faeb98ab58099536dc5377d53e3c07242f24f17e039111a7f45842ecb5cfc37be67af5852e4ce7c471de
7
- data.tar.gz: 9bc528a7c2f5fe784567d0d62012a51b3e398debf13a72e68496f7345be69f0f62c401b6dfa07e1a38773a4d4d952b768e63b83c32fa24e64041fe62b6dd3778
6
+ metadata.gz: e2ba8f0402fb0f931a85a7a3d64af40908076ed3a0acdc47af4c250ed77b19606ac0203bc30640b832bf7a73ae5ee69448f2a837eea4347838f6beb23c7ea40c
7
+ data.tar.gz: c8c798a98892a6b131944a1d3eba848cee0e7ec8a3a4a81bac765dec866c03f5d3c6e70c736692d81c2680d46f7d6d74eb4ac56a270250c2bcb9148685cb278e
data/Appraisals CHANGED
@@ -1,36 +1,3 @@
1
- appraise "rails-3-0" do
2
- gem "test-unit"
3
- gem "railties", "~> 3.0.0"
4
- gem "actionpack", "~> 3.0.0"
5
- gem "activemodel", "~> 3.0.0"
6
- end
7
-
8
- appraise "rails-3-1" do
9
- gem "test-unit"
10
- gem "railties", "~> 3.1.0"
11
- gem "actionpack", "~> 3.1.0"
12
- gem "activemodel", "~> 3.1.0"
13
- end
14
-
15
- appraise "rails-3-2" do
16
- gem "test-unit"
17
- gem "railties", "~> 3.2.0"
18
- gem "actionpack", "~> 3.2.0"
19
- gem "activemodel", "~> 3.2.0"
20
- end
21
-
22
- appraise "rails-4-0" do
23
- gem "railties", "~> 4.0.0"
24
- gem "actionpack", "~> 4.0.0"
25
- gem "activemodel", "~> 4.0.0"
26
- end
27
-
28
- appraise "rails-4-1" do
29
- gem "railties", "~> 4.1.0"
30
- gem "actionpack", "~> 4.1.0"
31
- gem "activemodel", "~> 4.1.0"
32
- end
33
-
34
1
  appraise "rails-4-2" do
35
2
  gem "railties", "~> 4.2.0"
36
3
  gem "actionpack", "~> 4.2.0"
data/Rakefile CHANGED
@@ -12,11 +12,7 @@ else
12
12
 
13
13
  test.libs << "test"
14
14
 
15
- if Rails::VERSION::MAJOR == 3
16
- test.test_files = %w[test/jbuilder_template_test.rb test/jbuilder_test.rb]
17
- else
18
- test.test_files = FileList["test/*_test.rb"]
19
- end
15
+ test.test_files = FileList["test/*_test.rb"]
20
16
  end
21
17
 
22
18
  task default: :test
@@ -3,12 +3,11 @@
3
3
  source "https://rubygems.org"
4
4
 
5
5
  gem "rake"
6
- gem "mocha", :require => false
6
+ gem "mocha", require: false
7
7
  gem "appraisal"
8
8
  gem "pry"
9
9
  gem "railties", "~> 4.2.0"
10
10
  gem "actionpack", "~> 4.2.0"
11
11
  gem "activemodel", "~> 4.2.0"
12
- gem "nokogiri", "< 1.7" if RUBY_VERSION < "2.1"
13
12
 
14
- gemspec :path => "../"
13
+ gemspec path: "../"
@@ -3,11 +3,11 @@
3
3
  source "https://rubygems.org"
4
4
 
5
5
  gem "rake"
6
- gem "mocha", :require => false
6
+ gem "mocha", require: false
7
7
  gem "appraisal"
8
8
  gem "pry"
9
9
  gem "railties", "~> 5.0.0"
10
10
  gem "actionpack", "~> 5.0.0"
11
11
  gem "activemodel", "~> 5.0.0"
12
12
 
13
- gemspec :path => "../"
13
+ gemspec path: "../"
@@ -3,11 +3,11 @@
3
3
  source "https://rubygems.org"
4
4
 
5
5
  gem "rake"
6
- gem "mocha", :require => false
6
+ gem "mocha", require: false
7
7
  gem "appraisal"
8
8
  gem "pry"
9
9
  gem "railties", ">= 5.1.0", "< 5.2"
10
10
  gem "actionpack", ">= 5.1.0", "< 5.2"
11
11
  gem "activemodel", ">= 5.1.0", "< 5.2"
12
12
 
13
- gemspec :path => "../"
13
+ gemspec path: "../"
@@ -1,15 +1,15 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'jbuilder'
3
- s.version = '2.6.4'
4
- s.authors = ['David Heinemeier Hansson']
5
- s.email = ['david@37signals.com']
3
+ s.version = '2.7.0'
4
+ s.authors = 'David Heinemeier Hansson'
5
+ s.email = 'david@basecamp.com'
6
6
  s.summary = 'Create JSON structures via a Builder-style DSL'
7
7
  s.homepage = 'https://github.com/rails/jbuilder'
8
8
  s.license = 'MIT'
9
9
 
10
10
  s.required_ruby_version = '>= 1.9.3'
11
11
 
12
- s.add_dependency 'activesupport', '>= 3.0.0'
12
+ s.add_dependency 'activesupport', '>= 4.2.0'
13
13
  s.add_dependency 'multi_json', '>= 1.2'
14
14
 
15
15
  s.files = `git ls-files`.split("\n")
@@ -188,7 +188,7 @@ class JbuilderTemplate < Jbuilder
188
188
  _scope{ _render_partial_with_options options.merge(collection: object) }
189
189
  else
190
190
  locals = ::Hash[options[:as], object]
191
- _scope{ _render_partial options.merge(locals: locals) }
191
+ _scope{ _render_partial_with_options options.merge(locals: locals) }
192
192
  end
193
193
 
194
194
  set! name, value
@@ -62,9 +62,9 @@ class JbuilderTemplateTest < ActionView::TestCase
62
62
  Rails.cache.clear
63
63
  end
64
64
 
65
- def jbuild(source)
65
+ def jbuild(source, options = {})
66
66
  @rendered = []
67
- partials = PARTIALS.clone
67
+ partials = options.fetch(:partials, PARTIALS).clone
68
68
  partials["test.json.jbuilder"] = source
69
69
  resolver = ActionView::FixtureResolver.new(partials)
70
70
  lookup_context.view_paths = [resolver]
@@ -438,4 +438,20 @@ class JbuilderTemplateTest < ActionView::TestCase
438
438
  assert_equal 123, result["id"]
439
439
  assert_equal "Chris Harris", result["name"]
440
440
  end
441
+
442
+ test "renders partial via set! with same name as HTML partial" do
443
+ partials = {
444
+ "_blog_post.html.erb" => "Hello!",
445
+ "_blog_post.json.jbuilder" => BLOG_POST_PARTIAL
446
+ }
447
+
448
+ @post = BLOG_POST_COLLECTION.first
449
+
450
+ result = jbuild(<<-JBUILDER, partials: partials)
451
+ json.post @post, partial: "blog_post", as: :blog_post
452
+ JBUILDER
453
+
454
+ assert_not_nil result["post"]
455
+ assert_equal 1, result["post"]["id"]
456
+ end
441
457
  end
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.6.4
4
+ version: 2.7.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-05-10 00:00:00.000000000 Z
11
+ date: 2017-06-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 3.0.0
19
+ version: 4.2.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 3.0.0
26
+ version: 4.2.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: multi_json
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -39,8 +39,7 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.2'
41
41
  description:
42
- email:
43
- - david@37signals.com
42
+ email: david@basecamp.com
44
43
  executables: []
45
44
  extensions: []
46
45
  extra_rdoc_files: []
@@ -54,11 +53,6 @@ files:
54
53
  - MIT-LICENSE
55
54
  - README.md
56
55
  - Rakefile
57
- - gemfiles/rails_3_0.gemfile
58
- - gemfiles/rails_3_1.gemfile
59
- - gemfiles/rails_3_2.gemfile
60
- - gemfiles/rails_4_0.gemfile
61
- - gemfiles/rails_4_1.gemfile
62
56
  - gemfiles/rails_4_2.gemfile
63
57
  - gemfiles/rails_5_0.gemfile
64
58
  - gemfiles/rails_5_1.gemfile
@@ -105,7 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
105
99
  version: '0'
106
100
  requirements: []
107
101
  rubyforge_project:
108
- rubygems_version: 2.6.8
102
+ rubygems_version: 2.6.11
109
103
  signing_key:
110
104
  specification_version: 4
111
105
  summary: Create JSON structures via a Builder-style DSL
@@ -1,14 +0,0 @@
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 "pry"
9
- gem "test-unit"
10
- gem "railties", "~> 3.0.0"
11
- gem "actionpack", "~> 3.0.0"
12
- gem "activemodel", "~> 3.0.0"
13
-
14
- gemspec :path => "../"
@@ -1,14 +0,0 @@
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 "pry"
9
- gem "test-unit"
10
- gem "railties", "~> 3.1.0"
11
- gem "actionpack", "~> 3.1.0"
12
- gem "activemodel", "~> 3.1.0"
13
-
14
- gemspec :path => "../"
@@ -1,14 +0,0 @@
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 "pry"
9
- gem "test-unit"
10
- gem "railties", "~> 3.2.0"
11
- gem "actionpack", "~> 3.2.0"
12
- gem "activemodel", "~> 3.2.0"
13
-
14
- gemspec :path => "../"
@@ -1,13 +0,0 @@
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 "pry"
9
- gem "railties", "~> 4.0.0"
10
- gem "actionpack", "~> 4.0.0"
11
- gem "activemodel", "~> 4.0.0"
12
-
13
- gemspec :path => "../"
@@ -1,13 +0,0 @@
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 "pry"
9
- gem "railties", "~> 4.1.0"
10
- gem "actionpack", "~> 4.1.0"
11
- gem "activemodel", "~> 4.1.0"
12
-
13
- gemspec :path => "../"