carrierwave_backgrounder 0.4.3 → 1.0.0.beta.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -1
  3. data/.travis.yml +8 -4
  4. data/CHANGELOG.md +14 -0
  5. data/Gemfile +1 -1
  6. data/README.md +59 -67
  7. data/carrierwave_backgrounder.gemspec +7 -2
  8. data/lib/backgrounder/orm/activemodel.rb +7 -7
  9. data/lib/backgrounder/orm/base.rb +18 -12
  10. data/lib/backgrounder/support/backends.rb +1 -45
  11. data/lib/backgrounder/version.rb +1 -1
  12. data/lib/backgrounder/workers/active_job/process_asset.rb +14 -0
  13. data/lib/backgrounder/workers/active_job/store_asset.rb +14 -0
  14. data/lib/backgrounder/workers/process_asset.rb +2 -0
  15. data/lib/backgrounder/workers/process_asset_mixin.rb +16 -7
  16. data/lib/backgrounder/workers/store_asset.rb +2 -0
  17. data/lib/backgrounder/workers/store_asset_mixin.rb +14 -19
  18. data/lib/backgrounder/workers.rb +0 -2
  19. data/lib/carrierwave_backgrounder.rb +24 -10
  20. data/lib/generators/carrierwave_backgrounder/install_generator.rb +1 -1
  21. data/lib/generators/carrierwave_backgrounder/templates/config/initializers/carrierwave_backgrounder.rb +1 -7
  22. data/spec/backgrounder/orm/activemodel_spec.rb +2 -5
  23. data/spec/backgrounder/support/backends_spec.rb +0 -159
  24. data/spec/backgrounder/workers/process_asset_spec.rb +8 -6
  25. data/spec/backgrounder/workers/store_asset_spec.rb +20 -99
  26. data/spec/integrations/process_in_background_multi_upload_spec.rb +81 -0
  27. data/spec/integrations/process_in_background_spec.rb +75 -0
  28. data/spec/integrations/store_in_background_multi_upload_spec.rb +87 -0
  29. data/spec/integrations/store_in_background_spec.rb +86 -0
  30. data/spec/rails_helper.rb +27 -0
  31. data/spec/spec_helper.rb +2 -0
  32. data/spec/support/dummy_app/Gemfile +49 -0
  33. data/spec/support/dummy_app/README.md +24 -0
  34. data/spec/support/dummy_app/Rakefile +6 -0
  35. data/spec/support/dummy_app/app/controllers/application_controller.rb +2 -0
  36. data/spec/support/dummy_app/app/controllers/concerns/.keep +0 -0
  37. data/spec/support/dummy_app/app/jobs/application_job.rb +7 -0
  38. data/spec/support/dummy_app/app/models/admin.rb +10 -0
  39. data/spec/support/dummy_app/app/models/application_record.rb +3 -0
  40. data/spec/support/dummy_app/app/models/concerns/.keep +0 -0
  41. data/spec/support/dummy_app/app/models/user.rb +10 -0
  42. data/spec/support/dummy_app/app/uploaders/avatar_uploader.rb +67 -0
  43. data/spec/support/dummy_app/bin/bundle +114 -0
  44. data/spec/support/dummy_app/bin/rails +4 -0
  45. data/spec/support/dummy_app/bin/rake +4 -0
  46. data/spec/support/dummy_app/bin/setup +33 -0
  47. data/spec/support/dummy_app/config/application.rb +39 -0
  48. data/spec/support/dummy_app/config/boot.rb +3 -0
  49. data/spec/support/dummy_app/config/database.yml +25 -0
  50. data/spec/support/dummy_app/config/environment.rb +8 -0
  51. data/spec/support/dummy_app/config/environments/development.rb +65 -0
  52. data/spec/support/dummy_app/config/environments/production.rb +86 -0
  53. data/spec/support/dummy_app/config/environments/test.rb +63 -0
  54. data/spec/support/dummy_app/config/initializers/carrierwave_backgrounder.rb +5 -0
  55. data/spec/support/dummy_app/config/initializers/cors.rb +16 -0
  56. data/spec/support/dummy_app/config/initializers/filter_parameter_logging.rb +8 -0
  57. data/spec/support/dummy_app/config/initializers/inflections.rb +16 -0
  58. data/spec/support/dummy_app/config/locales/en.yml +33 -0
  59. data/spec/support/dummy_app/config/routes.rb +6 -0
  60. data/spec/support/dummy_app/config/storage.yml +34 -0
  61. data/spec/support/dummy_app/config.ru +6 -0
  62. data/spec/support/dummy_app/db/migrate/20230804214459_create_users.rb +9 -0
  63. data/spec/support/dummy_app/db/migrate/20230807165013_add_avatar_tmp_column_to_user.rb +5 -0
  64. data/spec/support/dummy_app/db/migrate/20230808233036_add_avatar_processing_flag_to_users.rb +5 -0
  65. data/spec/support/dummy_app/db/migrate/20230809215320_create_admins.rb +10 -0
  66. data/spec/support/dummy_app/db/migrate/20230810182011_add_images_to_users.rb +7 -0
  67. data/spec/support/dummy_app/db/migrate/20230811155811_add_images_to_admins.rb +6 -0
  68. data/spec/support/dummy_app/db/schema.rb +34 -0
  69. data/spec/support/dummy_app/db/seeds.rb +7 -0
  70. data/spec/support/dummy_app/lib/tasks/.keep +0 -0
  71. data/spec/support/dummy_app/log/.keep +0 -0
  72. data/spec/support/dummy_app/public/robots.txt +1 -0
  73. data/spec/support/dummy_app/storage/.keep +0 -0
  74. data/spec/support/dummy_app/tmp/.keep +0 -0
  75. data/spec/support/dummy_app/tmp/development_secret.txt +1 -0
  76. data/spec/support/dummy_app/tmp/images/.gitkeep +0 -0
  77. data/spec/support/dummy_app/tmp/pids/.keep +0 -0
  78. data/spec/support/dummy_app/tmp/storage/.keep +0 -0
  79. data/spec/support/dummy_app/vendor/.keep +0 -0
  80. data/spec/support/fixtures/images/test-1.jpg +0 -0
  81. data/spec/support/fixtures/images/test-2.jpg +0 -0
  82. data/spec/support/global_macros.rb +29 -0
  83. data/spec/support/mock_worker.rb +2 -0
  84. metadata +203 -15
  85. data/spec/support/backend_constants.rb +0 -58
metadata CHANGED
@@ -1,49 +1,69 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: carrierwave_backgrounder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 1.0.0.beta.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Larry Sprock
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-07-31 00:00:00.000000000 Z
11
+ date: 2023-08-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: carrierwave
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - ">"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.5'
19
+ version: '2.0'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '2.2'
22
+ version: '4.0'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
- - - ">="
27
+ - - ">"
28
+ - !ruby/object:Gem::Version
29
+ version: '2.0'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '4.0'
33
+ - !ruby/object:Gem::Dependency
34
+ name: rails
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">"
38
+ - !ruby/object:Gem::Version
39
+ version: '6.0'
40
+ - - "<"
28
41
  - !ruby/object:Gem::Version
29
- version: '0.5'
42
+ version: '8.0'
43
+ type: :runtime
44
+ prerelease: false
45
+ version_requirements: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - ">"
48
+ - !ruby/object:Gem::Version
49
+ version: '6.0'
30
50
  - - "<"
31
51
  - !ruby/object:Gem::Version
32
- version: '2.2'
52
+ version: '8.0'
33
53
  - !ruby/object:Gem::Dependency
34
54
  name: rspec
35
55
  requirement: !ruby/object:Gem::Requirement
36
56
  requirements:
37
57
  - - "~>"
38
58
  - !ruby/object:Gem::Version
39
- version: 3.10.0
59
+ version: '3.12'
40
60
  type: :development
41
61
  prerelease: false
42
62
  version_requirements: !ruby/object:Gem::Requirement
43
63
  requirements:
44
64
  - - "~>"
45
65
  - !ruby/object:Gem::Version
46
- version: 3.10.0
66
+ version: '3.12'
47
67
  - !ruby/object:Gem::Dependency
48
68
  name: rake
49
69
  requirement: !ruby/object:Gem::Requirement
@@ -58,6 +78,62 @@ dependencies:
58
78
  - - ">="
59
79
  - !ruby/object:Gem::Version
60
80
  version: '0'
