jbuilder 1.5.2 → 1.5.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 158b02263bd156e812d95710565da2a08996111a
4
- data.tar.gz: 83c5430a9382a9a074d0fcca66999b605f18bd22
3
+ metadata.gz: f96d267675b1f3a2c1b8362acec6cb5d6041594a
4
+ data.tar.gz: 16a89009d403703f5c2bab75b7db39e8a976043e
5
5
  SHA512:
6
- metadata.gz: 6d1cbb500554eb7367065d90c36034324ce4234f7bb3cb6642f5d76afde7f123ac5101adb511f89d82c072864cd96b1d2aafb3906b8b7af4c7efab6568f2c005
7
- data.tar.gz: b60816efa65a497f3841f6d6e677461307e04873d2b23acbf2be274a9027c938a73414c73155292b1b945346cbe4b879326ed4d944eeebe4e35123bbc1f579eb
6
+ metadata.gz: 03e2efc5e9463f76a49560f1c61db48b02ad2d456399bc5aeed9a2cf47e8c919d59632c79141d696bf33ccd4cc1466fcb17dfab1d2f5f929924c6e386083ee9d
7
+ data.tar.gz: bcd576dd31be8b43e423612409ffae5051994bec4351f6fac4bd1ba0b1a5cf94ae091cb39570767c8949ea7a0d6f806ab13b2bbca5fbf7bc4bb6af91238717f0
data/Rakefile CHANGED
@@ -4,10 +4,10 @@ require 'rake/testtask'
4
4
  Bundler.require
5
5
 
6
6
  Rake::TestTask.new do |test|
7
- if defined?(::Rails::Railtie)
8
- test.test_files = FileList['test/*_test.rb']
9
- else
7
+ if /old$/ === ENV['BUNDLE_GEMFILE']
10
8
  test.test_files = %w(test/jbuilder_template_test.rb test/jbuilder_test.rb)
9
+ else
10
+ test.test_files = FileList['test/*_test.rb']
11
11
  end
12
12
  end
13
13
 
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'jbuilder'
3
- s.version = '1.5.2'
3
+ s.version = '1.5.3'
4
4
  s.author = 'David Heinemeier Hansson'
5
5
  s.email = 'david@37signals.com'
6
6
  s.summary = 'Create JSON structures via a Builder-style DSL'
@@ -24,6 +24,10 @@ module Rails
24
24
 
25
25
 
26
26
  protected
27
+ def attributes_names
28
+ [:id] + super
29
+ end
30
+
27
31
  def filename_with_extensions(name)
28
32
  [name, :json, :jbuilder] * '.'
29
33
  end
@@ -1,3 +1,4 @@
1
+ require 'jbuilder'
1
2
  require 'action_dispatch/http/mime_type'
2
3
 
3
4
  class JbuilderTemplate < Jbuilder
@@ -20,12 +20,12 @@ class JbuilderGeneratorTest < Rails::Generators::TestCase
20
20
 
21
21
  assert_file 'app/views/posts/index.json.jbuilder' do |content|
22
22
  assert_match /json\.array!\(@posts\) do \|post\|/, content
23
- assert_match /json\.extract! post, :title, :body/, content
23
+ assert_match /json\.extract! post, :id, :title, :body/, content
24
24
  assert_match /json\.url post_url\(post, format: :json\)/, content
25
25
  end
26
26
 
27
27
  assert_file 'app/views/posts/show.json.jbuilder' do |content|
28
- assert_match /json\.extract! @post, :title, :body, :created_at, :updated_at/, content
28
+ assert_match /json\.extract! @post, :id, :title, :body, :created_at, :updated_at/, content
29
29
  end
30
30
  end
31
31
  end
@@ -3,7 +3,7 @@ require 'mocha/setup'
3
3
  require 'action_view'
4
4
  require 'action_view/testing/resolvers'
5
5
  require 'active_support/cache'
6
- require 'jbuilder'
6
+ require 'jbuilder/jbuilder_template'
7
7
 
8
8
 
9
9
  BLOG_POST_PARTIAL = <<-JBUILDER
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: 1.5.2
4
+ version: 1.5.3
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: 2013-10-09 00:00:00.000000000 Z
11
+ date: 2013-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -84,7 +84,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
84
84
  version: '0'
85
85
  requirements: []
86
86
  rubyforge_project:
87
- rubygems_version: 2.1.5
87
+ rubygems_version: 2.0.14
88
88
  signing_key:
89
89
  specification_version: 4
90
90
  summary: Create JSON structures via a Builder-style DSL
@@ -93,4 +93,3 @@ test_files:
93
93
  - test/jbuilder_template_test.rb
94
94
  - test/jbuilder_test.rb
95
95
  - test/scaffold_controller_generator_test.rb
96
- has_rdoc: