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
@@ -1,17 +0,0 @@
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
@@ -1,11 +0,0 @@
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