81
+ - !ruby/object:Gem::Dependency
82
+ name: rspec-rails
83
+ requirement: !ruby/object:Gem::Requirement
84
+ requirements:
85
+ - - ">="
86
+ - !ruby/object:Gem::Version
87
+ version: '0'
88
+ type: :development
89
+ prerelease: false
90
+ version_requirements: !ruby/object:Gem::Requirement
91
+ requirements:
92
+ - - ">="
93
+ - !ruby/object:Gem::Version
94
+ version: '0'
95
+ - !ruby/object:Gem::Dependency
96
+ name: sqlite3
97
+ requirement: !ruby/object:Gem::Requirement
98
+ requirements:
99
+ - - ">="
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
102
+ type: :development
103
+ prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ requirements:
106
+ - - ">="
107
+ - !ruby/object:Gem::Version
108
+ version: '0'
109
+ - !ruby/object:Gem::Dependency
110
+ name: sidekiq
111
+ requirement: !ruby/object:Gem::Requirement
112
+ requirements:
113
+ - - ">="
114
+ - !ruby/object:Gem::Version
115
+ version: '0'
116
+ type: :development
117
+ prerelease: false
118
+ version_requirements: !ruby/object:Gem::Requirement
119
+ requirements:
120
+ - - ">="
121
+ - !ruby/object:Gem::Version
122
+ version: '0'
123
+ - !ruby/object:Gem::Dependency
124
+ name: pry
125
+ requirement: !ruby/object:Gem::Requirement
126
+ requirements:
127
+ - - ">="
128
+ - !ruby/object:Gem::Version
129
+ version: '0'
130
+ type: :development
131
+ prerelease: false
132
+ version_requirements: !ruby/object:Gem::Requirement
133
+ requirements:
134
+ - - ">="
135
+ - !ruby/object:Gem::Version
136
+ version: '0'
61
137
  description:
62
138
  email:
63
139
  - larry@lucidbleu.com
@@ -81,6 +157,8 @@ files:
81
157
  - lib/backgrounder/support/backends.rb
82
158
  - lib/backgrounder/version.rb
83
159
  - lib/backgrounder/workers.rb
160
+ - lib/backgrounder/workers/active_job/process_asset.rb
161
+ - lib/backgrounder/workers/active_job/store_asset.rb
84
162
  - lib/backgrounder/workers/base.rb
85
163
  - lib/backgrounder/workers/class_methods.rb
86
164
  - lib/backgrounder/workers/process_asset.rb
@@ -97,8 +175,63 @@ files:
97
175
  - spec/backgrounder/workers/fixtures/images/test.jpg
98
176
  - spec/backgrounder/workers/process_asset_spec.rb
99
177
  - spec/backgrounder/workers/store_asset_spec.rb
178
+ - spec/integrations/process_in_background_multi_upload_spec.rb
179
+ - spec/integrations/process_in_background_spec.rb
180
+ - spec/integrations/store_in_background_multi_upload_spec.rb
181
+ - spec/integrations/store_in_background_spec.rb
182
+ - spec/rails_helper.rb
100
183
  - spec/spec_helper.rb
