activestorage_legacy 0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (136) hide show
  1. checksums.yaml +7 -0
  2. data/.babelrc +5 -0
  3. data/.codeclimate.yml +7 -0
  4. data/.eslintrc +19 -0
  5. data/.github/workflows/gem-push.yml +29 -0
  6. data/.github/workflows/ruby-tests.yml +37 -0
  7. data/.gitignore +9 -0
  8. data/.rubocop.yml +125 -0
  9. data/.travis.yml +25 -0
  10. data/Gemfile +33 -0
  11. data/Gemfile.lock +271 -0
  12. data/MIT-LICENSE +20 -0
  13. data/README.md +160 -0
  14. data/Rakefile +12 -0
  15. data/activestorage.gemspec +27 -0
  16. data/app/assets/javascripts/activestorage.js +1 -0
  17. data/app/controllers/active_storage/blobs_controller.rb +22 -0
  18. data/app/controllers/active_storage/direct_uploads_controller.rb +21 -0
  19. data/app/controllers/active_storage/disk_controller.rb +52 -0
  20. data/app/controllers/active_storage/variants_controller.rb +28 -0
  21. data/app/helpers/active_storage/file_field_with_direct_upload_helper.rb +18 -0
  22. data/app/javascript/activestorage/blob_record.js +54 -0
  23. data/app/javascript/activestorage/blob_upload.js +34 -0
  24. data/app/javascript/activestorage/direct_upload.js +42 -0
  25. data/app/javascript/activestorage/direct_upload_controller.js +67 -0
  26. data/app/javascript/activestorage/direct_uploads_controller.js +50 -0
  27. data/app/javascript/activestorage/file_checksum.js +53 -0
  28. data/app/javascript/activestorage/helpers.js +42 -0
  29. data/app/javascript/activestorage/index.js +11 -0
  30. data/app/javascript/activestorage/ujs.js +74 -0
  31. data/app/jobs/active_storage/purge_attachment_worker.rb +9 -0
  32. data/app/jobs/active_storage/purge_blob_worker.rb +9 -0
  33. data/app/models/active_storage/attachment.rb +33 -0
  34. data/app/models/active_storage/blob.rb +198 -0
  35. data/app/models/active_storage/filename.rb +49 -0
  36. data/app/models/active_storage/variant.rb +82 -0
  37. data/app/models/active_storage/variation.rb +53 -0
  38. data/config/routes.rb +9 -0
  39. data/config/storage_services.yml +34 -0
  40. data/lib/active_storage/attached/macros.rb +86 -0
  41. data/lib/active_storage/attached/many.rb +51 -0
  42. data/lib/active_storage/attached/one.rb +56 -0
  43. data/lib/active_storage/attached.rb +38 -0
  44. data/lib/active_storage/engine.rb +81 -0
  45. data/lib/active_storage/gem_version.rb +15 -0
  46. data/lib/active_storage/log_subscriber.rb +48 -0
  47. data/lib/active_storage/messages_metadata.rb +64 -0
  48. data/lib/active_storage/migration.rb +27 -0
  49. data/lib/active_storage/patches/active_record.rb +19 -0
  50. data/lib/active_storage/patches/delegation.rb +98 -0
  51. data/lib/active_storage/patches/secure_random.rb +26 -0
  52. data/lib/active_storage/patches.rb +4 -0
  53. data/lib/active_storage/service/azure_service.rb +115 -0
  54. data/lib/active_storage/service/configurator.rb +28 -0
  55. data/lib/active_storage/service/disk_service.rb +124 -0
  56. data/lib/active_storage/service/gcs_service.rb +79 -0
  57. data/lib/active_storage/service/mirror_service.rb +46 -0
  58. data/lib/active_storage/service/s3_service.rb +96 -0
  59. data/lib/active_storage/service.rb +113 -0
  60. data/lib/active_storage/verifier.rb +113 -0
  61. data/lib/active_storage/version.rb +8 -0
  62. data/lib/active_storage.rb +34 -0
  63. data/lib/tasks/activestorage.rake +20 -0
  64. data/package.json +33 -0
  65. data/test/controllers/direct_uploads_controller_test.rb +123 -0
  66. data/test/controllers/disk_controller_test.rb +57 -0
  67. data/test/controllers/variants_controller_test.rb +21 -0
  68. data/test/database/create_users_migration.rb +7 -0
  69. data/test/database/setup.rb +6 -0
  70. data/test/dummy/Rakefile +3 -0
  71. data/test/dummy/app/assets/config/manifest.js +5 -0
  72. data/test/dummy/app/assets/images/.keep +0 -0
  73. data/test/dummy/app/assets/javascripts/application.js +13 -0
  74. data/test/dummy/app/assets/stylesheets/application.css +15 -0
  75. data/test/dummy/app/controllers/application_controller.rb +3 -0
  76. data/test/dummy/app/controllers/concerns/.keep +0 -0
  77. data/test/dummy/app/helpers/application_helper.rb +2 -0
  78. data/test/dummy/app/jobs/application_job.rb +2 -0
  79. data/test/dummy/app/models/application_record.rb +3 -0
  80. data/test/dummy/app/models/concerns/.keep +0 -0
  81. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  82. data/test/dummy/bin/bundle +3 -0
  83. data/test/dummy/bin/rails +4 -0
  84. data/test/dummy/bin/rake +4 -0
  85. data/test/dummy/bin/yarn +11 -0
  86. data/test/dummy/config/application.rb +22 -0
  87. data/test/dummy/config/boot.rb +5 -0
  88. data/test/dummy/config/database.yml +25 -0
  89. data/test/dummy/config/environment.rb +5 -0
  90. data/test/dummy/config/environments/development.rb +49 -0
  91. data/test/dummy/config/environments/production.rb +82 -0
  92. data/test/dummy/config/environments/test.rb +33 -0
  93. data/test/dummy/config/initializers/application_controller_renderer.rb +6 -0
  94. data/test/dummy/config/initializers/assets.rb +14 -0
  95. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  96. data/test/dummy/config/initializers/cookies_serializer.rb +5 -0
  97. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  98. data/test/dummy/config/initializers/inflections.rb +16 -0
  99. data/test/dummy/config/initializers/mime_types.rb +4 -0
  100. data/test/dummy/config/initializers/secret_key.rb +3 -0
  101. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  102. data/test/dummy/config/routes.rb +2 -0
  103. data/test/dummy/config/secrets.yml +32 -0
  104. data/test/dummy/config/spring.rb +6 -0
  105. data/test/dummy/config/storage_services.yml +3 -0
  106. data/test/dummy/config.ru +5 -0
  107. data/test/dummy/db/.keep +0 -0
  108. data/test/dummy/lib/assets/.keep +0 -0
  109. data/test/dummy/log/.keep +0 -0
  110. data/test/dummy/package.json +5 -0
  111. data/test/dummy/public/404.html +67 -0
  112. data/test/dummy/public/422.html +67 -0
  113. data/test/dummy/public/500.html +66 -0
  114. data/test/dummy/public/apple-touch-icon-precomposed.png +0 -0
  115. data/test/dummy/public/apple-touch-icon.png +0 -0
  116. data/test/dummy/public/favicon.ico +0 -0
  117. data/test/filename_test.rb +36 -0
  118. data/test/fixtures/files/racecar.jpg +0 -0
  119. data/test/models/attachments_test.rb +122 -0
  120. data/test/models/blob_test.rb +47 -0
  121. data/test/models/variant_test.rb +27 -0
  122. data/test/service/.gitignore +1 -0
  123. data/test/service/azure_service_test.rb +14 -0
  124. data/test/service/configurations-example.yml +31 -0
  125. data/test/service/configurator_test.rb +14 -0
  126. data/test/service/disk_service_test.rb +12 -0
  127. data/test/service/gcs_service_test.rb +42 -0
  128. data/test/service/mirror_service_test.rb +62 -0
  129. data/test/service/s3_service_test.rb +52 -0
  130. data/test/service/shared_service_tests.rb +66 -0
  131. data/test/sidekiq/minitest_support.rb +6 -0
  132. data/test/support/assertions.rb +20 -0
  133. data/test/test_helper.rb +69 -0
  134. data/webpack.config.js +27 -0
  135. data/yarn.lock +3164 -0
  136. metadata +330 -0
