rabl 0.13.1 → 0.14.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (95) hide show
  1. checksums.yaml +5 -5
  2. data/.travis.yml +4 -2
  3. data/CHANGELOG.md +4 -0
  4. data/README.md +16 -10
  5. data/Rakefile +12 -3
  6. data/fixtures/ashared/NOTES +46 -0
  7. data/fixtures/ashared/controllers_rails_5/posts_controller.rb +17 -0
  8. data/fixtures/ashared/controllers_rails_5/users_controller.rb +11 -0
  9. data/fixtures/{rails5/app → ashared}/helpers/application_helper.rb +0 -0
  10. data/fixtures/rails3/db/schema.rb +42 -0
  11. data/fixtures/rails4/Gemfile +5 -1
  12. data/fixtures/rails4/config/environments/test.rb +3 -0
  13. data/fixtures/rails4/db/schema.rb +42 -0
  14. data/fixtures/rails5/Gemfile +1 -0
  15. data/fixtures/rails5/Rakefile +1 -1
  16. data/fixtures/rails5/app/controllers/posts_controller.rb +1 -0
  17. data/fixtures/rails5/app/controllers/users_controller.rb +1 -0
  18. data/fixtures/rails5/app/helpers +1 -0
  19. data/fixtures/rails5/config/initializers/mime_types.rb +2 -0
  20. data/fixtures/rails5/test/functional/posts_controller_test.rb +1 -0
  21. data/fixtures/rails5/test/functional/users_controller_test.rb +1 -0
  22. data/fixtures/rails5_api/.gitignore +21 -0
  23. data/fixtures/rails5_api/Gemfile +46 -0
  24. data/fixtures/rails5_api/README.md +24 -0
  25. data/fixtures/rails5_api/Rakefile +13 -0
  26. data/fixtures/rails5_api/app/channels/application_cable/channel.rb +4 -0
  27. data/fixtures/rails5_api/app/channels/application_cable/connection.rb +4 -0
  28. data/fixtures/rails5_api/app/controllers/application_controller.rb +2 -0
  29. data/fixtures/rails5_api/app/controllers/concerns/.keep +0 -0
  30. data/fixtures/rails5_api/app/controllers/posts_controller.rb +1 -0
  31. data/fixtures/rails5_api/app/controllers/users_controller.rb +1 -0
  32. data/fixtures/rails5_api/app/helpers +1 -0
  33. data/fixtures/rails5_api/app/jobs/application_job.rb +2 -0
  34. data/fixtures/rails5_api/app/mailers/application_mailer.rb +4 -0
  35. data/fixtures/rails5_api/app/models +1 -0
  36. data/fixtures/rails5_api/app/views +1 -0
  37. data/fixtures/rails5_api/bin/bundle +3 -0
  38. data/fixtures/rails5_api/bin/rails +9 -0
  39. data/fixtures/rails5_api/bin/rake +9 -0
  40. data/fixtures/rails5_api/bin/setup +34 -0
  41. data/fixtures/rails5_api/bin/spring +17 -0
  42. data/fixtures/rails5_api/bin/update +29 -0
  43. data/fixtures/rails5_api/config.ru +5 -0
  44. data/fixtures/rails5_api/config/application.rb +30 -0
  45. data/fixtures/rails5_api/config/boot.rb +3 -0
  46. data/fixtures/rails5_api/config/cable.yml +9 -0
  47. data/fixtures/rails5_api/config/database.yml +25 -0
  48. data/fixtures/rails5_api/config/environment.rb +5 -0
  49. data/fixtures/rails5_api/config/environments/development.rb +47 -0
  50. data/fixtures/rails5_api/config/environments/production.rb +78 -0
  51. data/fixtures/rails5_api/config/environments/test.rb +42 -0
  52. data/fixtures/rails5_api/config/initializers/application_controller_renderer.rb +6 -0
  53. data/fixtures/rails5_api/config/initializers/backtrace_silencers.rb +7 -0
  54. data/fixtures/rails5_api/config/initializers/cors.rb +16 -0
  55. data/fixtures/rails5_api/config/initializers/filter_parameter_logging.rb +4 -0
  56. data/fixtures/rails5_api/config/initializers/inflections.rb +16 -0
  57. data/fixtures/rails5_api/config/initializers/mime_types.rb +5 -0
  58. data/fixtures/rails5_api/config/initializers/new_framework_defaults.rb +18 -0
  59. data/fixtures/rails5_api/config/initializers/wrap_parameters.rb +14 -0
  60. data/fixtures/rails5_api/config/locales/en.yml +23 -0
  61. data/fixtures/rails5_api/config/puma.rb +47 -0
  62. data/fixtures/rails5_api/config/routes.rb +8 -0
  63. data/fixtures/rails5_api/config/secrets.yml +22 -0
  64. data/fixtures/rails5_api/config/spring.rb +6 -0
  65. data/fixtures/rails5_api/db/migrate +1 -0
  66. data/fixtures/rails5_api/db/schema.rb +41 -0
  67. data/fixtures/rails5_api/db/seeds.rb +7 -0
  68. data/fixtures/rails5_api/lib/tasks/.keep +0 -0
  69. data/fixtures/rails5_api/log/.keep +0 -0
  70. data/fixtures/rails5_api/public/robots.txt +5 -0
  71. data/fixtures/rails5_api/test/controllers/.keep +0 -0
  72. data/fixtures/rails5_api/test/fixtures/.keep +0 -0
  73. data/fixtures/rails5_api/test/fixtures/files/.keep +0 -0
  74. data/fixtures/rails5_api/test/functional/posts_controller_test.rb +1 -0
  75. data/fixtures/rails5_api/test/functional/users_controller_test.rb +1 -0
  76. data/fixtures/rails5_api/test/integration/.keep +0 -0
  77. data/fixtures/rails5_api/test/mailers/.keep +0 -0
  78. data/fixtures/rails5_api/test/models/.keep +0 -0
  79. data/fixtures/rails5_api/test/test_helper.rb +39 -0
  80. data/fixtures/rails5_api/tmp/.keep +0 -0
  81. data/lib/rabl.rb +1 -1
  82. data/lib/rabl/builder.rb +13 -3
  83. data/lib/rabl/configuration.rb +2 -0
  84. data/lib/rabl/engine.rb +2 -0
  85. data/lib/rabl/railtie.rb +17 -0
  86. data/lib/rabl/version.rb +1 -1
  87. data/rabl.gemspec +1 -1
  88. data/test/builder_test.rb +26 -0
  89. data/test/engine_test.rb +6 -0
  90. data/test/integration/rails5/posts_controller_test.rb +251 -0
  91. data/test/integration/rails5/users_controller_test.rb +87 -0
  92. data/test/models/user.rb +10 -9
  93. metadata +74 -6
  94. data/fixtures/rails5/app/controllers/posts_controller.rb +0 -17
  95. data/fixtures/rails5/app/controllers/users_controller.rb +0 -11
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 69b64e79c938fa56b79fa08d95a97f92c4f1fff8
4
- data.tar.gz: 92afd63714dd8aae58385ed097682baab04c81ab
2
+ SHA256:
3
+ metadata.gz: 0f39e37962add4e967db96ddb7970e8b5567180494024c83ab1cd0f40b215789
4
+ data.tar.gz: f61f64c38bb2baf81ce33885feb2fb7a9fc3a9e3587a8767f08d29cacb88a455
5
5
  SHA512:
6
- metadata.gz: 7721e7744da0a52bd67aea61d060a1db815cb926b9f4b7e019519ad581ba35ab1a0af5eefe4dfe9fc9cc22fff3e24c3479f2e54a66810180047ca6d93c993363
7
- data.tar.gz: 95df50736a71777c09a731eb9cc3e9752a7282e3a22bf93ebd1da7c1a024fd1d6771351e2d84b8097bef872580c43d6556a37d4c0a75c891f730bed46e45cc3d
6
+ metadata.gz: fffcd3104d9a52f11ea39205040858112b12199df5062ad7e3bce56d5ef12f02c97718974bb11765cc2afbde585a8190d0aa93630e655b588d76d66a503854f2
7
+ data.tar.gz: 8a780a5d5dc6ca50da1183a71d2292bee13be1abbaffa8f7c7972854c009265c32543710a8879f8de1cbc1d7186cfd48b5d2528907e184a918832b07675f6d50
@@ -5,8 +5,10 @@ rvm:
5
5
  - 1.9.3
6
6
  - 2.0.0
7
7
  - 2.1
8
- - 2.2.5
9
- - 2.3.1
8
+ - 2.2
9
+ - 2.3
10
+ - 2.4
11
+ - 2.5
10
12
  notifications:
11
13
  recipients:
12
14
  - nesquena@gmail.com
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 0.14.0 (October 31st, 2018)
4
+
5
+ * Compatibility with Rails 5 API mode
6
+
3
7
  ## 0.13.1 (October 21st, 2016)
4
8
 
5
9
  * Further compatibility with Rails 5
data/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # RABL #
2
2
 
3
- [![Continuous Integration status](https://secure.travis-ci.org/nesquena/rabl.png)](http://travis-ci.org/nesquena/rabl)
4
- [![Dependency Status](https://gemnasium.com/nesquena/rabl.png)](https://gemnasium.com/nesquena/rabl)
5
- [![Code Climate](https://codeclimate.com/github/nesquena/rabl.png)](https://codeclimate.com/github/nesquena/rabl)
3
+ [![Continuous Integration status](https://secure.travis-ci.org/nesquena/rabl.svg)](http://travis-ci.org/nesquena/rabl)
4
+ [![Dependency Status](https://gemnasium.com/nesquena/rabl.svg)](https://gemnasium.com/nesquena/rabl)
5
+ [![Code Climate](https://codeclimate.com/github/nesquena/rabl.svg)](https://codeclimate.com/github/nesquena/rabl)
6
6
 
7
7
  RABL (Ruby API Builder Language) is a Rails and [Padrino](http://padrinorb.com) ruby templating system for generating JSON, XML, MessagePack, PList and BSON.
8
8
  When using the ActiveRecord 'to_json' method, I find myself wanting a more expressive and powerful solution for generating APIs.
@@ -146,6 +146,7 @@ Rabl.configure do |config|
146
146
  # config.replace_empty_string_values_with_nil_values = true # Defaults to false
147
147
  # config.exclude_nil_values = true # Defaults to false
148
148
  # config.exclude_empty_values_in_collections = true # Defaults to false
149
+ # config.camelize_keys = :upper # Defaults to false
149
150
  end
150
151
  ```
151
152
 
@@ -186,6 +187,8 @@ If `exclude_nil_values` is set to `true`, all values that are `nil` and would no
186
187
 
187
188
  if `exclude_empty_values_in_collections` is set to `true`, all vaules in a collection that are `{}` and would normally be displayed as `{}` in the response are not included in the response.
188
189
 
190
+ If `camelize_keys` is set to `true`, all object keys will be converted to camel case. By default the first character will be lower case. The value can be set to `:upper` to set the first chracter to upper case.
191
+
189
192
  If you wish to use [oj](https://github.com/ohler55/oj) as
190
193
  the primary JSON encoding engine simply add that to your Gemfile:
191
194
 
@@ -300,6 +303,13 @@ Named and aliased attributes can not be combined on the same line. This currentl
300
303
  attributes :foo, :bar => :baz # throws exception
301
304
  ```
302
305
 
306
+ in such cases, you need to specify attributes twice.
307
+
308
+ ```ruby
309
+ attributes :foo
310
+ attributes :bar => :baz
311
+ ```
312
+
303
313
  ### Child Nodes ###
304
314
 
305
315
  Often a response requires including nested information from data associated with the parent model:
@@ -580,11 +590,11 @@ You can also pass in other instance variables to be used in your template as:
580
590
  Rabl::Renderer.new('posts/show', @post, :locals => { :custom_title => "Hello world!" })
581
591
  ````
582
592
 
583
- Then, in your template, you can use `@custom_title` as:
593
+ Then, in your template, you can use `locals[:custom_title]` as:
584
594
 
585
- ```
595
+ ```ruby
586
596
  attribute :content
587
- node(:title) { @custom_title }
597
+ node(:title) { locals[:custom_title] }
588
598
  ```
589
599
 
590
600
  ### Content Type Headers ###
@@ -624,13 +634,9 @@ Tutorials can always be helpful when first getting started:
624
634
 
625
635
  * [Railscasts #322](http://railscasts.com/episodes/322-rabl) - Ryan Bates explains RABL
626
636
  * [BackboneRails](http://www.backbonerails.com/) - Great screencasts by Brian Mann
627
- * [Creating an API with RABL and Padrino](http://blog.crowdint.com/2012/10/22/rabl-with-padrino.html)
628
637
  * http://blog.joshsoftware.com/2011/12/23/designing-rails-api-using-rabl-and-devise/
629
- * http://engineering.gomiso.com/2011/06/27/building-a-platform-api-on-rails/
630
- * http://blog.lawrencenorton.com/better-json-requests-with-rabl
631
638
  * http://tech.favoritemedium.com/2011/06/using-rabl-in-rails-json-web-api.html
632
639
  * http://seesparkbox.com/foundry/better_rails_apis_with_rabl
633
- * http://blog.dcxn.com/2011/06/22/rails-json-templates-through-rabl
634
640
  * http://teohm.github.com/blog/2011/05/31/using-rabl-in-rails-json-web-api
635
641
 
636
642
  Let me know if there's any other useful resources not listed here.
data/Rakefile CHANGED
@@ -9,7 +9,11 @@ Rake::TestTask.new(:test) do |test|
9
9
  test.pattern = 'test/*_test.rb'
10
10
  test.warning = true
11
11
  test.verbose = true
12
- test.ruby_opts = ['-rubygems']
12
+ if RUBY_VERSION < "1.9.0"
13
+ # -rubygems isn't needed as of 1.9, and is gone as of 2.5
14
+ # https://github.com/ruby/ruby/blob/v2_5_0/NEWS#stdlib-compatibility-issues-excluding-feature-bug-fixes
15
+ test.ruby_opts = ['-rubygems']
16
+ end
13
17
  end
14
18
 
15
19
  # Running integration tests
@@ -17,7 +21,7 @@ end
17
21
  # rake test:setup
18
22
  # rake test:full
19
23
 
20
- fixture_list = "{padrino_test,sinatra_test,rails2,rails3,rails3_2,rails4,rails5}"
24
+ fixture_list = "{padrino_test,sinatra_test,rails2,rails3,rails3_2,rails4,rails5,rails5_api}"
21
25
 
22
26
  desc "Clean up the fixtures being tested by cleaning and installing dependencies"
23
27
  task "test:clean" do
@@ -33,7 +37,12 @@ task "test:setup" do
33
37
  puts "\n*** Setting up for #{File.basename(fixture)} tests ***\n"
34
38
  `export BUNDLE_GEMFILE="#{fixture}/Gemfile"` if ENV["TRAVIS"]
35
39
  Bundler.with_clean_env {
36
- Dir.chdir(fixture) { puts `mkdir -p tmp/cache; bundle install --gemfile="#{fixture}/Gemfile"`; }
40
+ Dir.chdir(fixture) {
41
+ puts `mkdir -p tmp/cache; bundle install --gemfile="#{fixture}/Gemfile"`
42
+ if fixture.include? 'rails'
43
+ puts `bundle exec rake db:reset`
44
+ end
45
+ }
37
46
  }
38
47
  end
39
48
  end
@@ -42,3 +42,49 @@ ln -s "../../ashared/views_rails_3/" app/views
42
42
  ln -s "../../ashared/migrate" db/migrate
43
43
  ln -s ../../../../test/integration/rails3_2/posts_controller_test.rb test/functional/posts_controller_test.rb
44
44
  ln -s ../../../../test/integration/rails3_2/users_controller_test.rb test/functional/users_controller_test.rb
45
+
46
+ # Rails 5
47
+
48
+ cd fixtures/rails5
49
+ ln -s "../../ashared/models" app/models
50
+ ln -s "../../ashared/views_rails_3/" app/views
51
+ ln -s "../../ashared/migrate" db/migrate
52
+ ln -s "../../ashared/helpers" app/helpers
53
+ ln -s "../../../ashared/controllers_rails_5/posts_controller.rb" app/controllers/posts_controller.rb
54
+ ln -s "../../../ashared/controllers_rails_5/users_controller.rb" app/controllers/users_controller.rb
55
+ ln -s ../../../../test/integration/rails5/posts_controller_test.rb test/functional/posts_controller_test.rb
56
+ ln -s ../../../../test/integration/rails5/users_controller_test.rb test/functional/users_controller_test.rb
57
+ echo "Mime::Type.register 'application/vnd.rabl-test_v1+json', :rabl_test_v1" >> config/initializers/mime_types.rb
58
+ # Do route file?
59
+
60
+ # Rails 5 API mode
61
+
62
+ # Basic setup
63
+ cd fixtures
64
+ rvm use 2.5.0
65
+ rails _5.0.2_ new rails5_api --api
66
+ cd rails5_api
67
+
68
+ # Server config
69
+ echo "Mime::Type.register 'application/vnd.rabl-test_v1+json', :rabl_test_v1" >> config/initializers/mime_types.rb
70
+ cp ../rails5/config/routes.rb config/routes.rb
71
+
72
+ # Application
73
+ rm -r app/models app/views app/migrate
74
+ ln -s "../../ashared/models" app/models
75
+ ln -s "../../ashared/views_rails_3/" app/views
76
+ ln -s "../../ashared/migrate" db/migrate
77
+ ln -s "../../ashared/helpers" app/helpers
78
+ ln -s "../../../ashared/controllers_rails_5/posts_controller.rb" app/controllers/posts_controller.rb
79
+ ln -s "../../../ashared/controllers_rails_5/users_controller.rb" app/controllers/users_controller.rb
80
+
81
+ # Test setup
82
+ cp ../rails5/Rakefile ./
83
+ mkdir test/functional
84
+ ln -s ../../../../test/integration/rails5/posts_controller_test.rb test/functional/posts_controller_test.rb
85
+ ln -s ../../../../test/integration/rails5/users_controller_test.rb test/functional/users_controller_test.rb
86
+ cp ../rails5/test/test_helper.rb ./test/test_helper.rb
87
+
88
+ # Do a bunch of junk with gemfiles and test helpers and such
89
+
90
+ # end Rails 5 API mode
@@ -0,0 +1,17 @@
1
+ class PostsController < ApplicationController
2
+
3
+ respond_to :json, :xml, :html, :rabl_test_v1
4
+
5
+ def index
6
+ @posts = Post.order('id ASC').load
7
+ end
8
+
9
+ def show
10
+ @post = Post.find(params[:id])
11
+ end
12
+
13
+ def renderer
14
+ post = Post.find(params[:id])
15
+ render json: Rabl.render(post, 'posts/renderer', view_path: 'app/views', format: :json, scope: view_context)
16
+ end
17
+ end
@@ -0,0 +1,11 @@
1
+ class UsersController < ApplicationController
2
+ respond_to :json
3
+
4
+ def index
5
+ @users = User.order('username ASC').load
6
+ end
7
+
8
+ def show
9
+ @user = User.find(params[:id])
10
+ end
11
+ end
@@ -0,0 +1,42 @@
1
+ # encoding: UTF-8
2
+ # This file is auto-generated from the current state of the database. Instead
3
+ # of editing this file, please use the migrations feature of Active Record to
4
+ # incrementally modify your database, and then regenerate this schema definition.
5
+ #
6
+ # Note that this schema.rb definition is the authoritative source for your
7
+ # database schema. If you need to create the application database on another
8
+ # system, you should be using db:schema:load, not running all the migrations
9
+ # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
+ # you'll amass, the slower it'll run and the greater likelihood for issues).
11
+ #
12
+ # It's strongly recommended to check this file into your version control system.
13
+
14
+ ActiveRecord::Schema.define(:version => 20111002092024) do
15
+
16
+ create_table "phone_numbers", :force => true do |t|
17
+ t.integer "user_id"
18
+ t.boolean "is_primary"
19
+ t.string "area_code"
20
+ t.string "prefix"
21
+ t.string "suffix"
22
+ t.string "name"
23
+ end
24
+
25
+ create_table "posts", :force => true do |t|
26
+ t.integer "user_id"
27
+ t.string "title"
28
+ t.text "body"
29
+ t.datetime "created_at"
30
+ t.datetime "updated_at"
31
+ end
32
+
33
+ create_table "users", :force => true do |t|
34
+ t.string "username"
35
+ t.string "email"
36
+ t.string "location"
37
+ t.boolean "is_admin"
38
+ t.datetime "created_at"
39
+ t.datetime "updated_at"
40
+ end
41
+
42
+ end
@@ -1,15 +1,19 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
4
- gem 'rails', '4.0.0'
4
+ gem 'rails', '4.2.8'
5
5
 
6
6
  # Use sqlite3 as the database for Active Record
7
7
  gem 'sqlite3'
8
8
  gem 'rabl', :path => File.expand_path(File.dirname(__FILE__) + "/../../")
9
9
  gem 'riot', :group => "test"
10
+ gem 'pry-rails', :group => "test"
10
11
 
11
12
  gem "oj"
12
13
 
14
+ # respond_to is its own gem now
15
+ gem 'responders', '~> 2.0'
16
+
13
17
  # Use SCSS for stylesheets
14
18
  gem 'sass-rails', '~> 4.0.0'
15
19
 
@@ -33,4 +33,7 @@ Rails4::Application.configure do
33
33
 
34
34
  # Print deprecation notices to the stderr.
35
35
  config.active_support.deprecation = :stderr
36
+
37
+ # Run tests in sorted order (squash test error)
38
+ config.active_support.test_order = :sorted
36
39
  end
@@ -0,0 +1,42 @@
1
+ # encoding: UTF-8
2
+ # This file is auto-generated from the current state of the database. Instead
3
+ # of editing this file, please use the migrations feature of Active Record to
4
+ # incrementally modify your database, and then regenerate this schema definition.
5
+ #
6
+ # Note that this schema.rb definition is the authoritative source for your
7
+ # database schema. If you need to create the application database on another
8
+ # system, you should be using db:schema:load, not running all the migrations
9
+ # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
+ # you'll amass, the slower it'll run and the greater likelihood for issues).
11
+ #
12
+ # It's strongly recommended that you check this file into your version control system.
13
+
14
+ ActiveRecord::Schema.define(version: 20111002092024) do
15
+
16
+ create_table "phone_numbers", force: :cascade do |t|
17
+ t.integer "user_id"
18
+ t.boolean "is_primary"
19
+ t.string "area_code"
20
+ t.string "prefix"
21
+ t.string "suffix"
22
+ t.string "name"
23
+ end
24
+
25
+ create_table "posts", force: :cascade do |t|
26
+ t.integer "user_id"
27
+ t.string "title"
28
+ t.text "body"
29
+ t.datetime "created_at"
30
+ t.datetime "updated_at"
31
+ end
32
+
33
+ create_table "users", force: :cascade do |t|
34
+ t.string "username"
35
+ t.string "email"
36
+ t.string "location"
37
+ t.boolean "is_admin"
38
+ t.datetime "created_at"
39
+ t.datetime "updated_at"
40
+ end
41
+
42
+ end
@@ -33,6 +33,7 @@ gem 'jbuilder', '~> 2.5'
33
33
  group :development, :test do
34
34
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
35
35
  gem 'byebug', platform: :mri
36
+ gem 'pry-rails'
36
37
  end
37
38
 
38
39
  group :development do
@@ -7,7 +7,7 @@ require 'rake/testtask'
7
7
  Rails.application.load_tasks
8
8
 
9
9
  Rake::TestTask.new("test:rabl") do |test|
10
- test.pattern = "test/controllers/**/*_test.rb"
10
+ test.pattern = "test/functional/**/*_test.rb"
11
11
  test.verbose = true
12
12
  test.warning = false
13
13
  end
@@ -0,0 +1 @@
1
+ fixtures/rails5/app/controllers/../../../ashared/controllers_rails_5/posts_controller.rb
@@ -0,0 +1 @@
1
+ fixtures/rails5/app/controllers/../../../ashared/controllers_rails_5/users_controller.rb
@@ -0,0 +1 @@
1
+ fixtures/rails5/app/../../ashared/helpers
@@ -2,3 +2,5 @@
2
2
 
3
3
  # Add new mime types for use in respond_to blocks:
4
4
  # Mime::Type.register "text/richtext", :rtf
5
+
6
+ Mime::Type.register 'application/vnd.rabl-test_v1+json', :rabl_test_v1
@@ -0,0 +1 @@
1
+ fixtures/rails5/test/functional/../../../../test/integration/rails5/posts_controller_test.rb
@@ -0,0 +1 @@
1
+ fixtures/rails5/test/functional/../../../../test/integration/rails5/users_controller_test.rb
@@ -0,0 +1,21 @@
1
+ # See https://help.github.com/articles/ignoring-files for more about ignoring files.
2
+ #
3
+ # If you find yourself ignoring temporary files generated by your text editor
4
+ # or operating system, you probably want to add a global ignore instead:
5
+ # git config --global core.excludesfile '~/.gitignore_global'
6
+
7
+ # Ignore bundler config.
8
+ /.bundle
9
+
10
+ # Ignore the default SQLite database.
11
+ /db/*.sqlite3
12
+ /db/*.sqlite3-journal
13
+
14
+ # Ignore all logfiles and tempfiles.
15
+ /log/*
16
+ /tmp/*
17
+ !/log/.keep
18
+ !/tmp/.keep
19
+
20
+ # Ignore Byebug command history file.
21
+ .byebug_history
@@ -0,0 +1,46 @@
1
+ source 'https://rubygems.org'
2
+
3
+ git_source(:github) do |repo_name|
4
+ repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
5
+ "https://github.com/#{repo_name}.git"
6
+ end
7
+
8
+
9
+ # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
10
+ gem 'rails', '~> 5.0.2'
11
+ # Use sqlite3 as the database for Active Record
12
+ gem 'sqlite3'
13
+ # Use Puma as the app server
14
+ gem 'puma', '~> 3.0'
15
+ # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
16
+ # gem 'jbuilder', '~> 2.5'
17
+ # Use Redis adapter to run Action Cable in production
18
+ # gem 'redis', '~> 3.0'
19
+ # Use ActiveModel has_secure_password
20
+ # gem 'bcrypt', '~> 3.1.7'
21
+
22
+ # Use Capistrano for deployment
23
+ # gem 'capistrano-rails', group: :development
24
+
25
+ # Use Rack CORS for handling Cross-Origin Resource Sharing (CORS), making cross-origin AJAX possible
26
+ # gem 'rack-cors'
27
+
28
+ group :development, :test do
29
+ # Call 'byebug' anywhere in the code to stop execution and get a debugger console
30
+ gem 'byebug', platform: :mri
31
+ gem 'pry-rails'
32
+ end
33
+
34
+ group :development do
35
+ gem 'listen', '~> 3.0.5'
36
+ # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
37
+ gem 'spring'
38
+ gem 'spring-watcher-listen', '~> 2.0.0'
39
+ end
40
+
41
+ # Windows does not include zoneinfo files, so bundle the tzinfo-data gem
42
+ gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
43
+
44
+ gem 'rabl', :path => File.expand_path(File.dirname(__FILE__) + "/../../")
45
+ gem 'riot', :group => "test"
46
+ gem 'responders', '~> 2.0'