101
- - spec/support/backend_constants.rb
184
+ - spec/support/dummy_app/Gemfile
185
+ - spec/support/dummy_app/README.md
186
+ - spec/support/dummy_app/Rakefile
187
+ - spec/support/dummy_app/app/controllers/application_controller.rb
188
+ - spec/support/dummy_app/app/controllers/concerns/.keep
189
+ - spec/support/dummy_app/app/jobs/application_job.rb
190
+ - spec/support/dummy_app/app/models/admin.rb
191
+ - spec/support/dummy_app/app/models/application_record.rb
192
+ - spec/support/dummy_app/app/models/concerns/.keep
193
+ - spec/support/dummy_app/app/models/user.rb
194
+ - spec/support/dummy_app/app/uploaders/avatar_uploader.rb
195
+ - spec/support/dummy_app/bin/bundle
196
+ - spec/support/dummy_app/bin/rails
197
+ - spec/support/dummy_app/bin/rake
198
+ - spec/support/dummy_app/bin/setup
199
+ - spec/support/dummy_app/config.ru
200
+ - spec/support/dummy_app/config/application.rb
201
+ - spec/support/dummy_app/config/boot.rb
202
+ - spec/support/dummy_app/config/database.yml
203
+ - spec/support/dummy_app/config/environment.rb
204
+ - spec/support/dummy_app/config/environments/development.rb
205
+ - spec/support/dummy_app/config/environments/production.rb
206
+ - spec/support/dummy_app/config/environments/test.rb
207
+ - spec/support/dummy_app/config/initializers/carrierwave_backgrounder.rb
208
+ - spec/support/dummy_app/config/initializers/cors.rb
209
+ - spec/support/dummy_app/config/initializers/filter_parameter_logging.rb
210
+ - spec/support/dummy_app/config/initializers/inflections.rb
211
+ - spec/support/dummy_app/config/locales/en.yml
212
+ - spec/support/dummy_app/config/routes.rb
213
+ - spec/support/dummy_app/config/storage.yml
214
+ - spec/support/dummy_app/db/migrate/20230804214459_create_users.rb
215
+ - spec/support/dummy_app/db/migrate/20230807165013_add_avatar_tmp_column_to_user.rb
216
+ - spec/support/dummy_app/db/migrate/20230808233036_add_avatar_processing_flag_to_users.rb
217
+ - spec/support/dummy_app/db/migrate/20230809215320_create_admins.rb
218
+ - spec/support/dummy_app/db/migrate/20230810182011_add_images_to_users.rb
219
+ - spec/support/dummy_app/db/migrate/20230811155811_add_images_to_admins.rb
220
+ - spec/support/dummy_app/db/schema.rb
221
+ - spec/support/dummy_app/db/seeds.rb
222
+ - spec/support/dummy_app/lib/tasks/.keep
223
+ - spec/support/dummy_app/log/.keep
224
+ - spec/support/dummy_app/public/robots.txt
225
+ - spec/support/dummy_app/storage/.keep
226
+ - spec/support/dummy_app/tmp/.keep
227
+ - spec/support/dummy_app/tmp/development_secret.txt
228
+ - spec/support/dummy_app/tmp/images/.gitkeep
229
+ - spec/support/dummy_app/tmp/pids/.keep
230
+ - spec/support/dummy_app/tmp/storage/.keep
231
+ - spec/support/dummy_app/vendor/.keep
232
+ - spec/support/fixtures/images/test-1.jpg
233
+ - spec/support/fixtures/images/test-2.jpg
234
+ - spec/support/global_macros.rb
102
235
  - spec/support/mock_worker.rb
103
236
  homepage: https://github.com/lardawge/carrierwave_backgrounder
104
237
  licenses:
@@ -115,11 +248,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
115
248
  version: '0'
116
249
  required_rubygems_version: !ruby/object:Gem::Requirement
117
250
  requirements:
118
- - - ">="
251
+ - - ">"
119
252
  - !ruby/object:Gem::Version
120
- version: '0'
253
+ version: 1.3.1
121
254
  requirements: []
122
- rubygems_version: 3.1.6
255
+ rubygems_version: 3.2.3
123
256
  signing_key:
124
257
  specification_version: 4
125
258
  summary: Offload CarrierWave's image processing and storage to a background process
@@ -131,6 +264,61 @@ test_files:
131
264
  - spec/backgrounder/workers/fixtures/images/test.jpg
132
265
  - spec/backgrounder/workers/process_asset_spec.rb
133
266
  - spec/backgrounder/workers/store_asset_spec.rb
267
+ - spec/integrations/process_in_background_multi_upload_spec.rb
268
+ - spec/integrations/process_in_background_spec.rb
269
+ - spec/integrations/store_in_background_multi_upload_spec.rb
270
+ - spec/integrations/store_in_background_spec.rb
271
+ - spec/rails_helper.rb
134
272
  - spec/spec_helper.rb
