draper 3.0.0.pre1 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. checksums.yaml +4 -4
  2. data/.codeclimate.yml +16 -0
  3. data/.github/PULL_REQUEST_TEMPLATE.md +24 -0
  4. data/.rubocop.yml +11 -0
  5. data/.travis.yml +3 -2
  6. data/CHANGELOG.md +20 -0
  7. data/Guardfile +5 -5
  8. data/README.md +27 -5
  9. data/Rakefile +1 -2
  10. data/draper.gemspec +1 -0
  11. data/lib/draper.rb +7 -2
  12. data/lib/draper/automatic_delegation.rb +5 -3
  13. data/lib/draper/collection_decorator.rb +1 -11
  14. data/lib/draper/compatibility/api_only.rb +23 -0
  15. data/lib/draper/configuration.rb +15 -0
  16. data/lib/draper/decoratable.rb +2 -2
  17. data/lib/draper/decorator.rb +4 -12
  18. data/lib/draper/finders.rb +0 -0
  19. data/lib/draper/helper_proxy.rb +1 -8
  20. data/lib/draper/railtie.rb +12 -13
  21. data/lib/draper/tasks/test.rake +1 -1
  22. data/lib/draper/test/devise_helper.rb +1 -8
  23. data/lib/draper/test/minitest_integration.rb +0 -0
  24. data/lib/draper/test/rspec_integration.rb +0 -0
  25. data/lib/draper/undecorate.rb +8 -0
  26. data/lib/draper/version.rb +1 -1
  27. data/lib/draper/view_context.rb +3 -19
  28. data/lib/draper/view_context/build_strategy.rb +11 -2
  29. data/lib/generators/controller_override.rb +2 -2
  30. data/lib/generators/draper/install_generator.rb +14 -0
  31. data/lib/generators/draper/templates/application_decorator.rb +8 -0
  32. data/lib/generators/mini_test/decorator_generator.rb +1 -1
  33. data/lib/generators/rails/decorator_generator.rb +1 -8
  34. data/lib/generators/rspec/templates/decorator_spec.rb +1 -1
  35. data/spec/draper/collection_decorator_spec.rb +11 -26
  36. data/spec/draper/configuration_spec.rb +25 -0
  37. data/spec/draper/decoratable_spec.rb +28 -13
  38. data/spec/draper/decorated_association_spec.rb +9 -9
  39. data/spec/draper/decorates_assigned_spec.rb +6 -6
  40. data/spec/draper/decorator_spec.rb +104 -89
  41. data/spec/draper/draper_spec.rb +24 -0
  42. data/spec/draper/factory_spec.rb +24 -24
  43. data/spec/draper/finders_spec.rb +21 -21
  44. data/spec/draper/helper_proxy_spec.rb +2 -2
  45. data/spec/draper/lazy_helpers_spec.rb +2 -2
  46. data/spec/draper/undecorate_chain_spec.rb +20 -0
  47. data/spec/draper/view_context/build_strategy_spec.rb +26 -10
  48. data/spec/draper/view_context_spec.rb +49 -21
  49. data/spec/dummy/app/controllers/base_controller.rb +4 -0
  50. data/spec/dummy/app/controllers/posts_controller.rb +2 -2
  51. data/spec/dummy/app/decorators/post_decorator.rb +0 -0
  52. data/spec/dummy/config/boot.rb +1 -1
  53. data/spec/dummy/config/initializers/draper.rb +3 -0
  54. data/spec/dummy/db/schema.rb +4 -4
  55. data/spec/dummy/fast_spec/post_decorator_spec.rb +1 -1
  56. data/spec/dummy/lib/tasks/test.rake +1 -1
  57. data/spec/dummy/spec/decorators/devise_spec.rb +0 -9
  58. data/spec/dummy/spec/decorators/post_decorator_spec.rb +2 -2
  59. data/spec/dummy/test/decorators/minitest/devise_test.rb +0 -9
  60. data/spec/dummy/test/decorators/minitest/view_context_test.rb +3 -3
  61. data/spec/dummy/test/decorators/test_unit/devise_test.rb +0 -9
  62. data/spec/generators/controller/controller_generator_spec.rb +3 -3
  63. data/spec/generators/decorator/decorator_generator_spec.rb +11 -10
  64. data/spec/generators/install/install_generator_spec.rb +19 -0
  65. data/spec/spec_helper.rb +4 -3
  66. data/spec/support/shared_examples/view_helpers.rb +8 -8
  67. metadata +38 -7
  68. data/spec/dummy/app/controllers/application_controller.rb +0 -4
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: draper
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0.pre1
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Casimir
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-07-10 00:00:00.000000000 Z
12
+ date: 2017-05-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -165,6 +165,20 @@ dependencies:
165
165
  - - "~>"
