jbuilder 2.0.6 → 2.0.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: f4fdd523704c197ce14437d1a214a73b2e5b62f8
4
- data.tar.gz: 3ebc55bfe588bedd2526887fd729984ac98b3343
3
+ metadata.gz: 1ac35e89f1be991b27877ffd514d8491719d0f01
4
+ data.tar.gz: 317b4e79d56b2ec63b0a0248a5b26d2505581ca8
5
5
  SHA512:
6
- metadata.gz: bb49f0356be9f9a726a45b6b640e12a56d85a16c186f6e0681bf06b7352fd1c950d547cb42822261fba5884d6a26564ba54cbb60f648b12b88fb490f4625e5ef
7
- data.tar.gz: 3ea321bd4ccf783086baab268c3081511c76d91ee8d4c47a48c4915ef8dc0cbf7688a02f4e5f07d56dda6b2403d05bd48873eccabc9a98ab55e35e3bc3c99bca
6
+ metadata.gz: 7207a0e288405e46fe0ff0469dde77087d07037f5a2a24541a046b947d1499ccff4ea3ab2e942794a4c1dd80995452531f77078c9b8a51305f819949a6d40a63
7
+ data.tar.gz: 5607ad86e9171df3e826ec12f1dbc63b10fff2215cf34ea9f55ff4c50a99a5376a61648b306aa0daf7bf5040fd2db7938a63c2f35ed0d471b918b99983f307a9
data/.gitignore CHANGED
@@ -1,4 +1,3 @@
1
1
  tmp
2
2
  Gemfile.lock
3
- Gemfile.old.lock
4
3
  .ruby-version
data/.travis.yml CHANGED
@@ -3,14 +3,16 @@ language: ruby
3
3
  rvm:
4
4
  - 1.9.3
5
5
  - 2.0.0
6
- - 2.1.0
7
6
  - 2.1.1
8
7
  - jruby-19mode
9
8
  - rbx
10
9
 
11
10
  gemfile:
12
- - Gemfile.old
13
- - Gemfile
11
+ - gemfiles/rails_3_0.gemfile
12
+ - gemfiles/rails_3_1.gemfile
13
+ - gemfiles/rails_3_2.gemfile
14
+ - gemfiles/rails_4_0.gemfile
15
+ - gemfiles/rails_4_1.gemfile
14
16
 
15
17
  matrix:
16
18
  allow_failures:
data/Appraisals ADDED
@@ -0,0 +1,24 @@
1
+ appraise "rails-3-0" do
2
+ gem "railties", "~> 3.0.0"
3
+ gem "actionpack", "~> 3.0.0"
4
+ end
5
+
6
+ appraise "rails-3-1" do
7
+ gem "railties", "~> 3.1.0"
8
+ gem "actionpack", "~> 3.1.0"
9
+ end
10
+
11
+ appraise "rails-3-2" do
12
+ gem "railties", "~> 3.2.0"
13
+ gem "actionpack", "~> 3.2.0"
14
+ end
15
+
16
+ appraise "rails-4-0" do
17
+ gem "railties", "~> 4.0.0"
18
+ gem "actionpack", "~> 4.0.0"
19
+ end
20
+
21
+ appraise "rails-4-1" do
22
+ gem "railties", "~> 4.1.0"
23
+ gem "actionpack", "~> 4.1.0"
24
+ end
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ 2.0.7
4
+ -----
5
+ * [Add destroy notice to scaffold generator](https://github.com/rails/jbuilder/commit/8448e86f8cdfa0f517bd59576947875775a1d43c)
6
+
7
+ 2.0.6
8
+ -----
9
+ * [Use render short form in controller generator](https://github.com/rails/jbuilder/commit/acf37320a7cea7fcc70c791bc94bd5f46b8349ff)
10
+
3
11
  2.0.5
4
12
  -----
5
13
  * [Fix edgecase when json is defined as a method](https://github.com/rails/jbuilder/commit/ca711a0c0a5760e26258ce2d93c14bef8fff0ead)
data/Gemfile CHANGED
@@ -1,15 +1,7 @@
1
- source 'https://rubygems.org'
1
+ source "https://rubygems.org"
2
2
 
3
3
  gemspec
4
4
 
5
- gem 'rake'
6
- gem 'railties', '~> 4.0.0'
7
- gem 'actionpack', '~> 4.0.0'
8
- gem 'mocha', require: false
9
-
10
- platforms :rbx do
11
- gem 'rubysl', '~> 2.0'
12
- gem 'json', '~> 1.8'
13
- gem 'rubysl-test-unit'
14
- gem 'rubinius-developer_tools'
15
- end
5
+ gem "rake"
6
+ gem "mocha", require: false
7
+ gem "appraisal"
data/README.md CHANGED
@@ -3,12 +3,17 @@
3
3
  [![Build Status](http://img.shields.io/travis/rails/jbuilder.svg)][travis]
4
4
  [![Gem Version](http://img.shields.io/gem/v/jbuilder.svg)][gem]
5
5
  [![Code Climate](http://img.shields.io/codeclimate/github/rails/jbuilder.svg)][codeclimate]
6
+ [![Dependencies Status](http://img.shields.io/gemnasium/rails/jbuilder.svg)][gemnasium]
6
7
 
7
8
  [travis]: https://travis-ci.org/rails/jbuilder
8
9
  [gem]: https://rubygems.org/gems/jbuilder
9
10
  [codeclimate]: https://codeclimate.com/github/rails/jbuilder
11
+ [gemnasium]: https://gemnasium.com/rails/jbuilder
10
12
 
11
- Jbuilder gives you a simple DSL for declaring JSON structures that beats massaging giant hash structures. This is particularly helpful when the generation process is fraught with conditionals and loops. Here's a simple example:
13
+ Jbuilder gives you a simple DSL for declaring JSON structures that beats
14
+ massaging giant hash structures. This is particularly helpful when the
15
+ generation process is fraught with conditionals and loops. Here's a simple
16
+ example:
12
17
 
13
18
  ``` ruby
14
19
  Jbuilder.encode do |json|
@@ -121,7 +126,9 @@ company.to_builder.target!
121
126
  # => {"name":"Doodle Corp","president":{"name":"John Stobs","age":58}}
122
127
  ```
123
128
 
124
- You can either use Jbuilder stand-alone or directly as an ActionView template language. When required in Rails, you can create views ala show.json.jbuilder (the json is already yielded):
129
+ You can either use Jbuilder stand-alone or directly as an ActionView template
130
+ language. When required in Rails, you can create views ala show.json.jbuilder
131
+ (the json is already yielded):
125
132
 
126
133
  ``` ruby
127
134
  # Any helpers available to views are available to the builder
@@ -181,7 +188,8 @@ json.author do
181
188
  end
182
189
  ```
183
190
 
184
- Fragment caching is supported, it uses `Rails.cache` and works like caching in HTML templates:
191
+ Fragment caching is supported, it uses `Rails.cache` and works like caching in
192
+ HTML templates:
185
193
 
186
194
  ```ruby
187
195
  json.cache! ['v1', @person], expires_in: 10.minutes do
@@ -197,7 +205,8 @@ json.cache_if! !admin?, ['v1', @person], expires_in: 10.minutes do
197
205
  end
198
206
  ```
199
207
 
200
- Keys can be auto formatted using `key_format!`, this can be used to convert keynames from the standard ruby_format to CamelCase:
208
+ Keys can be auto formatted using `key_format!`, this can be used to convert
209
+ keynames from the standard ruby_format to camelCase:
201
210
 
202
211
  ``` ruby
203
212
  json.key_format! camelize: :lower
@@ -206,7 +215,8 @@ json.first_name 'David'
206
215
  # => { "firstName": "David" }
207
216
  ```
208
217
 
209
- You can set this globally with the class method `key_format` (from inside your environment.rb for example):
218
+ You can set this globally with the class method `key_format` (from inside your
219
+ environment.rb for example):
210
220
 
211
221
  ``` ruby
212
222
  Jbuilder.key_format camelize: :lower
@@ -215,7 +225,12 @@ Jbuilder.key_format camelize: :lower
215
225
  Faster JSON backends
216
226
  --------------------
217
227
 
218
- Jbuilder uses MultiJson, which by default will use the JSON gem. That gem is currently tangled with ActiveSupport's all-Ruby #to_json implementation, which is slow (work is being done to correct this for a future version of Rails). For faster Jbuilder rendering, you can specify something like the Yajl JSON generator instead. You'll need to include the yajl-ruby gem in your Gemfile and then set the following configuration for MultiJson:
228
+ Jbuilder uses MultiJson, which by default will use the JSON gem. That gem is
229
+ currently tangled with ActiveSupport's all-Ruby `#to_json` implementation,
230
+ which is slow (fixed in Rails >= 4.1). For faster Jbuilder rendering, you can
231
+ specify something like the Yajl JSON generator instead. You'll need to include
232
+ the `yajl-ruby` gem in your Gemfile and then set the following configuration
233
+ for MultiJson:
219
234
 
220
235
  ``` ruby
221
236
  require 'multi_json'
data/Rakefile CHANGED
@@ -1,14 +1,22 @@
1
- require 'bundler'
2
- require 'rake/testtask'
1
+ require "bundler/setup"
2
+ require "rake/testtask"
3
3
 
4
- Bundler.require
4
+ if !ENV["APPRAISAL_INITIALIZED"] && !ENV["TRAVIS"]
5
+ require "appraisal/task"
6
+ Appraisal::Task.new
7
+ task default: :appraisal
8
+ else
9
+ Rake::TestTask.new do |test|
10
+ require "rails/version"
5
11
 
6
- Rake::TestTask.new do |test|
7
- if /old$/ === ENV['BUNDLE_GEMFILE']
8
- test.test_files = %w(test/jbuilder_template_test.rb test/jbuilder_test.rb)
9
- else
10
- test.test_files = FileList['test/*_test.rb']
12
+ test.libs << "test"
13
+
14
+ if Rails::VERSION::MAJOR == 3
15
+ test.test_files = %w[test/jbuilder_template_test.rb test/jbuilder_test.rb]
16
+ else
17
+ test.test_files = FileList["test/*_test.rb"]
18
+ end
11
19
  end
12
- end
13
20
 
14
- task :default => :test
21
+ task default: :test
22
+ end
@@ -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", "~> 3.0.0"
9
+ gem "actionpack", "~> 3.0.0"
10
+
11
+ gemspec :path => "../"
@@ -0,0 +1,66 @@
1
+ PATH
2
+ remote: ../
3
+ specs:
4
+ jbuilder (2.0.6)
5
+ activesupport (>= 3.0.0, < 5)
6
+ multi_json (~> 1.2)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ abstract (1.0.0)
12
+ actionpack (3.0.20)
13
+ activemodel (= 3.0.20)
14
+ activesupport (= 3.0.20)
15
+ builder (~> 2.1.2)
16
+ erubis (~> 2.6.6)
17
+ i18n (~> 0.5.0)
18
+ rack (~> 1.2.5)
19
+ rack-mount (~> 0.6.14)
20
+ rack-test (~> 0.5.7)
21
+ tzinfo (~> 0.3.23)
22
+ activemodel (3.0.20)
23
+ activesupport (= 3.0.20)
24
+ builder (~> 2.1.2)
25
+ i18n (~> 0.5.0)
26
+ activesupport (3.0.20)
27
+ appraisal (1.0.0)
28
+ bundler
29
+ rake
30
+ thor (>= 0.14.0)
31
+ builder (2.1.2)
32
+ erubis (2.6.6)
33
+ abstract (>= 1.0.0)
34
+ i18n (0.5.3)
35
+ json (1.8.1)
36
+ metaclass (0.0.4)
37
+ mocha (1.0.0)
38
+ metaclass (~> 0.0.1)
39
+ multi_json (1.9.2)
40
+ rack (1.2.8)
41
+ rack-mount (0.6.14)
42
+ rack (>= 1.0.0)
43
+ rack-test (0.5.7)
44
+ rack (>= 1.0)
45
+ railties (3.0.20)
46
+ actionpack (= 3.0.20)
47
+ activesupport (= 3.0.20)
48
+ rake (>= 0.8.7)
49
+ rdoc (~> 3.4)
50
+ thor (~> 0.14.4)
51
+ rake (10.3.1)
52
+ rdoc (3.12.2)
53
+ json (~> 1.4)
54
+ thor (0.14.6)
55
+ tzinfo (0.3.39)
56
+
57
+ PLATFORMS
58
+ ruby
59
+
60
+ DEPENDENCIES
61
+ actionpack (~> 3.0.0)
62
+ appraisal
63
+ jbuilder!
64
+ mocha
65
+ railties (~> 3.0.0)
66
+ rake
@@ -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", "~> 3.1.0"
9
+ gem "actionpack", "~> 3.1.0"
10
+
11
+ gemspec :path => "../"
@@ -0,0 +1,76 @@
1
+ PATH
2
+ remote: ../
3
+ specs:
4
+ jbuilder (2.0.6)
5
+ activesupport (>= 3.0.0, < 5)
6
+ multi_json (~> 1.2)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ actionpack (3.1.12)
12
+ activemodel (= 3.1.12)
13
+ activesupport (= 3.1.12)
14
+ builder (~> 3.0.0)
15
+ erubis (~> 2.7.0)
16
+ i18n (~> 0.6)
17
+ rack (~> 1.3.6)
18
+ rack-cache (~> 1.2)
19
+ rack-mount (~> 0.8.2)
20
+ rack-test (~> 0.6.1)
21
+ sprockets (~> 2.0.4)
22
+ activemodel (3.1.12)
23
+ activesupport (= 3.1.12)
24
+ builder (~> 3.0.0)
25
+ i18n (~> 0.6)
26
+ activesupport (3.1.12)
27
+ multi_json (~> 1.0)
28
+ appraisal (1.0.0)
29
+ bundler
30
+ rake
31
+ thor (>= 0.14.0)
32
+ builder (3.0.4)
33
+ erubis (2.7.0)
34
+ hike (1.2.3)
35
+ i18n (0.6.9)
36
+ json (1.8.1)
37
+ metaclass (0.0.4)
38
+ mocha (1.0.0)
39
+ metaclass (~> 0.0.1)
40
+ multi_json (1.9.2)
41
+ rack (1.3.10)
42
+ rack-cache (1.2)
43
+ rack (>= 0.4)
44
+ rack-mount (0.8.3)
45
+ rack (>= 1.0.0)
46
+ rack-ssl (1.3.4)
47
+ rack
48
+ rack-test (0.6.2)
49
+ rack (>= 1.0)
50
+ railties (3.1.12)
51
+ actionpack (= 3.1.12)
52
+ activesupport (= 3.1.12)
53
+ rack-ssl (~> 1.3.2)
54
+ rake (>= 0.8.7)
55
+ rdoc (~> 3.4)
56
+ thor (~> 0.14.6)
57
+ rake (10.3.1)
58
+ rdoc (3.12.2)
59
+ json (~> 1.4)
60
+ sprockets (2.0.4)
61
+ hike (~> 1.2)
62
+ rack (~> 1.0)
63
+ tilt (~> 1.1, != 1.3.0)
64
+ thor (0.14.6)
65
+ tilt (1.4.1)
66
+
67
+ PLATFORMS
68
+ ruby
69
+
70
+ DEPENDENCIES
71
+ actionpack (~> 3.1.0)
72
+ appraisal
73
+ jbuilder!
74
+ mocha
75
+ railties (~> 3.1.0)
76
+ rake
@@ -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", "~> 3.2.0"
9
+ gem "actionpack", "~> 3.2.0"
10
+
11
+ gemspec :path => "../"
@@ -0,0 +1,75 @@
1
+ PATH
2
+ remote: ../
3
+ specs:
4
+ jbuilder (2.0.6)
5
+ activesupport (>= 3.0.0, < 5)
6
+ multi_json (~> 1.2)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ actionpack (3.2.17)
12
+ activemodel (= 3.2.17)
13
+ activesupport (= 3.2.17)
14
+ builder (~> 3.0.0)
15
+ erubis (~> 2.7.0)
16
+ journey (~> 1.0.4)
17
+ rack (~> 1.4.5)
18
+ rack-cache (~> 1.2)
19
+ rack-test (~> 0.6.1)
20
+ sprockets (~> 2.2.1)
21
+ activemodel (3.2.17)
22
+ activesupport (= 3.2.17)
23
+ builder (~> 3.0.0)
24
+ activesupport (3.2.17)
25
+ i18n (~> 0.6, >= 0.6.4)
26
+ multi_json (~> 1.0)
27
+ appraisal (1.0.0)
28
+ bundler
29
+ rake
30
+ thor (>= 0.14.0)
31
+ builder (3.0.4)
32
+ erubis (2.7.0)
33
+ hike (1.2.3)
34
+ i18n (0.6.9)
35
+ journey (1.0.4)
36
+ json (1.8.1)
37
+ metaclass (0.0.4)
38
+ mocha (1.0.0)
39
+ metaclass (~> 0.0.1)
40
+ multi_json (1.9.2)
41
+ rack (1.4.5)
42
+ rack-cache (1.2)
43
+ rack (>= 0.4)
44
+ rack-ssl (1.3.4)
45
+ rack
46
+ rack-test (0.6.2)
47
+ rack (>= 1.0)
48
+ railties (3.2.17)
49
+ actionpack (= 3.2.17)
50
+ activesupport (= 3.2.17)
51
+ rack-ssl (~> 1.3.2)
52
+ rake (>= 0.8.7)
53
+ rdoc (~> 3.4)
54
+ thor (>= 0.14.6, < 2.0)
55
+ rake (10.3.1)
56
+ rdoc (3.12.2)
57
+ json (~> 1.4)
58
+ sprockets (2.2.2)
59
+ hike (~> 1.2)
60
+ multi_json (~> 1.0)
61
+ rack (~> 1.0)
62
+ tilt (~> 1.1, != 1.3.0)
63
+ thor (0.19.1)
64
+ tilt (1.4.1)
65
+
66
+ PLATFORMS
67
+ ruby
68
+
69
+ DEPENDENCIES
70
+ actionpack (~> 3.2.0)
71
+ appraisal
72
+ jbuilder!
73
+ mocha
74
+ railties (~> 3.2.0)
75
+ rake
@@ -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.0.0"
9
+ gem "actionpack", "~> 4.0.0"
10
+
11
+ gemspec :path => "../"
@@ -0,0 +1,57 @@
1
+ PATH
2
+ remote: ../
3
+ specs:
4
+ jbuilder (2.0.6)
5
+ activesupport (>= 3.0.0, < 5)
6
+ multi_json (~> 1.2)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ actionpack (4.0.4)
12
+ activesupport (= 4.0.4)
13
+ builder (~> 3.1.0)
14
+ erubis (~> 2.7.0)
15
+ rack (~> 1.5.2)
16
+ rack-test (~> 0.6.2)
17
+ activesupport (4.0.4)
18
+ i18n (~> 0.6, >= 0.6.9)
19
+ minitest (~> 4.2)
20
+ multi_json (~> 1.3)
21
+ thread_safe (~> 0.1)
22
+ tzinfo (~> 0.3.37)
23
+ appraisal (1.0.0)
24
+ bundler
25
+ rake
26
+ thor (>= 0.14.0)
27
+ builder (3.1.4)
28
+ erubis (2.7.0)
29
+ i18n (0.6.9)
30
+ metaclass (0.0.4)
31
+ minitest (4.7.5)
32
+ mocha (1.0.0)
33
+ metaclass (~> 0.0.1)
34
+ multi_json (1.9.2)
35
+ rack (1.5.2)
36
+ rack-test (0.6.2)
37
+ rack (>= 1.0)
38
+ railties (4.0.4)
39
+ actionpack (= 4.0.4)
40
+ activesupport (= 4.0.4)
41
+ rake (>= 0.8.7)
42
+ thor (>= 0.18.1, < 2.0)
43
+ rake (10.3.1)
44
+ thor (0.19.1)
45
+ thread_safe (0.3.3)
46
+ tzinfo (0.3.39)
47
+
48
+ PLATFORMS
49
+ ruby
50
+
51
+ DEPENDENCIES
52
+ actionpack (~> 4.0.0)
53
+ appraisal
54
+ jbuilder!
55
+ mocha
56
+ railties (~> 4.0.0)
57
+ rake
@@ -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.1.0"
9
+ gem "actionpack", "~> 4.1.0"
10
+
11
+ gemspec :path => "../"
@@ -0,0 +1,62 @@
1
+ PATH
2
+ remote: ../
3
+ specs:
4
+ jbuilder (2.0.6)
5
+ activesupport (>= 3.0.0, < 5)
6
+ multi_json (~> 1.2)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ actionpack (4.1.0)
12
+ actionview (= 4.1.0)
13
+ activesupport (= 4.1.0)
14
+ rack (~> 1.5.2)
15
+ rack-test (~> 0.6.2)
16
+ actionview (4.1.0)
17
+ activesupport (= 4.1.0)
18
+ builder (~> 3.1)
19
+ erubis (~> 2.7.0)
20
+ activesupport (4.1.0)
21
+ i18n (~> 0.6, >= 0.6.9)
22
+ json (~> 1.7, >= 1.7.7)
23
+ minitest (~> 5.1)
24
+ thread_safe (~> 0.1)
25
+ tzinfo (~> 1.1)
26
+ appraisal (1.0.0)
27
+ bundler
28
+ rake
29
+ thor (>= 0.14.0)
30
+ builder (3.2.2)
31
+ erubis (2.7.0)
32
+ i18n (0.6.9)
33
+ json (1.8.1)
34
+ metaclass (0.0.4)
35
+ minitest (5.3.3)
36
+ mocha (1.0.0)
37
+ metaclass (~> 0.0.1)
38
+ multi_json (1.9.2)
39
+ rack (1.5.2)
40
+ rack-test (0.6.2)
41
+ rack (>= 1.0)
42
+ railties (4.1.0)
43
+ actionpack (= 4.1.0)
44
+ activesupport (= 4.1.0)
45
+ rake (>= 0.8.7)
46
+ thor (>= 0.18.1, < 2.0)
47
+ rake (10.3.1)
48
+ thor (0.19.1)
49
+ thread_safe (0.3.3)
50
+ tzinfo (1.1.0)
51
+ thread_safe (~> 0.1)
52
+
53
+ PLATFORMS
54
+ ruby
55
+
56
+ DEPENDENCIES
57
+ actionpack (~> 4.1.0)
58
+ appraisal
59
+ jbuilder!
60
+ mocha
61
+ railties (~> 4.1.0)
62
+ rake
data/jbuilder.gemspec CHANGED
@@ -1,8 +1,8 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'jbuilder'
3
- s.version = '2.0.6'
4
- s.author = 'David Heinemeier Hansson'
5
- s.email = 'david@37signals.com'
3
+ s.version = '2.0.7'
4
+ s.authors = ['David Heinemeier Hansson', 'Pavel Pravosud']
5
+ s.email = ['david@37signals.com', 'pavel@pravosud.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'
@@ -61,7 +61,7 @@ class <%= controller_class_name %>Controller < ApplicationController
61
61
  def destroy
62
62
  @<%= orm_instance.destroy %>
63
63
  respond_to do |format|
64
- format.html { redirect_to <%= index_helper %>_url }
64
+ format.html { redirect_to <%= index_helper %>_url, notice: <%= "'#{human_name} was successfully destroyed.'" %> }
65
65
  format.json { head :no_content }
66
66
  end
67
67
  end
@@ -1,5 +1,4 @@
1
- require 'test/unit'
2
- require 'active_support/test_case'
1
+ require 'test_helper'
3
2
  require 'jbuilder/dependency_tracker'
4
3
 
5
4
 
@@ -1,3 +1,4 @@
1
+ require 'test_helper'
1
2
  require 'rails/generators/test_case'
2
3
  require 'generators/rails/jbuilder_generator'
3
4
 
@@ -1,4 +1,4 @@
1
- require 'test/unit'
1
+ require 'test_helper'
2
2
  require 'mocha/setup'
3
3
  require 'action_view'
4
4
  require 'action_view/testing/resolvers'
@@ -289,4 +289,4 @@ class JbuilderTemplateTest < ActionView::TestCase
289
289
  JBUILDER
290
290
  end
291
291
 
292
- end
292
+ end
@@ -1,5 +1,4 @@
1
- require 'test/unit'
2
- require 'active_support/test_case'
1
+ require 'test_helper'
3
2
  require 'active_support/inflector'
4
3
  require 'jbuilder'
5
4
 
@@ -1,3 +1,4 @@
1
+ require 'test_helper'
1
2
  require 'rails/generators/test_case'
2
3
  require 'generators/rails/scaffold_controller_generator'
3
4
 
@@ -45,7 +46,7 @@ class ScaffoldControllerGeneratorTest < Rails::Generators::TestCase
45
46
 
46
47
  assert_instance_method :destroy, content do |m|
47
48
  assert_match /@post\.destroy/, m
48
- assert_match /format\.html { redirect_to posts_url \}/, m
49
+ assert_match /format\.html \{ redirect_to posts_url, notice: 'Post was successfully destroyed\.' \}/, m
49
50
  assert_match /format\.json \{ head :no_content \}/, m
50
51
  end
51
52
 
@@ -53,4 +54,4 @@ class ScaffoldControllerGeneratorTest < Rails::Generators::TestCase
53
54
  assert_match(/params\.require\(:post\)\.permit\(:title, :body\)/, content)
54
55
  end
55
56
  end
56
- end
57
+ end
@@ -0,0 +1,10 @@
1
+ require "bundler/setup"
2
+ require "rails/version"
3
+
4
+ if Rails::VERSION::STRING > "4.0"
5
+ require "active_support/testing/autorun"
6
+ else
7
+ require "test/unit"
8
+ end
9
+
10
+ require "active_support/test_case"
metadata CHANGED
@@ -1,14 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jbuilder
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.6
4
+ version: 2.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
8
+ - Pavel Pravosud
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2014-04-08 00:00:00.000000000 Z
12
+ date: 2014-05-02 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: activesupport
@@ -45,19 +46,31 @@ dependencies:
45
46
  - !ruby/object:Gem::Version
46
47
  version: '1.2'
47
48
  description:
48
- email: david@37signals.com
49
+ email:
50
+ - david@37signals.com
51
+ - pavel@pravosud.com
49
52
  executables: []
50
53
  extensions: []
51
54
  extra_rdoc_files: []
52
55
  files:
53
56
  - ".gitignore"
54
57
  - ".travis.yml"
58
+ - Appraisals
55
59
  - CHANGELOG.md
56
60
  - Gemfile
57
- - Gemfile.old
58
61
  - MIT-LICENSE
59
62
  - README.md
60
63
  - Rakefile
64
+ - gemfiles/rails_3_0.gemfile
65
+ - gemfiles/rails_3_0.gemfile.lock
66
+ - gemfiles/rails_3_1.gemfile
67
+ - gemfiles/rails_3_1.gemfile.lock
68
+ - gemfiles/rails_3_2.gemfile
69
+ - gemfiles/rails_3_2.gemfile.lock
70
+ - gemfiles/rails_4_0.gemfile
71
+ - gemfiles/rails_4_0.gemfile.lock
72
+ - gemfiles/rails_4_1.gemfile
73
+ - gemfiles/rails_4_1.gemfile.lock
61
74
  - jbuilder.gemspec
62
75
  - lib/generators/rails/jbuilder_generator.rb
63
76
  - lib/generators/rails/scaffold_controller_generator.rb
@@ -73,6 +86,7 @@ files:
73
86
  - test/jbuilder_template_test.rb
74
87
  - test/jbuilder_test.rb
75
88
  - test/scaffold_controller_generator_test.rb
89
+ - test/test_helper.rb
76
90
  homepage: https://github.com/rails/jbuilder
77
91
  licenses:
78
92
  - MIT
@@ -93,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
93
107
  version: '0'
94
108
  requirements: []
95
109
  rubyforge_project:
96
- rubygems_version: 2.2.0
110
+ rubygems_version: 2.2.2
97
111
  signing_key:
98
112
  specification_version: 4
99
113
  summary: Create JSON structures via a Builder-style DSL
@@ -103,3 +117,4 @@ test_files:
103
117
  - test/jbuilder_template_test.rb
104
118
  - test/jbuilder_test.rb
105
119
  - test/scaffold_controller_generator_test.rb
120
+ - test/test_helper.rb
data/Gemfile.old DELETED
@@ -1,14 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gemspec
4
-
5
- gem 'rake'
6
- gem 'mocha', :require => false
7
- gem 'actionpack', '~> 3.0'
8
-
9
- platforms :rbx do
10
- gem 'rubysl', '~> 2.0'
11
- gem 'json', '~> 1.8'
12
- gem 'rubysl-test-unit'
13
- gem 'rubinius-developer_tools'
14
- end