135
- - spec/support/backend_constants.rb
273
+ - spec/support/dummy_app/Gemfile
274
+ - spec/support/dummy_app/README.md
275
+ - spec/support/dummy_app/Rakefile
276
+ - spec/support/dummy_app/app/controllers/application_controller.rb
277
+ - spec/support/dummy_app/app/controllers/concerns/.keep
278
+ - spec/support/dummy_app/app/jobs/application_job.rb
279
+ - spec/support/dummy_app/app/models/admin.rb
280
+ - spec/support/dummy_app/app/models/application_record.rb
281
+ - spec/support/dummy_app/app/models/concerns/.keep
282
+ - spec/support/dummy_app/app/models/user.rb
283
+ - spec/support/dummy_app/app/uploaders/avatar_uploader.rb
284
+ - spec/support/dummy_app/bin/bundle
285
+ - spec/support/dummy_app/bin/rails
286
+ - spec/support/dummy_app/bin/rake
287
+ - spec/support/dummy_app/bin/setup
288
+ - spec/support/dummy_app/config.ru
289
+ - spec/support/dummy_app/config/application.rb
290
+ - spec/support/dummy_app/config/boot.rb
291
+ - spec/support/dummy_app/config/database.yml
292
+ - spec/support/dummy_app/config/environment.rb
293
+ - spec/support/dummy_app/config/environments/development.rb
294
+ - spec/support/dummy_app/config/environments/production.rb
295
+ - spec/support/dummy_app/config/environments/test.rb
296
+ - spec/support/dummy_app/config/initializers/carrierwave_backgrounder.rb
297
+ - spec/support/dummy_app/config/initializers/cors.rb
298
+ - spec/support/dummy_app/config/initializers/filter_parameter_logging.rb
299
+ - spec/support/dummy_app/config/initializers/inflections.rb
300
+ - spec/support/dummy_app/config/locales/en.yml
301
+ - spec/support/dummy_app/config/routes.rb
302
+ - spec/support/dummy_app/config/storage.yml
303
+ - spec/support/dummy_app/db/migrate/20230804214459_create_users.rb
304
+ - spec/support/dummy_app/db/migrate/20230807165013_add_avatar_tmp_column_to_user.rb
305
+ - spec/support/dummy_app/db/migrate/20230808233036_add_avatar_processing_flag_to_users.rb
306
+ - spec/support/dummy_app/db/migrate/20230809215320_create_admins.rb
307
+ - spec/support/dummy_app/db/migrate/20230810182011_add_images_to_users.rb
308
+ - spec/support/dummy_app/db/migrate/20230811155811_add_images_to_admins.rb
309
+ - spec/support/dummy_app/db/schema.rb
310
+ - spec/support/dummy_app/db/seeds.rb
311
+ - spec/support/dummy_app/lib/tasks/.keep
312
+ - spec/support/dummy_app/log/.keep
313
+ - spec/support/dummy_app/public/robots.txt
314
+ - spec/support/dummy_app/storage/.keep
315
+ - spec/support/dummy_app/tmp/.keep
316
+ - spec/support/dummy_app/tmp/development_secret.txt
317
+ - spec/support/dummy_app/tmp/images/.gitkeep
318
+ - spec/support/dummy_app/tmp/pids/.keep
319
+ - spec/support/dummy_app/tmp/storage/.keep
320
+ - spec/support/dummy_app/vendor/.keep
321
+ - spec/support/fixtures/images/test-1.jpg
322
+ - spec/support/fixtures/images/test-2.jpg
323
+ - spec/support/global_macros.rb
136
324
  - spec/support/mock_worker.rb
@@ -1,58 +0,0 @@
1
- # Fixture module declarations for backend detection testing
2
-
3
- module GirlFriday
4
- class WorkQueue
5
- end
6
- end
7
-
8
- module Delayed
9
- class Job
10
- def self.column_names
11
- %w(id priority attempts handler queue last_error run_at locked_at failed_at locked_by created_at updated_at)
12
- end
13
-
14
- column_names.each do |column_name|
15
- define_method(column_name) { nil }
16
- end
17
- end
18
- end
19
-
20
- module Resque
21
- end
22
-
23
- module Qu
24
- end
25
-
26
- module Sidekiq
27
- module Client
28
- end
29
-
30
- module Worker
31
- def self.included(base)
32
- base.extend(ClassMethods)
33
- end
34
-
35
- module ClassMethods
36
- def sidekiq_options(opts = {})
37
- opts
38
- end
39
-
40
- def client_push(item)
41
- end
42
- end
43
- end
44
- end
45
-
46
- module QC
47
- end
48
-
49
- module SuckerPunch
50
- class Queue
51
- end
52
- end
53
-
54
- module Rails
55
- def self.logger
56
- @logger ||= Logger.new(STDOUT)
57
- end
58
- end