active_storage-async_variants 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.github/workflows/ci.yml +27 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/Appraisals +11 -0
- data/CHANGELOG.md +5 -0
- data/CLAUDE.md +48 -0
- data/LICENSE.txt +21 -0
- data/README.md +228 -0
- data/Rakefile +8 -0
- data/app/controllers/active_storage/async_variants/callbacks_controller.rb +25 -0
- data/config/routes.rb +7 -0
- data/gemfiles/rails_7.2.gemfile +13 -0
- data/gemfiles/rails_7.2.gemfile.lock +269 -0
- data/gemfiles/rails_8.0.gemfile +13 -0
- data/gemfiles/rails_8.0.gemfile.lock +266 -0
- data/gemfiles/rails_8.1.gemfile +13 -0
- data/gemfiles/rails_8.1.gemfile.lock +269 -0
- data/lib/active_storage/async_variants/attachment_extension.rb +24 -0
- data/lib/active_storage/async_variants/process_job.rb +86 -0
- data/lib/active_storage/async_variants/transformer.rb +19 -0
- data/lib/active_storage/async_variants/variant_with_record_extension.rb +60 -0
- data/lib/active_storage/async_variants/variation_extension.rb +27 -0
- data/lib/active_storage/async_variants/version.rb +7 -0
- data/lib/active_storage/async_variants.rb +38 -0
- data/log/.gitkeep +0 -0
- data/sig/active_storage/async_variants.rbs +6 -0
- metadata +82 -0
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: ..
|
|
3
|
+
specs:
|
|
4
|
+
active_storage-async_variants (0.1.0)
|
|
5
|
+
activestorage (>= 7.1)
|
|
6
|
+
|
|
7
|
+
GEM
|
|
8
|
+
remote: https://rubygems.org/
|
|
9
|
+
specs:
|
|
10
|
+
actioncable (8.0.4)
|
|
11
|
+
actionpack (= 8.0.4)
|
|
12
|
+
activesupport (= 8.0.4)
|
|
13
|
+
nio4r (~> 2.0)
|
|
14
|
+
websocket-driver (>= 0.6.1)
|
|
15
|
+
zeitwerk (~> 2.6)
|
|
16
|
+
actionmailbox (8.0.4)
|
|
17
|
+
actionpack (= 8.0.4)
|
|
18
|
+
activejob (= 8.0.4)
|
|
19
|
+
activerecord (= 8.0.4)
|
|
20
|
+
activestorage (= 8.0.4)
|
|
21
|
+
activesupport (= 8.0.4)
|
|
22
|
+
mail (>= 2.8.0)
|
|
23
|
+
actionmailer (8.0.4)
|
|
24
|
+
actionpack (= 8.0.4)
|
|
25
|
+
actionview (= 8.0.4)
|
|
26
|
+
activejob (= 8.0.4)
|
|
27
|
+
activesupport (= 8.0.4)
|
|
28
|
+
mail (>= 2.8.0)
|
|
29
|
+
rails-dom-testing (~> 2.2)
|
|
30
|
+
actionpack (8.0.4)
|
|
31
|
+
actionview (= 8.0.4)
|
|
32
|
+
activesupport (= 8.0.4)
|
|
33
|
+
nokogiri (>= 1.8.5)
|
|
34
|
+
rack (>= 2.2.4)
|
|
35
|
+
rack-session (>= 1.0.1)
|
|
36
|
+
rack-test (>= 0.6.3)
|
|
37
|
+
rails-dom-testing (~> 2.2)
|
|
38
|
+
rails-html-sanitizer (~> 1.6)
|
|
39
|
+
useragent (~> 0.16)
|
|
40
|
+
actiontext (8.0.4)
|
|
41
|
+
actionpack (= 8.0.4)
|
|
42
|
+
activerecord (= 8.0.4)
|
|
43
|
+
activestorage (= 8.0.4)
|
|
44
|
+
activesupport (= 8.0.4)
|
|
45
|
+
globalid (>= 0.6.0)
|
|
46
|
+
nokogiri (>= 1.8.5)
|
|
47
|
+
actionview (8.0.4)
|
|
48
|
+
activesupport (= 8.0.4)
|
|
49
|
+
builder (~> 3.1)
|
|
50
|
+
erubi (~> 1.11)
|
|
51
|
+
rails-dom-testing (~> 2.2)
|
|
52
|
+
rails-html-sanitizer (~> 1.6)
|
|
53
|
+
activejob (8.0.4)
|
|
54
|
+
activesupport (= 8.0.4)
|
|
55
|
+
globalid (>= 0.3.6)
|
|
56
|
+
activemodel (8.0.4)
|
|
57
|
+
activesupport (= 8.0.4)
|
|
58
|
+
activerecord (8.0.4)
|
|
59
|
+
activemodel (= 8.0.4)
|
|
60
|
+
activesupport (= 8.0.4)
|
|
61
|
+
timeout (>= 0.4.0)
|
|
62
|
+
activestorage (8.0.4)
|
|
63
|
+
actionpack (= 8.0.4)
|
|
64
|
+
activejob (= 8.0.4)
|
|
65
|
+
activerecord (= 8.0.4)
|
|
66
|
+
activesupport (= 8.0.4)
|
|
67
|
+
marcel (~> 1.0)
|
|
68
|
+
activesupport (8.0.4)
|
|
69
|
+
base64
|
|
70
|
+
benchmark (>= 0.3)
|
|
71
|
+
bigdecimal
|
|
72
|
+
concurrent-ruby (~> 1.0, >= 1.3.1)
|
|
73
|
+
connection_pool (>= 2.2.5)
|
|
74
|
+
drb
|
|
75
|
+
i18n (>= 1.6, < 2)
|
|
76
|
+
logger (>= 1.4.2)
|
|
77
|
+
minitest (>= 5.1)
|
|
78
|
+
securerandom (>= 0.3)
|
|
79
|
+
tzinfo (~> 2.0, >= 2.0.5)
|
|
80
|
+
uri (>= 0.13.1)
|
|
81
|
+
appraisal (2.5.0)
|
|
82
|
+
bundler
|
|
83
|
+
rake
|
|
84
|
+
thor (>= 0.14.0)
|
|
85
|
+
base64 (0.3.0)
|
|
86
|
+
benchmark (0.5.0)
|
|
87
|
+
bigdecimal (4.0.1)
|
|
88
|
+
builder (3.3.0)
|
|
89
|
+
concurrent-ruby (1.3.6)
|
|
90
|
+
connection_pool (3.0.2)
|
|
91
|
+
crass (1.0.6)
|
|
92
|
+
date (3.5.1)
|
|
93
|
+
diff-lcs (1.6.2)
|
|
94
|
+
drb (2.2.3)
|
|
95
|
+
erb (6.0.2)
|
|
96
|
+
erubi (1.13.1)
|
|
97
|
+
globalid (1.3.0)
|
|
98
|
+
activesupport (>= 6.1)
|
|
99
|
+
i18n (1.14.8)
|
|
100
|
+
concurrent-ruby (~> 1.0)
|
|
101
|
+
io-console (0.8.2)
|
|
102
|
+
irb (1.17.0)
|
|
103
|
+
pp (>= 0.6.0)
|
|
104
|
+
prism (>= 1.3.0)
|
|
105
|
+
rdoc (>= 4.0.0)
|
|
106
|
+
reline (>= 0.4.2)
|
|
107
|
+
logger (1.7.0)
|
|
108
|
+
loofah (2.25.0)
|
|
109
|
+
crass (~> 1.0.2)
|
|
110
|
+
nokogiri (>= 1.12.0)
|
|
111
|
+
mail (2.9.0)
|
|
112
|
+
logger
|
|
113
|
+
mini_mime (>= 0.1.1)
|
|
114
|
+
net-imap
|
|
115
|
+
net-pop
|
|
116
|
+
net-smtp
|
|
117
|
+
marcel (1.1.0)
|
|
118
|
+
mini_mime (1.1.5)
|
|
119
|
+
minitest (6.0.2)
|
|
120
|
+
drb (~> 2.0)
|
|
121
|
+
prism (~> 1.5)
|
|
122
|
+
net-imap (0.6.3)
|
|
123
|
+
date
|
|
124
|
+
net-protocol
|
|
125
|
+
net-pop (0.1.2)
|
|
126
|
+
net-protocol
|
|
127
|
+
net-protocol (0.2.2)
|
|
128
|
+
timeout
|
|
129
|
+
net-smtp (0.5.1)
|
|
130
|
+
net-protocol
|
|
131
|
+
nio4r (2.7.5)
|
|
132
|
+
nokogiri (1.19.1-aarch64-linux-gnu)
|
|
133
|
+
racc (~> 1.4)
|
|
134
|
+
nokogiri (1.19.1-aarch64-linux-musl)
|
|
135
|
+
racc (~> 1.4)
|
|
136
|
+
nokogiri (1.19.1-arm-linux-gnu)
|
|
137
|
+
racc (~> 1.4)
|
|
138
|
+
nokogiri (1.19.1-arm-linux-musl)
|
|
139
|
+
racc (~> 1.4)
|
|
140
|
+
nokogiri (1.19.1-arm64-darwin)
|
|
141
|
+
racc (~> 1.4)
|
|
142
|
+
nokogiri (1.19.1-x86_64-darwin)
|
|
143
|
+
racc (~> 1.4)
|
|
144
|
+
nokogiri (1.19.1-x86_64-linux-gnu)
|
|
145
|
+
racc (~> 1.4)
|
|
146
|
+
nokogiri (1.19.1-x86_64-linux-musl)
|
|
147
|
+
racc (~> 1.4)
|
|
148
|
+
pp (0.6.3)
|
|
149
|
+
prettyprint
|
|
150
|
+
prettyprint (0.2.0)
|
|
151
|
+
prism (1.9.0)
|
|
152
|
+
psych (5.3.1)
|
|
153
|
+
date
|
|
154
|
+
stringio
|
|
155
|
+
racc (1.8.1)
|
|
156
|
+
rack (3.2.5)
|
|
157
|
+
rack-session (2.1.1)
|
|
158
|
+
base64 (>= 0.1.0)
|
|
159
|
+
rack (>= 3.0.0)
|
|
160
|
+
rack-test (2.2.0)
|
|
161
|
+
rack (>= 1.3)
|
|
162
|
+
rackup (2.3.1)
|
|
163
|
+
rack (>= 3)
|
|
164
|
+
rails (8.0.4)
|
|
165
|
+
actioncable (= 8.0.4)
|
|
166
|
+
actionmailbox (= 8.0.4)
|
|
167
|
+
actionmailer (= 8.0.4)
|
|
168
|
+
actionpack (= 8.0.4)
|
|
169
|
+
actiontext (= 8.0.4)
|
|
170
|
+
actionview (= 8.0.4)
|
|
171
|
+
activejob (= 8.0.4)
|
|
172
|
+
activemodel (= 8.0.4)
|
|
173
|
+
activerecord (= 8.0.4)
|
|
174
|
+
activestorage (= 8.0.4)
|
|
175
|
+
activesupport (= 8.0.4)
|
|
176
|
+
bundler (>= 1.15.0)
|
|
177
|
+
railties (= 8.0.4)
|
|
178
|
+
rails-dom-testing (2.3.0)
|
|
179
|
+
activesupport (>= 5.0.0)
|
|
180
|
+
minitest
|
|
181
|
+
nokogiri (>= 1.6)
|
|
182
|
+
rails-html-sanitizer (1.7.0)
|
|
183
|
+
loofah (~> 2.25)
|
|
184
|
+
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
|
|
185
|
+
railties (8.0.4)
|
|
186
|
+
actionpack (= 8.0.4)
|
|
187
|
+
activesupport (= 8.0.4)
|
|
188
|
+
irb (~> 1.13)
|
|
189
|
+
rackup (>= 1.0.0)
|
|
190
|
+
rake (>= 12.2)
|
|
191
|
+
thor (~> 1.0, >= 1.2.2)
|
|
192
|
+
tsort (>= 0.2)
|
|
193
|
+
zeitwerk (~> 2.6)
|
|
194
|
+
rake (13.3.1)
|
|
195
|
+
rdoc (7.2.0)
|
|
196
|
+
erb
|
|
197
|
+
psych (>= 4.0.0)
|
|
198
|
+
tsort
|
|
199
|
+
reline (0.6.3)
|
|
200
|
+
io-console (~> 0.5)
|
|
201
|
+
rspec (3.13.2)
|
|
202
|
+
rspec-core (~> 3.13.0)
|
|
203
|
+
rspec-expectations (~> 3.13.0)
|
|
204
|
+
rspec-mocks (~> 3.13.0)
|
|
205
|
+
rspec-core (3.13.6)
|
|
206
|
+
rspec-support (~> 3.13.0)
|
|
207
|
+
rspec-expectations (3.13.5)
|
|
208
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
209
|
+
rspec-support (~> 3.13.0)
|
|
210
|
+
rspec-mocks (3.13.8)
|
|
211
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
212
|
+
rspec-support (~> 3.13.0)
|
|
213
|
+
rspec-rails (8.0.3)
|
|
214
|
+
actionpack (>= 7.2)
|
|
215
|
+
activesupport (>= 7.2)
|
|
216
|
+
railties (>= 7.2)
|
|
217
|
+
rspec-core (~> 3.13)
|
|
218
|
+
rspec-expectations (~> 3.13)
|
|
219
|
+
rspec-mocks (~> 3.13)
|
|
220
|
+
rspec-support (~> 3.13)
|
|
221
|
+
rspec-support (3.13.7)
|
|
222
|
+
securerandom (0.4.1)
|
|
223
|
+
sqlite3 (2.9.1-aarch64-linux-gnu)
|
|
224
|
+
sqlite3 (2.9.1-aarch64-linux-musl)
|
|
225
|
+
sqlite3 (2.9.1-arm-linux-gnu)
|
|
226
|
+
sqlite3 (2.9.1-arm-linux-musl)
|
|
227
|
+
sqlite3 (2.9.1-arm64-darwin)
|
|
228
|
+
sqlite3 (2.9.1-x86_64-darwin)
|
|
229
|
+
sqlite3 (2.9.1-x86_64-linux-gnu)
|
|
230
|
+
sqlite3 (2.9.1-x86_64-linux-musl)
|
|
231
|
+
stringio (3.2.0)
|
|
232
|
+
thor (1.5.0)
|
|
233
|
+
timeout (0.6.0)
|
|
234
|
+
tsort (0.2.0)
|
|
235
|
+
tzinfo (2.0.6)
|
|
236
|
+
concurrent-ruby (~> 1.0)
|
|
237
|
+
uri (1.1.1)
|
|
238
|
+
useragent (0.16.11)
|
|
239
|
+
websocket-driver (0.8.0)
|
|
240
|
+
base64
|
|
241
|
+
websocket-extensions (>= 0.1.0)
|
|
242
|
+
websocket-extensions (0.1.5)
|
|
243
|
+
zeitwerk (2.7.5)
|
|
244
|
+
|
|
245
|
+
PLATFORMS
|
|
246
|
+
aarch64-linux-gnu
|
|
247
|
+
aarch64-linux-musl
|
|
248
|
+
arm-linux-gnu
|
|
249
|
+
arm-linux-musl
|
|
250
|
+
arm64-darwin
|
|
251
|
+
x86_64-darwin
|
|
252
|
+
x86_64-linux-gnu
|
|
253
|
+
x86_64-linux-musl
|
|
254
|
+
|
|
255
|
+
DEPENDENCIES
|
|
256
|
+
active_storage-async_variants!
|
|
257
|
+
appraisal
|
|
258
|
+
irb
|
|
259
|
+
rails (~> 8.0.0)
|
|
260
|
+
rake (~> 13.0)
|
|
261
|
+
rspec (~> 3.0)
|
|
262
|
+
rspec-rails
|
|
263
|
+
sqlite3
|
|
264
|
+
|
|
265
|
+
BUNDLED WITH
|
|
266
|
+
2.6.2
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: ..
|
|
3
|
+
specs:
|
|
4
|
+
active_storage-async_variants (0.1.0)
|
|
5
|
+
activestorage (>= 7.1)
|
|
6
|
+
|
|
7
|
+
GEM
|
|
8
|
+
remote: https://rubygems.org/
|
|
9
|
+
specs:
|
|
10
|
+
action_text-trix (2.1.16)
|
|
11
|
+
railties
|
|
12
|
+
actioncable (8.1.2)
|
|
13
|
+
actionpack (= 8.1.2)
|
|
14
|
+
activesupport (= 8.1.2)
|
|
15
|
+
nio4r (~> 2.0)
|
|
16
|
+
websocket-driver (>= 0.6.1)
|
|
17
|
+
zeitwerk (~> 2.6)
|
|
18
|
+
actionmailbox (8.1.2)
|
|
19
|
+
actionpack (= 8.1.2)
|
|
20
|
+
activejob (= 8.1.2)
|
|
21
|
+
activerecord (= 8.1.2)
|
|
22
|
+
activestorage (= 8.1.2)
|
|
23
|
+
activesupport (= 8.1.2)
|
|
24
|
+
mail (>= 2.8.0)
|
|
25
|
+
actionmailer (8.1.2)
|
|
26
|
+
actionpack (= 8.1.2)
|
|
27
|
+
actionview (= 8.1.2)
|
|
28
|
+
activejob (= 8.1.2)
|
|
29
|
+
activesupport (= 8.1.2)
|
|
30
|
+
mail (>= 2.8.0)
|
|
31
|
+
rails-dom-testing (~> 2.2)
|
|
32
|
+
actionpack (8.1.2)
|
|
33
|
+
actionview (= 8.1.2)
|
|
34
|
+
activesupport (= 8.1.2)
|
|
35
|
+
nokogiri (>= 1.8.5)
|
|
36
|
+
rack (>= 2.2.4)
|
|
37
|
+
rack-session (>= 1.0.1)
|
|
38
|
+
rack-test (>= 0.6.3)
|
|
39
|
+
rails-dom-testing (~> 2.2)
|
|
40
|
+
rails-html-sanitizer (~> 1.6)
|
|
41
|
+
useragent (~> 0.16)
|
|
42
|
+
actiontext (8.1.2)
|
|
43
|
+
action_text-trix (~> 2.1.15)
|
|
44
|
+
actionpack (= 8.1.2)
|
|
45
|
+
activerecord (= 8.1.2)
|
|
46
|
+
activestorage (= 8.1.2)
|
|
47
|
+
activesupport (= 8.1.2)
|
|
48
|
+
globalid (>= 0.6.0)
|
|
49
|
+
nokogiri (>= 1.8.5)
|
|
50
|
+
actionview (8.1.2)
|
|
51
|
+
activesupport (= 8.1.2)
|
|
52
|
+
builder (~> 3.1)
|
|
53
|
+
erubi (~> 1.11)
|
|
54
|
+
rails-dom-testing (~> 2.2)
|
|
55
|
+
rails-html-sanitizer (~> 1.6)
|
|
56
|
+
activejob (8.1.2)
|
|
57
|
+
activesupport (= 8.1.2)
|
|
58
|
+
globalid (>= 0.3.6)
|
|
59
|
+
activemodel (8.1.2)
|
|
60
|
+
activesupport (= 8.1.2)
|
|
61
|
+
activerecord (8.1.2)
|
|
62
|
+
activemodel (= 8.1.2)
|
|
63
|
+
activesupport (= 8.1.2)
|
|
64
|
+
timeout (>= 0.4.0)
|
|
65
|
+
activestorage (8.1.2)
|
|
66
|
+
actionpack (= 8.1.2)
|
|
67
|
+
activejob (= 8.1.2)
|
|
68
|
+
activerecord (= 8.1.2)
|
|
69
|
+
activesupport (= 8.1.2)
|
|
70
|
+
marcel (~> 1.0)
|
|
71
|
+
activesupport (8.1.2)
|
|
72
|
+
base64
|
|
73
|
+
bigdecimal
|
|
74
|
+
concurrent-ruby (~> 1.0, >= 1.3.1)
|
|
75
|
+
connection_pool (>= 2.2.5)
|
|
76
|
+
drb
|
|
77
|
+
i18n (>= 1.6, < 2)
|
|
78
|
+
json
|
|
79
|
+
logger (>= 1.4.2)
|
|
80
|
+
minitest (>= 5.1)
|
|
81
|
+
securerandom (>= 0.3)
|
|
82
|
+
tzinfo (~> 2.0, >= 2.0.5)
|
|
83
|
+
uri (>= 0.13.1)
|
|
84
|
+
appraisal (2.5.0)
|
|
85
|
+
bundler
|
|
86
|
+
rake
|
|
87
|
+
thor (>= 0.14.0)
|
|
88
|
+
base64 (0.3.0)
|
|
89
|
+
bigdecimal (4.0.1)
|
|
90
|
+
builder (3.3.0)
|
|
91
|
+
concurrent-ruby (1.3.6)
|
|
92
|
+
connection_pool (3.0.2)
|
|
93
|
+
crass (1.0.6)
|
|
94
|
+
date (3.5.1)
|
|
95
|
+
diff-lcs (1.6.2)
|
|
96
|
+
drb (2.2.3)
|
|
97
|
+
erb (6.0.2)
|
|
98
|
+
erubi (1.13.1)
|
|
99
|
+
globalid (1.3.0)
|
|
100
|
+
activesupport (>= 6.1)
|
|
101
|
+
i18n (1.14.8)
|
|
102
|
+
concurrent-ruby (~> 1.0)
|
|
103
|
+
io-console (0.8.2)
|
|
104
|
+
irb (1.17.0)
|
|
105
|
+
pp (>= 0.6.0)
|
|
106
|
+
prism (>= 1.3.0)
|
|
107
|
+
rdoc (>= 4.0.0)
|
|
108
|
+
reline (>= 0.4.2)
|
|
109
|
+
json (2.18.1)
|
|
110
|
+
logger (1.7.0)
|
|
111
|
+
loofah (2.25.0)
|
|
112
|
+
crass (~> 1.0.2)
|
|
113
|
+
nokogiri (>= 1.12.0)
|
|
114
|
+
mail (2.9.0)
|
|
115
|
+
logger
|
|
116
|
+
mini_mime (>= 0.1.1)
|
|
117
|
+
net-imap
|
|
118
|
+
net-pop
|
|
119
|
+
net-smtp
|
|
120
|
+
marcel (1.1.0)
|
|
121
|
+
mini_mime (1.1.5)
|
|
122
|
+
minitest (6.0.2)
|
|
123
|
+
drb (~> 2.0)
|
|
124
|
+
prism (~> 1.5)
|
|
125
|
+
net-imap (0.6.3)
|
|
126
|
+
date
|
|
127
|
+
net-protocol
|
|
128
|
+
net-pop (0.1.2)
|
|
129
|
+
net-protocol
|
|
130
|
+
net-protocol (0.2.2)
|
|
131
|
+
timeout
|
|
132
|
+
net-smtp (0.5.1)
|
|
133
|
+
net-protocol
|
|
134
|
+
nio4r (2.7.5)
|
|
135
|
+
nokogiri (1.19.1-aarch64-linux-gnu)
|
|
136
|
+
racc (~> 1.4)
|
|
137
|
+
nokogiri (1.19.1-aarch64-linux-musl)
|
|
138
|
+
racc (~> 1.4)
|
|
139
|
+
nokogiri (1.19.1-arm-linux-gnu)
|
|
140
|
+
racc (~> 1.4)
|
|
141
|
+
nokogiri (1.19.1-arm-linux-musl)
|
|
142
|
+
racc (~> 1.4)
|
|
143
|
+
nokogiri (1.19.1-arm64-darwin)
|
|
144
|
+
racc (~> 1.4)
|
|
145
|
+
nokogiri (1.19.1-x86_64-darwin)
|
|
146
|
+
racc (~> 1.4)
|
|
147
|
+
nokogiri (1.19.1-x86_64-linux-gnu)
|
|
148
|
+
racc (~> 1.4)
|
|
149
|
+
nokogiri (1.19.1-x86_64-linux-musl)
|
|
150
|
+
racc (~> 1.4)
|
|
151
|
+
pp (0.6.3)
|
|
152
|
+
prettyprint
|
|
153
|
+
prettyprint (0.2.0)
|
|
154
|
+
prism (1.9.0)
|
|
155
|
+
psych (5.3.1)
|
|
156
|
+
date
|
|
157
|
+
stringio
|
|
158
|
+
racc (1.8.1)
|
|
159
|
+
rack (3.2.5)
|
|
160
|
+
rack-session (2.1.1)
|
|
161
|
+
base64 (>= 0.1.0)
|
|
162
|
+
rack (>= 3.0.0)
|
|
163
|
+
rack-test (2.2.0)
|
|
164
|
+
rack (>= 1.3)
|
|
165
|
+
rackup (2.3.1)
|
|
166
|
+
rack (>= 3)
|
|
167
|
+
rails (8.1.2)
|
|
168
|
+
actioncable (= 8.1.2)
|
|
169
|
+
actionmailbox (= 8.1.2)
|
|
170
|
+
actionmailer (= 8.1.2)
|
|
171
|
+
actionpack (= 8.1.2)
|
|
172
|
+
actiontext (= 8.1.2)
|
|
173
|
+
actionview (= 8.1.2)
|
|
174
|
+
activejob (= 8.1.2)
|
|
175
|
+
activemodel (= 8.1.2)
|
|
176
|
+
activerecord (= 8.1.2)
|
|
177
|
+
activestorage (= 8.1.2)
|
|
178
|
+
activesupport (= 8.1.2)
|
|
179
|
+
bundler (>= 1.15.0)
|
|
180
|
+
railties (= 8.1.2)
|
|
181
|
+
rails-dom-testing (2.3.0)
|
|
182
|
+
activesupport (>= 5.0.0)
|
|
183
|
+
minitest
|
|
184
|
+
nokogiri (>= 1.6)
|
|
185
|
+
rails-html-sanitizer (1.7.0)
|
|
186
|
+
loofah (~> 2.25)
|
|
187
|
+
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
|
|
188
|
+
railties (8.1.2)
|
|
189
|
+
actionpack (= 8.1.2)
|
|
190
|
+
activesupport (= 8.1.2)
|
|
191
|
+
irb (~> 1.13)
|
|
192
|
+
rackup (>= 1.0.0)
|
|
193
|
+
rake (>= 12.2)
|
|
194
|
+
thor (~> 1.0, >= 1.2.2)
|
|
195
|
+
tsort (>= 0.2)
|
|
196
|
+
zeitwerk (~> 2.6)
|
|
197
|
+
rake (13.3.1)
|
|
198
|
+
rdoc (7.2.0)
|
|
199
|
+
erb
|
|
200
|
+
psych (>= 4.0.0)
|
|
201
|
+
tsort
|
|
202
|
+
reline (0.6.3)
|
|
203
|
+
io-console (~> 0.5)
|
|
204
|
+
rspec (3.13.2)
|
|
205
|
+
rspec-core (~> 3.13.0)
|
|
206
|
+
rspec-expectations (~> 3.13.0)
|
|
207
|
+
rspec-mocks (~> 3.13.0)
|
|
208
|
+
rspec-core (3.13.6)
|
|
209
|
+
rspec-support (~> 3.13.0)
|
|
210
|
+
rspec-expectations (3.13.5)
|
|
211
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
212
|
+
rspec-support (~> 3.13.0)
|
|
213
|
+
rspec-mocks (3.13.8)
|
|
214
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
215
|
+
rspec-support (~> 3.13.0)
|
|
216
|
+
rspec-rails (8.0.3)
|
|
217
|
+
actionpack (>= 7.2)
|
|
218
|
+
activesupport (>= 7.2)
|
|
219
|
+
railties (>= 7.2)
|
|
220
|
+
rspec-core (~> 3.13)
|
|
221
|
+
rspec-expectations (~> 3.13)
|
|
222
|
+
rspec-mocks (~> 3.13)
|
|
223
|
+
rspec-support (~> 3.13)
|
|
224
|
+
rspec-support (3.13.7)
|
|
225
|
+
securerandom (0.4.1)
|
|
226
|
+
sqlite3 (2.9.1-aarch64-linux-gnu)
|
|
227
|
+
sqlite3 (2.9.1-aarch64-linux-musl)
|
|
228
|
+
sqlite3 (2.9.1-arm-linux-gnu)
|
|
229
|
+
sqlite3 (2.9.1-arm-linux-musl)
|
|
230
|
+
sqlite3 (2.9.1-arm64-darwin)
|
|
231
|
+
sqlite3 (2.9.1-x86_64-darwin)
|
|
232
|
+
sqlite3 (2.9.1-x86_64-linux-gnu)
|
|
233
|
+
sqlite3 (2.9.1-x86_64-linux-musl)
|
|
234
|
+
stringio (3.2.0)
|
|
235
|
+
thor (1.5.0)
|
|
236
|
+
timeout (0.6.0)
|
|
237
|
+
tsort (0.2.0)
|
|
238
|
+
tzinfo (2.0.6)
|
|
239
|
+
concurrent-ruby (~> 1.0)
|
|
240
|
+
uri (1.1.1)
|
|
241
|
+
useragent (0.16.11)
|
|
242
|
+
websocket-driver (0.8.0)
|
|
243
|
+
base64
|
|
244
|
+
websocket-extensions (>= 0.1.0)
|
|
245
|
+
websocket-extensions (0.1.5)
|
|
246
|
+
zeitwerk (2.7.5)
|
|
247
|
+
|
|
248
|
+
PLATFORMS
|
|
249
|
+
aarch64-linux-gnu
|
|
250
|
+
aarch64-linux-musl
|
|
251
|
+
arm-linux-gnu
|
|
252
|
+
arm-linux-musl
|
|
253
|
+
arm64-darwin
|
|
254
|
+
x86_64-darwin
|
|
255
|
+
x86_64-linux-gnu
|
|
256
|
+
x86_64-linux-musl
|
|
257
|
+
|
|
258
|
+
DEPENDENCIES
|
|
259
|
+
active_storage-async_variants!
|
|
260
|
+
appraisal
|
|
261
|
+
irb
|
|
262
|
+
rails (~> 8.1.0)
|
|
263
|
+
rake (~> 13.0)
|
|
264
|
+
rspec (~> 3.0)
|
|
265
|
+
rspec-rails
|
|
266
|
+
sqlite3
|
|
267
|
+
|
|
268
|
+
BUNDLED WITH
|
|
269
|
+
2.6.2
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module ActiveStorage
|
|
4
|
+
module AsyncVariants
|
|
5
|
+
module AttachmentExtension
|
|
6
|
+
private
|
|
7
|
+
|
|
8
|
+
def transform_variants_later
|
|
9
|
+
super
|
|
10
|
+
enqueue_async_variant_jobs
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def enqueue_async_variant_jobs
|
|
14
|
+
named_variants.each do |name, named_variant|
|
|
15
|
+
next unless named_variant.transformations.key?(:fallback)
|
|
16
|
+
|
|
17
|
+
ActiveStorage::AsyncVariants::ProcessJob.perform_later(
|
|
18
|
+
record, self.name, name.to_s,
|
|
19
|
+
)
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module ActiveStorage
|
|
4
|
+
module AsyncVariants
|
|
5
|
+
class ProcessJob < ActiveJob::Base
|
|
6
|
+
def perform(record, attachment_name, variant_name)
|
|
7
|
+
attachment = record.public_send(attachment_name)
|
|
8
|
+
@variant = attachment.variant(variant_name.to_sym)
|
|
9
|
+
variation = @variant.variation
|
|
10
|
+
@async_options = variation.async_options
|
|
11
|
+
transformer_class = @async_options[:transformer]
|
|
12
|
+
blob = @variant.blob
|
|
13
|
+
|
|
14
|
+
@variant_record = blob.variant_records.create_or_find_by!(variation_digest: variation.digest)
|
|
15
|
+
@variant_record.update!(state: "processing")
|
|
16
|
+
|
|
17
|
+
if transformer_class
|
|
18
|
+
transformer = transformer_class.new
|
|
19
|
+
if transformer.inline?
|
|
20
|
+
process_inline(blob, @variant_record, transformer, variation)
|
|
21
|
+
else
|
|
22
|
+
process_external(blob, @variant_record, transformer, variation)
|
|
23
|
+
end
|
|
24
|
+
else
|
|
25
|
+
process_default(blob, @variant_record, variation)
|
|
26
|
+
end
|
|
27
|
+
rescue => e
|
|
28
|
+
@variant_record&.update!(
|
|
29
|
+
state: "failed",
|
|
30
|
+
error: e.message,
|
|
31
|
+
attempts: (@variant_record&.attempts || 0) + 1,
|
|
32
|
+
)
|
|
33
|
+
max_retries = @async_options&.fetch(:max_retries, 3) || 3
|
|
34
|
+
if @variant_record.nil? || @variant_record.attempts < max_retries
|
|
35
|
+
raise
|
|
36
|
+
else
|
|
37
|
+
logger.error "AsyncVariants: permanently failed after #{@variant_record.attempts} attempts: #{e.message}"
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
private
|
|
42
|
+
|
|
43
|
+
def process_inline(blob, variant_record, transformer, variation)
|
|
44
|
+
options = variation.transformations
|
|
45
|
+
|
|
46
|
+
blob.open do |file|
|
|
47
|
+
result = transformer.process(file, **options)
|
|
48
|
+
variant_record.image.attach(
|
|
49
|
+
io: result[:io],
|
|
50
|
+
filename: result[:filename],
|
|
51
|
+
content_type: result[:content_type],
|
|
52
|
+
service_name: blob.service.name,
|
|
53
|
+
)
|
|
54
|
+
variant_record.update!(state: "processed")
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
def process_default(blob, variant_record, variation)
|
|
59
|
+
blob.open do |input|
|
|
60
|
+
variation.transform(input) do |output|
|
|
61
|
+
variant_record.image.attach(
|
|
62
|
+
io: output,
|
|
63
|
+
filename: "#{blob.filename.base}.#{variation.format.downcase}",
|
|
64
|
+
content_type: variation.content_type,
|
|
65
|
+
service_name: blob.service.name,
|
|
66
|
+
)
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
variant_record.update!(state: "processed")
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
def process_external(blob, variant_record, transformer, variation)
|
|
73
|
+
options = variation.transformations
|
|
74
|
+
callback_url = ActiveStorage::AsyncVariants.callback_url_for(variant_record)
|
|
75
|
+
source_url = blob.url
|
|
76
|
+
|
|
77
|
+
transformer.initiate(
|
|
78
|
+
source_url: source_url,
|
|
79
|
+
callback_url: callback_url,
|
|
80
|
+
variant_record_id: variant_record.id,
|
|
81
|
+
**options,
|
|
82
|
+
)
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module ActiveStorage
|
|
4
|
+
module AsyncVariants
|
|
5
|
+
class Transformer
|
|
6
|
+
def process(file, **options)
|
|
7
|
+
raise NotImplementedError, "#{self.class}#process must return { io:, content_type:, filename: }"
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def initiate(source_url:, callback_url:, **options)
|
|
11
|
+
raise NotImplementedError, "#{self.class}#initiate must kick off external processing"
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def inline?
|
|
15
|
+
self.class.instance_method(:process).owner != ActiveStorage::AsyncVariants::Transformer
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|