metadata ADDED
@@ -0,0 +1,330 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: activestorage_legacy
3
+ version: !ruby/object:Gem::Version
4
+ version: '0.1'
5
+ platform: ruby
6
+ authors:
7
+ - David Heinemeier Hansson
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2023-06-30 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 3.2.22.4
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 3.2.22.4
27
+ - !ruby/object:Gem::Dependency
28
+ name: sidekiq
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 4.2.0
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: 4.2.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: strong_parameters
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: mini_magick
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '4.0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '4.0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: marcel
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '1.0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '1.0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: bundler
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '1.15'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '1.15'
97
+ description:
98
+ email: david@basecamp.com
99
+ executables: []
100
+ extensions: []
101
+ extra_rdoc_files: []
102
+ files:
103
+ - ".babelrc"
104
+ - ".codeclimate.yml"
105
+ - ".eslintrc"
106
+ - ".github/workflows/gem-push.yml"
107
+ - ".github/workflows/ruby-tests.yml"
108
+ - ".gitignore"
109
+ - ".rubocop.yml"
110
+ - ".travis.yml"
111
+ - Gemfile
112
+ - Gemfile.lock
113
+ - MIT-LICENSE
114
+ - README.md
115
+ - Rakefile
116
+ - activestorage.gemspec
117
+ - app/assets/javascripts/activestorage.js
118
+ - app/controllers/active_storage/blobs_controller.rb
119
+ - app/controllers/active_storage/direct_uploads_controller.rb
120
+ - app/controllers/active_storage/disk_controller.rb
121
+ - app/controllers/active_storage/variants_controller.rb
122
+ - app/helpers/active_storage/file_field_with_direct_upload_helper.rb
123
+ - app/javascript/activestorage/blob_record.js
124
+ - app/javascript/activestorage/blob_upload.js
125
+ - app/javascript/activestorage/direct_upload.js
126
+ - app/javascript/activestorage/direct_upload_controller.js
127
+ - app/javascript/activestorage/direct_uploads_controller.js
128
+ - app/javascript/activestorage/file_checksum.js
129
+ - app/javascript/activestorage/helpers.js
130
+ - app/javascript/activestorage/index.js
131
+ - app/javascript/activestorage/ujs.js
132
+ - app/jobs/active_storage/purge_attachment_worker.rb
133
+ - app/jobs/active_storage/purge_blob_worker.rb
134
+ - app/models/active_storage/attachment.rb
135
+ - app/models/active_storage/blob.rb
136
+ - app/models/active_storage/filename.rb
137
+ - app/models/active_storage/variant.rb
138
+ - app/models/active_storage/variation.rb
139
+ - config/routes.rb
140
+ - config/storage_services.yml
141
+ - lib/active_storage.rb
142
+ - lib/active_storage/attached.rb
143
+ - lib/active_storage/attached/macros.rb
144
+ - lib/active_storage/attached/many.rb
145
+ - lib/active_storage/attached/one.rb
146
+ - lib/active_storage/engine.rb
147
+ - lib/active_storage/gem_version.rb
148
+ - lib/active_storage/log_subscriber.rb
149
+ - lib/active_storage/messages_metadata.rb
150
+ - lib/active_storage/migration.rb
151
+ - lib/active_storage/patches.rb
152
+ - lib/active_storage/patches/active_record.rb
153
+ - lib/active_storage/patches/delegation.rb
154
+ - lib/active_storage/patches/secure_random.rb
155
+ - lib/active_storage/service.rb
156
+ - lib/active_storage/service/azure_service.rb
157
+ - lib/active_storage/service/configurator.rb
158
+ - lib/active_storage/service/disk_service.rb
159
+ - lib/active_storage/service/gcs_service.rb
160
+ - lib/active_storage/service/mirror_service.rb
161
+ - lib/active_storage/service/s3_service.rb
162
+ - lib/active_storage/verifier.rb
163
+ - lib/active_storage/version.rb
164
+ - lib/tasks/activestorage.rake
165
+ - package.json
166
+ - test/controllers/direct_uploads_controller_test.rb
167
+ - test/controllers/disk_controller_test.rb
168
+ - test/controllers/variants_controller_test.rb
169
+ - test/database/create_users_migration.rb
170
+ - test/database/setup.rb
171
+ - test/dummy/Rakefile
172
+ - test/dummy/app/assets/config/manifest.js
173
+ - test/dummy/app/assets/images/.keep
174
+ - test/dummy/app/assets/javascripts/application.js
175
+ - test/dummy/app/assets/stylesheets/application.css
176
+ - test/dummy/app/controllers/application_controller.rb
177
+ - test/dummy/app/controllers/concerns/.keep
178
+ - test/dummy/app/helpers/application_helper.rb
179
+ - test/dummy/app/jobs/application_job.rb
180
+ - test/dummy/app/models/application_record.rb
181
+ - test/dummy/app/models/concerns/.keep
182
+ - test/dummy/app/views/layouts/application.html.erb
183
+ - test/dummy/bin/bundle
184
+ - test/dummy/bin/rails
185
+ - test/dummy/bin/rake
186
+ - test/dummy/bin/yarn
187
+ - test/dummy/config.ru
188
+ - test/dummy/config/application.rb
189
+ - test/dummy/config/boot.rb
190
+ - test/dummy/config/database.yml
191
+ - test/dummy/config/environment.rb
192
+ - test/dummy/config/environments/development.rb
193
+ - test/dummy/config/environments/production.rb
194
+ - test/dummy/config/environments/test.rb
195
+ - test/dummy/config/initializers/application_controller_renderer.rb
196
+ - test/dummy/config/initializers/assets.rb
197
+ - test/dummy/config/initializers/backtrace_silencers.rb
198
+ - test/dummy/config/initializers/cookies_serializer.rb
199
+ - test/dummy/config/initializers/filter_parameter_logging.rb
200
+ - test/dummy/config/initializers/inflections.rb
201
+ - test/dummy/config/initializers/mime_types.rb
202
+ - test/dummy/config/initializers/secret_key.rb
203
+ - test/dummy/config/initializers/wrap_parameters.rb
204
+ - test/dummy/config/routes.rb
205
+ - test/dummy/config/secrets.yml
206
+ - test/dummy/config/spring.rb
207
+ - test/dummy/config/storage_services.yml
208
+ - test/dummy/db/.keep
209
+ - test/dummy/lib/assets/.keep
210
+ - test/dummy/log/.keep
211
+ - test/dummy/package.json
212
+ - test/dummy/public/404.html
213
+ - test/dummy/public/422.html
214
+ - test/dummy/public/500.html
215
+ - test/dummy/public/apple-touch-icon-precomposed.png
216
+ - test/dummy/public/apple-touch-icon.png
217
+ - test/dummy/public/favicon.ico
218
+ - test/filename_test.rb
219
+ - test/fixtures/files/racecar.jpg
220
+ - test/models/attachments_test.rb
221
+ - test/models/blob_test.rb
222
+ - test/models/variant_test.rb
223
+ - test/service/.gitignore
224
+ - test/service/azure_service_test.rb
225
+ - test/service/configurations-example.yml
226
+ - test/service/configurator_test.rb
227
+ - test/service/disk_service_test.rb
228
+ - test/service/gcs_service_test.rb
229
+ - test/service/mirror_service_test.rb
230
+ - test/service/s3_service_test.rb
231
+ - test/service/shared_service_tests.rb
232
+ - test/sidekiq/minitest_support.rb
233
+ - test/support/assertions.rb
234
+ - test/test_helper.rb
235
+ - webpack.config.js
236
+ - yarn.lock
237
+ homepage: https://github.com/rails/activestorage
238
+ licenses:
239
+ - MIT
240
+ metadata: {}
241
+ post_install_message:
242
+ rdoc_options: []
243
+ require_paths:
244
+ - lib
245
+ required_ruby_version: !ruby/object:Gem::Requirement
246
+ requirements:
247
+ - - ">="
248
+ - !ruby/object:Gem::Version
249
+ version: 2.2.2
250
+ required_rubygems_version: !ruby/object:Gem::Requirement
251
+ requirements:
252
+ - - ">="
253
+ - !ruby/object:Gem::Version
254
+ version: '0'
255
+ requirements: []
256
+ rubyforge_project:
257
+ rubygems_version: 2.5.2.3
258
+ signing_key:
259
+ specification_version: 4
260
+ summary: Attach cloud and local files in Rails applications
261
+ test_files:
262
+ - test/controllers/direct_uploads_controller_test.rb
263
+ - test/controllers/disk_controller_test.rb
264
+ - test/controllers/variants_controller_test.rb
265
+ - test/database/create_users_migration.rb
266
+ - test/database/setup.rb
267
+ - test/dummy/Rakefile
268
+ - test/dummy/app/assets/config/manifest.js
269
+ - test/dummy/app/assets/images/.keep
270
+ - test/dummy/app/assets/javascripts/application.js
271
+ - test/dummy/app/assets/stylesheets/application.css
272
+ - test/dummy/app/controllers/application_controller.rb
273
+ - test/dummy/app/controllers/concerns/.keep
274
+ - test/dummy/app/helpers/application_helper.rb
275
+ - test/dummy/app/jobs/application_job.rb
276
+ - test/dummy/app/models/application_record.rb
277
+ - test/dummy/app/models/concerns/.keep
278
+ - test/dummy/app/views/layouts/application.html.erb
279
+ - test/dummy/bin/bundle
280
+ - test/dummy/bin/rails
281
+ - test/dummy/bin/rake
282
+ - test/dummy/bin/yarn
283
+ - test/dummy/config.ru
284
+ - test/dummy/config/application.rb
285
+ - test/dummy/config/boot.rb
286
+ - test/dummy/config/database.yml
287
+ - test/dummy/config/environment.rb
288
+ - test/dummy/config/environments/development.rb
289
+ - test/dummy/config/environments/production.rb
290
+ - test/dummy/config/environments/test.rb
291
+ - test/dummy/config/initializers/application_controller_renderer.rb
292
+ - test/dummy/config/initializers/assets.rb
293
+ - test/dummy/config/initializers/backtrace_silencers.rb
294
+ - test/dummy/config/initializers/cookies_serializer.rb
295
+ - test/dummy/config/initializers/filter_parameter_logging.rb
296
+ - test/dummy/config/initializers/inflections.rb
297
+ - test/dummy/config/initializers/mime_types.rb
298
+ - test/dummy/config/initializers/secret_key.rb
299
+ - test/dummy/config/initializers/wrap_parameters.rb
300
+ - test/dummy/config/routes.rb
301
+ - test/dummy/config/secrets.yml
302
+ - test/dummy/config/spring.rb
303
+ - test/dummy/config/storage_services.yml
304
+ - test/dummy/db/.keep
305
+ - test/dummy/lib/assets/.keep
306
+ - test/dummy/log/.keep
307
+ - test/dummy/package.json
308
+ - test/dummy/public/404.html
309
+ - test/dummy/public/422.html
310
+ - test/dummy/public/500.html
311
+ - test/dummy/public/apple-touch-icon-precomposed.png
312
+ - test/dummy/public/apple-touch-icon.png
313
+ - test/dummy/public/favicon.ico
314
+ - test/filename_test.rb
315
+ - test/fixtures/files/racecar.jpg
316
+ - test/models/attachments_test.rb
317
+ - test/models/blob_test.rb
318
+ - test/models/variant_test.rb
319
+ - test/service/.gitignore
320
+ - test/service/azure_service_test.rb
321
+ - test/service/configurations-example.yml
322
+ - test/service/configurator_test.rb
323
+ - test/service/disk_service_test.rb
324
+ - test/service/gcs_service_test.rb
325
+ - test/service/mirror_service_test.rb
326
+ - test/service/s3_service_test.rb
327
+ - test/service/shared_service_tests.rb
328
+ - test/sidekiq/minitest_support.rb
329
+ - test/support/assertions.rb
330
+ - test/test_helper.rb