166
166
  - !ruby/object:Gem::Version
167
167
  version: '0.10'
168
+ - !ruby/object:Gem::Dependency
169
+ name: rubocop
170
+ requirement: !ruby/object:Gem::Requirement
171
+ requirements:
172
+ - - ">="
173
+ - !ruby/object:Gem::Version
174
+ version: '0'
175
+ type: :development
176
+ prerelease: false
177
+ version_requirements: !ruby/object:Gem::Requirement
178
+ requirements:
179
+ - - ">="
180
+ - !ruby/object:Gem::Version
181
+ version: '0'
168
182
  description: Draper adds an object-oriented layer of presentation logic to your Rails
169
183
  apps.
170
184
  email:
@@ -174,8 +188,11 @@ executables: []
174
188
  extensions: []
175
189
  extra_rdoc_files: []
176
190
  files:
191
+ - ".codeclimate.yml"
192
+ - ".github/PULL_REQUEST_TEMPLATE.md"
177
193
  - ".gitignore"
178
194
  - ".rspec"
195
+ - ".rubocop.yml"
179
196
  - ".travis.yml"
180
197
  - ".yardopts"
181
198
  - CHANGELOG.md
@@ -189,6 +206,8 @@ files:
189
206
  - lib/draper.rb
190
207
  - lib/draper/automatic_delegation.rb
191
208
  - lib/draper/collection_decorator.rb
209
+ - lib/draper/compatibility/api_only.rb
210
+ - lib/draper/configuration.rb
192
211
  - lib/draper/decoratable.rb
193
212
  - lib/draper/decoratable/equality.rb
194
213
  - lib/draper/decorated_association.rb
@@ -212,6 +231,8 @@ files:
212
231
  - lib/draper/view_context/build_strategy.rb
213
232
  - lib/draper/view_helpers.rb
214
233
  - lib/generators/controller_override.rb
234
+ - lib/generators/draper/install_generator.rb
235
+ - lib/generators/draper/templates/application_decorator.rb
215
236
  - lib/generators/mini_test/decorator_generator.rb
216
237
  - lib/generators/mini_test/templates/decorator_spec.rb
217
238
  - lib/generators/mini_test/templates/decorator_test.rb
@@ -222,22 +243,25 @@ files:
222
243
  - lib/generators/test_unit/decorator_generator.rb
223
244
  - lib/generators/test_unit/templates/decorator_test.rb
224
245
  - spec/draper/collection_decorator_spec.rb
246
+ - spec/draper/configuration_spec.rb
225
247
  - spec/draper/decoratable/equality_spec.rb
226
248
  - spec/draper/decoratable_spec.rb
227
249
  - spec/draper/decorated_association_spec.rb
228
250
  - spec/draper/decorates_assigned_spec.rb
229
251
  - spec/draper/decorator_spec.rb
252
+ - spec/draper/draper_spec.rb
230
253
  - spec/draper/factory_spec.rb
231
254
  - spec/draper/finders_spec.rb
232
255
  - spec/draper/helper_proxy_spec.rb
233
256
  - spec/draper/lazy_helpers_spec.rb
257
+ - spec/draper/undecorate_chain_spec.rb
234
258
  - spec/draper/undecorate_spec.rb
235
259
  - spec/draper/view_context/build_strategy_spec.rb
236
260
  - spec/draper/view_context_spec.rb
237
261
  - spec/draper/view_helpers_spec.rb
238
262
  - spec/dummy/.rspec
239
263
  - spec/dummy/Rakefile
240
- - spec/dummy/app/controllers/application_controller.rb
264
+ - spec/dummy/app/controllers/base_controller.rb
241
265
  - spec/dummy/app/controllers/localized_urls.rb
242
266
  - spec/dummy/app/controllers/posts_controller.rb
