uploadcare-rails 1.2.0.pre.alpha → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (187) hide show
  1. checksums.yaml +5 -5
  2. data/Rakefile +5 -16
  3. data/lib/generators/templates/uploadcare_config_template.erb +138 -0
  4. data/lib/generators/uploadcare_config_generator.rb +7 -4
  5. data/lib/uploadcare/errors/type_error.rb +7 -0
  6. data/lib/uploadcare/rails/action_view/uploadcare_include_tags.rb +48 -0
  7. data/lib/uploadcare/rails/action_view/uploadcare_uploader_tags.rb +57 -0
  8. data/lib/uploadcare/rails/active_record/mount_uploadcare_file.rb +62 -0
  9. data/lib/uploadcare/rails/active_record/mount_uploadcare_file_group.rb +58 -0
  10. data/lib/uploadcare/rails/api/rest/base.rb +14 -0
  11. data/lib/uploadcare/rails/api/rest/conversion_api.rb +42 -0
  12. data/lib/uploadcare/rails/api/rest/file_api.rb +69 -0
  13. data/lib/uploadcare/rails/api/rest/group_api.rb +48 -0
  14. data/lib/uploadcare/rails/api/rest/project_api.rb +27 -0
  15. data/lib/uploadcare/rails/api/rest/webhook_api.rb +45 -0
  16. data/lib/uploadcare/rails/api/upload/base.rb +13 -0
  17. data/lib/uploadcare/rails/api/upload/upload_api.rb +53 -0
  18. data/lib/uploadcare/rails/configuration.rb +57 -0
  19. data/lib/uploadcare/rails/engine.rb +13 -17
  20. data/lib/uploadcare/rails/jobs/delete_file_job.rb +14 -0
  21. data/lib/uploadcare/rails/jobs/store_file_job.rb +14 -0
  22. data/lib/uploadcare/rails/jobs/store_group_job.rb +14 -0
  23. data/lib/uploadcare/rails/objects/concerns/loadable.rb +46 -0
  24. data/lib/uploadcare/rails/objects/file.rb +40 -20
  25. data/lib/uploadcare/rails/objects/group.rb +51 -57
  26. data/lib/uploadcare/rails/services/files_count_extractor.rb +14 -0
  27. data/lib/uploadcare/rails/services/id_extractor.rb +15 -0
  28. data/lib/uploadcare/rails/transformations/image_transformations.rb +45 -0
  29. data/lib/uploadcare/rails/version.rb +3 -1
  30. data/lib/uploadcare/rails.rb +10 -0
  31. data/lib/uploadcare-rails.rb +27 -9
  32. data/spec/fixtures/kitten.jpeg +0 -0
  33. data/spec/fixtures/vcr_cassettes/conversion_api_convert_document.yml +62 -0
  34. data/spec/fixtures/vcr_cassettes/conversion_api_convert_document_with_error.yml +62 -0
  35. data/spec/fixtures/vcr_cassettes/conversion_api_convert_video.yml +62 -0
  36. data/spec/fixtures/vcr_cassettes/conversion_api_convert_video_with_error.yml +62 -0
  37. data/spec/fixtures/vcr_cassettes/conversion_api_get_document_conversion_status.yml +59 -0
  38. data/spec/fixtures/vcr_cassettes/conversion_api_get_video_conversion_status.yml +59 -0
  39. data/spec/fixtures/vcr_cassettes/file_api_copy_file.yml +60 -0
  40. data/spec/fixtures/vcr_cassettes/file_api_delete_file.yml +58 -0
  41. data/spec/fixtures/vcr_cassettes/file_api_delete_files.yml +58 -0
  42. data/spec/fixtures/vcr_cassettes/file_api_get_file.yml +58 -0
  43. data/spec/fixtures/vcr_cassettes/file_api_get_files.yml +61 -0
  44. data/spec/fixtures/vcr_cassettes/file_api_load_file.yml +57 -0
  45. data/spec/fixtures/vcr_cassettes/file_api_store_file.yml +58 -0
  46. data/spec/fixtures/vcr_cassettes/file_api_store_files.yml +57 -0
  47. data/spec/fixtures/vcr_cassettes/group_api_create_group.yml +57 -0
  48. data/spec/fixtures/vcr_cassettes/group_api_get_group.yml +52 -0
  49. data/spec/fixtures/vcr_cassettes/group_api_get_groups.yml +57 -0
  50. data/spec/fixtures/vcr_cassettes/group_api_store_group.yml +57 -0
  51. data/spec/fixtures/vcr_cassettes/project_api_get_project.yml +59 -0
  52. data/spec/fixtures/vcr_cassettes/upload_upload_many_files.yml +55 -0
  53. data/spec/fixtures/vcr_cassettes/upload_upload_one_file.yml +105 -0
  54. data/spec/fixtures/vcr_cassettes/upload_upload_one_file_from_cdn.yml +111 -0
  55. data/spec/fixtures/vcr_cassettes/webhook_api_create_webhook.yml +59 -0
  56. data/spec/fixtures/vcr_cassettes/webhook_api_delete_webhook.yml +57 -0
  57. data/spec/fixtures/vcr_cassettes/webhook_api_get_webhooks.yml +59 -0
  58. data/spec/fixtures/vcr_cassettes/webhook_api_update_webhook.yml +59 -0
  59. data/spec/generators/uploadcare_config_generator_spec.rb +18 -26
  60. data/spec/spec_helper.rb +17 -62
  61. data/spec/support/generators.rb +8 -5
  62. data/spec/support/vcr.rb +14 -0
  63. data/spec/tmp/config/initializers/uploadcare.rb +138 -0
  64. data/spec/uploadcare/rails/action_view/uploadcare_uploader_tags_spec.rb +40 -0
  65. data/spec/uploadcare/rails/action_view/uploadcare_widget_tags_spec.rb +46 -0
  66. data/spec/uploadcare/rails/active_record/mount_uploadcare_file_spec.rb +33 -0
  67. data/spec/uploadcare/rails/active_record/mount_uploadcare_group_spec.rb +32 -0
  68. data/spec/uploadcare/rails/api/rest/conversion_api_spec.rb +110 -0
  69. data/spec/uploadcare/rails/api/rest/file_api_spec.rb +85 -0
  70. data/spec/uploadcare/rails/api/rest/group_api_spec.rb +61 -0
  71. data/spec/uploadcare/rails/api/rest/project_api_spec.rb +33 -0
  72. data/spec/uploadcare/rails/api/rest/webhook_api_spec.rb +59 -0
  73. data/spec/uploadcare/rails/api/upload/upload_api_spec.rb +82 -0
  74. data/spec/uploadcare/rails/jobs/delete_file_job_spec.rb +15 -0
  75. data/spec/uploadcare/rails/jobs/store_file_job_spec.rb +15 -0
  76. data/spec/uploadcare/rails/jobs/store_group_job_spec.rb +15 -0
  77. data/spec/uploadcare/rails/objects/file_spec.rb +77 -0
  78. data/spec/uploadcare/rails/objects/group_spec.rb +87 -0
  79. data/spec/uploadcare/rails/services/id_extractor_spec.rb +26 -0
  80. data/spec/uploadcare/rails/transformations/image_transformations_spec.rb +120 -0
  81. data/spec/uploadcare/rails_spec.rb +7 -0
  82. metadata +131 -346
  83. data/config/initializers/uploadcare.rb +0 -26
  84. data/config/uploadcare_defaults.yml +0 -12
  85. data/lib/generators/templates/uploadcare_config_template.yml +0 -71
  86. data/lib/tasks/uploadcare_rails_tasks.rake +0 -4
  87. data/lib/uploadcare/rails/action_view/include_tags.rb +0 -47
  88. data/lib/uploadcare/rails/action_view/uploader_tags.rb +0 -76
  89. data/lib/uploadcare/rails/active_record/has_file.rb +0 -89
  90. data/lib/uploadcare/rails/active_record/has_group.rb +0 -84
  91. data/lib/uploadcare/rails/active_record/has_object.rb +0 -9
  92. data/lib/uploadcare/rails/formtastic/formtastic.rb +0 -73
  93. data/lib/uploadcare/rails/operations.rb +0 -57
  94. data/lib/uploadcare/rails/settings.rb +0 -81
  95. data/lib/uploadcare/rails/simple_form/simple_form.rb +0 -63
  96. data/spec/caching/file_caching_spec.rb +0 -26
  97. data/spec/caching/group_caching_spec.rb +0 -40
  98. data/spec/dummy/README.rdoc +0 -28
  99. data/spec/dummy/Rakefile +0 -6
  100. data/spec/dummy/app/assets/javascripts/application.js +0 -13
  101. data/spec/dummy/app/assets/javascripts/post_with_collections.js +0 -2
  102. data/spec/dummy/app/assets/javascripts/posts.js +0 -2
  103. data/spec/dummy/app/assets/javascripts/posts_with_collection_and_files.js +0 -2
  104. data/spec/dummy/app/assets/javascripts/uploadcare-1.5.5.min.js +0 -16
  105. data/spec/dummy/app/assets/stylesheets/application.css +0 -13
  106. data/spec/dummy/app/assets/stylesheets/post_with_collections.css +0 -4
  107. data/spec/dummy/app/assets/stylesheets/posts.css +0 -4
  108. data/spec/dummy/app/assets/stylesheets/posts_with_collection_and_files.css +0 -4
  109. data/spec/dummy/app/assets/stylesheets/scaffold.css +0 -56
  110. data/spec/dummy/app/controllers/application_controller.rb +0 -5
  111. data/spec/dummy/app/controllers/post_with_collections_controller.rb +0 -58
  112. data/spec/dummy/app/controllers/posts_controller.rb +0 -58
  113. data/spec/dummy/app/controllers/posts_with_collection_and_files_controller.rb +0 -58
  114. data/spec/dummy/app/helpers/application_helper.rb +0 -2
  115. data/spec/dummy/app/helpers/post_with_collections_helper.rb +0 -2
  116. data/spec/dummy/app/helpers/posts_helper.rb +0 -2
  117. data/spec/dummy/app/helpers/posts_with_collection_and_files_helper.rb +0 -2
  118. data/spec/dummy/app/models/post.rb +0 -3
  119. data/spec/dummy/app/models/post_with_collection.rb +0 -3
  120. data/spec/dummy/app/models/posts_with_collection_and_file.rb +0 -4
  121. data/spec/dummy/app/views/layouts/application.html.erb +0 -16
  122. data/spec/dummy/app/views/post_with_collections/_form.html.erb +0 -25
  123. data/spec/dummy/app/views/post_with_collections/edit.html.erb +0 -6
  124. data/spec/dummy/app/views/post_with_collections/index.html.erb +0 -29
  125. data/spec/dummy/app/views/post_with_collections/new.html.erb +0 -5
  126. data/spec/dummy/app/views/post_with_collections/show.html.erb +0 -14
  127. data/spec/dummy/app/views/post_with_collections/show.json.jbuilder +0 -1
  128. data/spec/dummy/app/views/posts/_form.html.erb +0 -31
  129. data/spec/dummy/app/views/posts/edit.html.erb +0 -6
  130. data/spec/dummy/app/views/posts/index.html.erb +0 -37
  131. data/spec/dummy/app/views/posts/new.html.erb +0 -5
  132. data/spec/dummy/app/views/posts/post.json.builder +0 -1
  133. data/spec/dummy/app/views/posts/show.html.erb +0 -15
  134. data/spec/dummy/app/views/posts_with_collection_and_files/_form.html.erb +0 -27
  135. data/spec/dummy/app/views/posts_with_collection_and_files/edit.html.erb +0 -6
  136. data/spec/dummy/app/views/posts_with_collection_and_files/index.html.erb +0 -25
  137. data/spec/dummy/app/views/posts_with_collection_and_files/new.html.erb +0 -5
  138. data/spec/dummy/app/views/posts_with_collection_and_files/show.html.erb +0 -4
  139. data/spec/dummy/app/views/posts_with_collection_and_files/show.json.jbuilder +0 -1
  140. data/spec/dummy/bin/bundle +0 -3
  141. data/spec/dummy/bin/rails +0 -4
  142. data/spec/dummy/bin/rake +0 -4
  143. data/spec/dummy/config/application.rb +0 -23
  144. data/spec/dummy/config/boot.rb +0 -5
  145. data/spec/dummy/config/database.yml +0 -25
  146. data/spec/dummy/config/environment.rb +0 -5
  147. data/spec/dummy/config/environments/development.rb +0 -29
  148. data/spec/dummy/config/environments/production.rb +0 -80
  149. data/spec/dummy/config/environments/test.rb +0 -36
  150. data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -7
  151. data/spec/dummy/config/initializers/filter_parameter_logging.rb +0 -4
  152. data/spec/dummy/config/initializers/formtastic.rb +0 -111
  153. data/spec/dummy/config/initializers/inflections.rb +0 -16
  154. data/spec/dummy/config/initializers/mime_types.rb +0 -5
  155. data/spec/dummy/config/initializers/secret_token.rb +0 -12
  156. data/spec/dummy/config/initializers/session_store.rb +0 -3
  157. data/spec/dummy/config/initializers/simple_form.rb +0 -167
  158. data/spec/dummy/config/initializers/wrap_parameters.rb +0 -14
  159. data/spec/dummy/config/locales/en.yml +0 -23
  160. data/spec/dummy/config/locales/simple_form.en.yml +0 -31
  161. data/spec/dummy/config/routes.rb +0 -63
  162. data/spec/dummy/config/uploadcare.yml +0 -68
  163. data/spec/dummy/config.ru +0 -4
  164. data/spec/dummy/db/migrate/20171012001801_create_tables.rb +0 -27
  165. data/spec/dummy/db/schema.rb +0 -37
  166. data/spec/dummy/lib/templates/erb/scaffold/_form.html.erb +0 -13
  167. data/spec/dummy/public/404.html +0 -58
  168. data/spec/dummy/public/422.html +0 -58
  169. data/spec/dummy/public/500.html +0 -57
  170. data/spec/dummy/public/favicon.ico +0 -0
  171. data/spec/helpers/form_helpers_has_file_spec.rb +0 -30
  172. data/spec/helpers/form_helpers_has_group_spec.rb +0 -30
  173. data/spec/helpers/form_helpers_spec.rb +0 -33
  174. data/spec/helpers/formtastic_spec.rb +0 -25
  175. data/spec/helpers/include_tags_spec.rb +0 -54
  176. data/spec/helpers/simple_form_spec.rb +0 -25
  177. data/spec/helpers/uploader_tags_spec.rb +0 -21
  178. data/spec/models/has_both_file_and_group_spec.rb +0 -43
  179. data/spec/models/has_file_spec.rb +0 -46
  180. data/spec/models/has_group_spec.rb +0 -57
  181. data/spec/objects/file_spec.rb +0 -27
  182. data/spec/objects/group_spec.rb +0 -51
  183. data/spec/operations_spec.rb +0 -28
  184. data/spec/uploadcare/rails/settings_spec.rb +0 -136
  185. data/spec/uploadcare_rails_settings_spec.rb +0 -50
  186. data/spec/view.png +0 -0
  187. data/spec/view2.jpg +0 -0
@@ -1,13 +0,0 @@
1
- // This is a manifest file that'll be compiled into application.js, which will include all the files
2
- // listed below.
3
- //
4
- // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
- // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6
- //
7
- // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
- // compiled file.
9
- //
10
- // Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
11
- // about supported directives.
12
- //
13
- //= require_tree .
@@ -1,2 +0,0 @@
1
- // Place all the behaviors and hooks related to the matching controller here.
2
- // All this logic will automatically be available in application.js.
@@ -1,2 +0,0 @@
1
- // Place all the behaviors and hooks related to the matching controller here.
2
- // All this logic will automatically be available in application.js.
@@ -1,2 +0,0 @@
1
- // Place all the behaviors and hooks related to the matching controller here.
2
- // All this logic will automatically be available in application.js.