draper 2.1.0 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. checksums.yaml +4 -4
  2. data/.codeclimate.yml +16 -0
  3. data/.github/PULL_REQUEST_TEMPLATE.md +24 -0
  4. data/.gitignore +3 -1
  5. data/.rubocop.yml +11 -0
  6. data/.travis.yml +3 -7
  7. data/CHANGELOG.md +26 -0
  8. data/Gemfile +4 -5
  9. data/Guardfile +5 -5
  10. data/README.md +61 -11
  11. data/Rakefile +1 -1
  12. data/draper.gemspec +12 -10
  13. data/lib/draper.rb +8 -3
  14. data/lib/draper/automatic_delegation.rb +5 -3
  15. data/lib/draper/collection_decorator.rb +1 -11
  16. data/lib/draper/compatibility/api_only.rb +23 -0
  17. data/lib/draper/configuration.rb +15 -0
  18. data/lib/draper/decoratable.rb +3 -4
  19. data/lib/draper/decorator.rb +4 -24
  20. data/lib/draper/finders.rb +0 -0
  21. data/lib/draper/helper_proxy.rb +1 -8
  22. data/lib/draper/railtie.rb +12 -21
  23. data/lib/draper/tasks/test.rake +2 -15
  24. data/lib/draper/test/devise_helper.rb +1 -8
  25. data/lib/draper/test/minitest_integration.rb +0 -0
  26. data/lib/draper/test/rspec_integration.rb +1 -5
  27. data/lib/draper/test_case.rb +4 -8
  28. data/lib/draper/undecorate.rb +8 -0
  29. data/lib/draper/version.rb +1 -1
  30. data/lib/draper/view_context.rb +3 -19
  31. data/lib/draper/view_context/build_strategy.rb +11 -2
  32. data/lib/generators/controller_override.rb +2 -2
  33. data/lib/generators/draper/install_generator.rb +14 -0
  34. data/lib/generators/draper/templates/application_decorator.rb +8 -0
  35. data/lib/generators/mini_test/decorator_generator.rb +1 -1
  36. data/lib/generators/rails/decorator_generator.rb +1 -8
  37. data/lib/generators/rspec/templates/decorator_spec.rb +2 -2
  38. data/spec/draper/collection_decorator_spec.rb +11 -26
  39. data/spec/draper/configuration_spec.rb +25 -0
  40. data/spec/draper/decoratable_spec.rb +29 -16
  41. data/spec/draper/decorated_association_spec.rb +9 -9
  42. data/spec/draper/decorates_assigned_spec.rb +6 -6
  43. data/spec/draper/decorator_spec.rb +112 -89
  44. data/spec/draper/draper_spec.rb +24 -0
  45. data/spec/draper/factory_spec.rb +26 -26
  46. data/spec/draper/finders_spec.rb +21 -21
  47. data/spec/draper/helper_proxy_spec.rb +3 -3
  48. data/spec/draper/lazy_helpers_spec.rb +2 -2
  49. data/spec/draper/undecorate_chain_spec.rb +20 -0
  50. data/spec/draper/view_context/build_strategy_spec.rb +26 -10
  51. data/spec/draper/view_context_spec.rb +49 -21
  52. data/spec/dummy/app/controllers/base_controller.rb +4 -0
  53. data/spec/dummy/app/controllers/posts_controller.rb +2 -2
  54. data/spec/dummy/app/decorators/post_decorator.rb +0 -0
  55. data/spec/dummy/app/views/posts/_post.html.erb +8 -6
  56. data/spec/dummy/config/boot.rb +1 -1
  57. data/spec/dummy/config/initializers/draper.rb +3 -0
  58. data/spec/dummy/config/mongoid.yml +104 -41
  59. data/spec/dummy/db/schema.rb +4 -4
  60. data/spec/dummy/fast_spec/post_decorator_spec.rb +1 -1
  61. data/spec/dummy/lib/tasks/test.rake +1 -1
  62. data/spec/dummy/spec/decorators/active_model_serializers_spec.rb +4 -8
  63. data/spec/dummy/spec/decorators/devise_spec.rb +0 -9
  64. data/spec/dummy/spec/decorators/post_decorator_spec.rb +2 -4
  65. data/spec/dummy/spec/mailers/post_mailer_spec.rb +0 -8
  66. data/spec/dummy/spec/shared_examples/decoratable.rb +0 -2
  67. data/spec/dummy/test/decorators/minitest/devise_test.rb +0 -9
  68. data/spec/dummy/test/decorators/minitest/view_context_test.rb +3 -3
  69. data/spec/dummy/test/decorators/test_unit/devise_test.rb +0 -9
  70. data/spec/dummy/test/decorators/test_unit/view_context_test.rb +1 -1
  71. data/spec/generators/controller/controller_generator_spec.rb +3 -3
  72. data/spec/generators/decorator/decorator_generator_spec.rb +14 -12
  73. data/spec/generators/install/install_generator_spec.rb +19 -0
  74. data/spec/integration/integration_spec.rb +11 -8
  75. data/spec/performance/benchmark.rb +1 -1
  76. data/spec/spec_helper.rb +4 -4
  77. data/spec/support/matchers/have_text.rb +2 -2
  78. data/spec/support/shared_examples/view_helpers.rb +8 -8
  79. metadata +71 -29
  80. data/gemfiles/4.0.gemfile +0 -3
  81. data/gemfiles/4.1.gemfile +0 -3
  82. data/gemfiles/4.2.gemfile +0 -3
  83. data/spec/dummy/app/controllers/application_controller.rb +0 -4
data/gemfiles/4.0.gemfile DELETED
@@ -1,3 +0,0 @@
1
- gem "rails", "~> 4.0.0"
2
- gem "mongoid", "~> 4.0"
3
- gem "devise", "~> 3.0.0"
data/gemfiles/4.1.gemfile DELETED
@@ -1,3 +0,0 @@
1
- gem "rails", "~> 4.1.0"
2
- gem "mongoid", "~> 4.0"
3
- gem "devise", "~> 3.2"
data/gemfiles/4.2.gemfile DELETED
@@ -1,3 +0,0 @@
1
- gem "rails", "~> 4.2.0"
2
- gem "mongoid", "~> 4.0"
3
- gem "devise", "~> 3.4"
@@ -1,4 +0,0 @@
1
- class ApplicationController < ActionController::Base
2
- include LocalizedUrls
3
- protect_from_forgery
4
- end