243
267
  - spec/dummy/app/decorators/mongoid_post_decorator.rb
@@ -263,6 +287,7 @@ files:
263
287
  - spec/dummy/config/environments/production.rb
264
288
  - spec/dummy/config/environments/test.rb
265
289
  - spec/dummy/config/initializers/backtrace_silencers.rb
290
+ - spec/dummy/config/initializers/draper.rb
266
291
  - spec/dummy/config/initializers/inflections.rb
267
292
  - spec/dummy/config/initializers/mime_types.rb
268
293
  - spec/dummy/config/initializers/secret_token.rb
@@ -303,6 +328,7 @@ files:
303
328
  - spec/dummy/test/test_helper.rb
304
329
  - spec/generators/controller/controller_generator_spec.rb
305
330
  - spec/generators/decorator/decorator_generator_spec.rb
331
+ - spec/generators/install/install_generator_spec.rb
306
332
  - spec/integration/integration_spec.rb
307
333
  - spec/performance/active_record.rb
308
334
  - spec/performance/benchmark.rb
@@ -328,33 +354,36 @@ required_ruby_version: !ruby/object:Gem::Requirement
328
354
  version: 2.2.2
329
355
  required_rubygems_version: !ruby/object:Gem::Requirement
330
356
  requirements:
331
- - - ">"
357
+ - - ">="
332
358
  - !ruby/object:Gem::Version
333
- version: 1.3.1
359
+ version: '0'
334
360
  requirements: []
335
361
  rubyforge_project:
336
- rubygems_version: 2.5.1
362
+ rubygems_version: 2.6.11
337
363
  signing_key:
338
364
  specification_version: 4
339
365
  summary: View Models for Rails
340
366
  test_files:
341
367
  - spec/draper/collection_decorator_spec.rb
368
+ - spec/draper/configuration_spec.rb
342
369
  - spec/draper/decoratable/equality_spec.rb
343
370
  - spec/draper/decoratable_spec.rb
344
371
  - spec/draper/decorated_association_spec.rb
345
372
  - spec/draper/decorates_assigned_spec.rb
346
373
  - spec/draper/decorator_spec.rb
374
+ - spec/draper/draper_spec.rb
347
375
  - spec/draper/factory_spec.rb
348
376
  - spec/draper/finders_spec.rb
349
377
  - spec/draper/helper_proxy_spec.rb
350
378
  - spec/draper/lazy_helpers_spec.rb
379
+ - spec/draper/undecorate_chain_spec.rb
351
380
  - spec/draper/undecorate_spec.rb
352
381
  - spec/draper/view_context/build_strategy_spec.rb
353
382
  - spec/draper/view_context_spec.rb
354
383
  - spec/draper/view_helpers_spec.rb
355
384
  - spec/dummy/.rspec
356
385
  - spec/dummy/Rakefile
357
- - spec/dummy/app/controllers/application_controller.rb
386
+ - spec/dummy/app/controllers/base_controller.rb
358
387
  - spec/dummy/app/controllers/localized_urls.rb
359
388
  - spec/dummy/app/controllers/posts_controller.rb
360
389
  - spec/dummy/app/decorators/mongoid_post_decorator.rb
@@ -380,6 +409,7 @@ test_files:
380
409
  - spec/dummy/config/environments/production.rb
381
410
  - spec/dummy/config/environments/test.rb
382
411
  - spec/dummy/config/initializers/backtrace_silencers.rb
412
+ - spec/dummy/config/initializers/draper.rb
383
413
  - spec/dummy/config/initializers/inflections.rb
384
414
  - spec/dummy/config/initializers/mime_types.rb
385
415
  - spec/dummy/config/initializers/secret_token.rb
@@ -420,6 +450,7 @@ test_files:
420
450
  - spec/dummy/test/test_helper.rb
421
451
  - spec/generators/controller/controller_generator_spec.rb
422
452
  - spec/generators/decorator/decorator_generator_spec.rb
453
+ - spec/generators/install/install_generator_spec.rb
423
454
  - spec/integration/integration_spec.rb
424
455
  - spec/performance/active_record.rb
425
456
  - spec/performance/benchmark.rb
@@ -1,4 +0,0 @@
1
- class ApplicationController < ActionController::Base
2
- include LocalizedUrls
3
- protect_from_forgery
4
- end