active_storage-cloud_transformations 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Appraisals +8 -0
- data/Gemfile +7 -6
- data/active_storage-cloud_transformations.gemspec +1 -1
- data/gemfiles/.bundle/config +2 -0
- data/gemfiles/rails_6.1.gemfile +14 -0
- data/gemfiles/rails_6.1.gemfile.lock +196 -0
- data/gemfiles/rails_7.0.gemfile +14 -0
- data/gemfiles/rails_7.0.gemfile.lock +185 -0
- data/lib/active_storage/cloud_transformations/preview.rb +2 -0
- data/lib/active_storage/cloud_transformations/variant.rb +14 -5
- data/lib/active_storage/cloud_transformations/version.rb +1 -1
- metadata +11 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 999b6700b389e34575d1589e17f93ca717da60b51c19fc2109bc7bbe939dc9d6
|
4
|
+
data.tar.gz: 1c821ba3db38c88da94bc2d8bc2de496a7b27165caeaa2f0694d1b5a91d37342
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10b5275b5f20dcad3801f1938359429198aaf856b4a785272cf9534cc03375e4fd23d400481c44278b82182dcc71eaf5600dea1e0ce5d84c1514e6b3cc06fa9c
|
7
|
+
data.tar.gz: 03a3475f998bde0c4942473d4e24c23c9ba92e092c8fd166dbfa8f08dcce75891019faad5a4efaa7e0a8f9061a1adc2999bda121eb6ffecc80ef876c247b708a
|
data/Appraisals
ADDED
data/Gemfile
CHANGED
@@ -3,11 +3,12 @@ source "https://rubygems.org"
|
|
3
3
|
# Specify your gem's dependencies in active_storage-cloud_transformations.gemspec
|
4
4
|
gemspec
|
5
5
|
|
6
|
-
gem "rake"
|
6
|
+
gem "rake"
|
7
7
|
gem "rspec", "~> 3.0"
|
8
|
-
gem "
|
9
|
-
gem
|
10
|
-
gem
|
11
|
-
gem
|
12
|
-
gem
|
8
|
+
gem "sqlite3", "~> 1.4"
|
9
|
+
gem "bootsnap", require: false
|
10
|
+
gem "rails"
|
11
|
+
gem "byebug"
|
12
|
+
gem "aws-sdk-s3"
|
13
|
+
gem "appraisal"
|
13
14
|
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# This file was generated by Appraisal
|
2
|
+
|
3
|
+
source "https://rubygems.org"
|
4
|
+
|
5
|
+
gem "rake"
|
6
|
+
gem "rspec", "~> 3.0"
|
7
|
+
gem "sqlite3", "~> 1.4"
|
8
|
+
gem "bootsnap", require: false
|
9
|
+
gem "rails", "6.1"
|
10
|
+
gem "byebug"
|
11
|
+
gem "aws-sdk-s3"
|
12
|
+
gem "appraisal"
|
13
|
+
|
14
|
+
gemspec path: "../"
|
@@ -0,0 +1,196 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ..
|
3
|
+
specs:
|
4
|
+
active_storage-cloud_transformations (0.2.0)
|
5
|
+
activestorage (>= 6.1)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
actioncable (6.1.0)
|
11
|
+
actionpack (= 6.1.0)
|
12
|
+
activesupport (= 6.1.0)
|
13
|
+
nio4r (~> 2.0)
|
14
|
+
websocket-driver (>= 0.6.1)
|
15
|
+
actionmailbox (6.1.0)
|
16
|
+
actionpack (= 6.1.0)
|
17
|
+
activejob (= 6.1.0)
|
18
|
+
activerecord (= 6.1.0)
|
19
|
+
activestorage (= 6.1.0)
|
20
|
+
activesupport (= 6.1.0)
|
21
|
+
mail (>= 2.7.1)
|
22
|
+
actionmailer (6.1.0)
|
23
|
+
actionpack (= 6.1.0)
|
24
|
+
actionview (= 6.1.0)
|
25
|
+
activejob (= 6.1.0)
|
26
|
+
activesupport (= 6.1.0)
|
27
|
+
mail (~> 2.5, >= 2.5.4)
|
28
|
+
rails-dom-testing (~> 2.0)
|
29
|
+
actionpack (6.1.0)
|
30
|
+
actionview (= 6.1.0)
|
31
|
+
activesupport (= 6.1.0)
|
32
|
+
rack (~> 2.0, >= 2.0.9)
|
33
|
+
rack-test (>= 0.6.3)
|
34
|
+
rails-dom-testing (~> 2.0)
|
35
|
+
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
36
|
+
actiontext (6.1.0)
|
37
|
+
actionpack (= 6.1.0)
|
38
|
+
activerecord (= 6.1.0)
|
39
|
+
activestorage (= 6.1.0)
|
40
|
+
activesupport (= 6.1.0)
|
41
|
+
nokogiri (>= 1.8.5)
|
42
|
+
actionview (6.1.0)
|
43
|
+
activesupport (= 6.1.0)
|
44
|
+
builder (~> 3.1)
|
45
|
+
erubi (~> 1.4)
|
46
|
+
rails-dom-testing (~> 2.0)
|
47
|
+
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
48
|
+
activejob (6.1.0)
|
49
|
+
activesupport (= 6.1.0)
|
50
|
+
globalid (>= 0.3.6)
|
51
|
+
activemodel (6.1.0)
|
52
|
+
activesupport (= 6.1.0)
|
53
|
+
activerecord (6.1.0)
|
54
|
+
activemodel (= 6.1.0)
|
55
|
+
activesupport (= 6.1.0)
|
56
|
+
activestorage (6.1.0)
|
57
|
+
actionpack (= 6.1.0)
|
58
|
+
activejob (= 6.1.0)
|
59
|
+
activerecord (= 6.1.0)
|
60
|
+
activesupport (= 6.1.0)
|
61
|
+
marcel (~> 0.3.1)
|
62
|
+
mimemagic (~> 0.3.2)
|
63
|
+
activesupport (6.1.0)
|
64
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
65
|
+
i18n (>= 1.6, < 2)
|
66
|
+
minitest (>= 5.1)
|
67
|
+
tzinfo (~> 2.0)
|
68
|
+
zeitwerk (~> 2.3)
|
69
|
+
appraisal (2.4.1)
|
70
|
+
bundler
|
71
|
+
rake
|
72
|
+
thor (>= 0.14.0)
|
73
|
+
aws-eventstream (1.2.0)
|
74
|
+
aws-partitions (1.595.0)
|
75
|
+
aws-sdk-core (3.131.1)
|
76
|
+
aws-eventstream (~> 1, >= 1.0.2)
|
77
|
+
aws-partitions (~> 1, >= 1.525.0)
|
78
|
+
aws-sigv4 (~> 1.1)
|
79
|
+
jmespath (~> 1, >= 1.6.1)
|
80
|
+
aws-sdk-kms (1.57.0)
|
81
|
+
aws-sdk-core (~> 3, >= 3.127.0)
|
82
|
+
aws-sigv4 (~> 1.1)
|
83
|
+
aws-sdk-s3 (1.114.0)
|
84
|
+
aws-sdk-core (~> 3, >= 3.127.0)
|
85
|
+
aws-sdk-kms (~> 1)
|
86
|
+
aws-sigv4 (~> 1.4)
|
87
|
+
aws-sigv4 (1.5.0)
|
88
|
+
aws-eventstream (~> 1, >= 1.0.2)
|
89
|
+
bootsnap (1.12.0)
|
90
|
+
msgpack (~> 1.2)
|
91
|
+
builder (3.2.4)
|
92
|
+
byebug (11.1.3)
|
93
|
+
concurrent-ruby (1.1.10)
|
94
|
+
crass (1.0.6)
|
95
|
+
diff-lcs (1.5.0)
|
96
|
+
erubi (1.10.0)
|
97
|
+
globalid (1.0.0)
|
98
|
+
activesupport (>= 5.0)
|
99
|
+
i18n (1.10.0)
|
100
|
+
concurrent-ruby (~> 1.0)
|
101
|
+
jmespath (1.6.1)
|
102
|
+
loofah (2.18.0)
|
103
|
+
crass (~> 1.0.2)
|
104
|
+
nokogiri (>= 1.5.9)
|
105
|
+
mail (2.7.1)
|
106
|
+
mini_mime (>= 0.1.1)
|
107
|
+
marcel (0.3.3)
|
108
|
+
mimemagic (~> 0.3.2)
|
109
|
+
method_source (1.0.0)
|
110
|
+
mimemagic (0.3.10)
|
111
|
+
nokogiri (~> 1)
|
112
|
+
rake
|
113
|
+
mini_mime (1.1.2)
|
114
|
+
mini_portile2 (2.8.0)
|
115
|
+
minitest (5.15.0)
|
116
|
+
msgpack (1.5.2)
|
117
|
+
nio4r (2.5.8)
|
118
|
+
nokogiri (1.13.6)
|
119
|
+
mini_portile2 (~> 2.8.0)
|
120
|
+
racc (~> 1.4)
|
121
|
+
racc (1.6.0)
|
122
|
+
rack (2.2.3.1)
|
123
|
+
rack-test (1.1.0)
|
124
|
+
rack (>= 1.0, < 3)
|
125
|
+
rails (6.1.0)
|
126
|
+
actioncable (= 6.1.0)
|
127
|
+
actionmailbox (= 6.1.0)
|
128
|
+
actionmailer (= 6.1.0)
|
129
|
+
actionpack (= 6.1.0)
|
130
|
+
actiontext (= 6.1.0)
|
131
|
+
actionview (= 6.1.0)
|
132
|
+
activejob (= 6.1.0)
|
133
|
+
activemodel (= 6.1.0)
|
134
|
+
activerecord (= 6.1.0)
|
135
|
+
activestorage (= 6.1.0)
|
136
|
+
activesupport (= 6.1.0)
|
137
|
+
bundler (>= 1.15.0)
|
138
|
+
railties (= 6.1.0)
|
139
|
+
sprockets-rails (>= 2.0.0)
|
140
|
+
rails-dom-testing (2.0.3)
|
141
|
+
activesupport (>= 4.2.0)
|
142
|
+
nokogiri (>= 1.6)
|
143
|
+
rails-html-sanitizer (1.4.2)
|
144
|
+
loofah (~> 2.3)
|
145
|
+
railties (6.1.0)
|
146
|
+
actionpack (= 6.1.0)
|
147
|
+
activesupport (= 6.1.0)
|
148
|
+
method_source
|
149
|
+
rake (>= 0.8.7)
|
150
|
+
thor (~> 1.0)
|
151
|
+
rake (12.3.3)
|
152
|
+
rspec (3.11.0)
|
153
|
+
rspec-core (~> 3.11.0)
|
154
|
+
rspec-expectations (~> 3.11.0)
|
155
|
+
rspec-mocks (~> 3.11.0)
|
156
|
+
rspec-core (3.11.0)
|
157
|
+
rspec-support (~> 3.11.0)
|
158
|
+
rspec-expectations (3.11.0)
|
159
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
160
|
+
rspec-support (~> 3.11.0)
|
161
|
+
rspec-mocks (3.11.1)
|
162
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
163
|
+
rspec-support (~> 3.11.0)
|
164
|
+
rspec-support (3.11.0)
|
165
|
+
sprockets (4.0.3)
|
166
|
+
concurrent-ruby (~> 1.0)
|
167
|
+
rack (> 1, < 3)
|
168
|
+
sprockets-rails (3.4.2)
|
169
|
+
actionpack (>= 5.2)
|
170
|
+
activesupport (>= 5.2)
|
171
|
+
sprockets (>= 3.0.0)
|
172
|
+
sqlite3 (1.4.2)
|
173
|
+
thor (1.2.1)
|
174
|
+
tzinfo (2.0.4)
|
175
|
+
concurrent-ruby (~> 1.0)
|
176
|
+
websocket-driver (0.7.5)
|
177
|
+
websocket-extensions (>= 0.1.0)
|
178
|
+
websocket-extensions (0.1.5)
|
179
|
+
zeitwerk (2.5.4)
|
180
|
+
|
181
|
+
PLATFORMS
|
182
|
+
ruby
|
183
|
+
|
184
|
+
DEPENDENCIES
|
185
|
+
active_storage-cloud_transformations!
|
186
|
+
appraisal
|
187
|
+
aws-sdk-s3
|
188
|
+
bootsnap
|
189
|
+
byebug
|
190
|
+
rails (= 6.1)
|
191
|
+
rake
|
192
|
+
rspec (~> 3.0)
|
193
|
+
sqlite3 (~> 1.4)
|
194
|
+
|
195
|
+
BUNDLED WITH
|
196
|
+
2.1.4
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# This file was generated by Appraisal
|
2
|
+
|
3
|
+
source "https://rubygems.org"
|
4
|
+
|
5
|
+
gem "rake"
|
6
|
+
gem "rspec", "~> 3.0"
|
7
|
+
gem "sqlite3", "~> 1.4"
|
8
|
+
gem "bootsnap", require: false
|
9
|
+
gem "rails", "7.0"
|
10
|
+
gem "byebug"
|
11
|
+
gem "aws-sdk-s3"
|
12
|
+
gem "appraisal"
|
13
|
+
|
14
|
+
gemspec path: "../"
|
@@ -0,0 +1,185 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ..
|
3
|
+
specs:
|
4
|
+
active_storage-cloud_transformations (0.2.0)
|
5
|
+
activestorage (>= 6.1)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
actioncable (7.0.0)
|
11
|
+
actionpack (= 7.0.0)
|
12
|
+
activesupport (= 7.0.0)
|
13
|
+
nio4r (~> 2.0)
|
14
|
+
websocket-driver (>= 0.6.1)
|
15
|
+
actionmailbox (7.0.0)
|
16
|
+
actionpack (= 7.0.0)
|
17
|
+
activejob (= 7.0.0)
|
18
|
+
activerecord (= 7.0.0)
|
19
|
+
activestorage (= 7.0.0)
|
20
|
+
activesupport (= 7.0.0)
|
21
|
+
mail (>= 2.7.1)
|
22
|
+
actionmailer (7.0.0)
|
23
|
+
actionpack (= 7.0.0)
|
24
|
+
actionview (= 7.0.0)
|
25
|
+
activejob (= 7.0.0)
|
26
|
+
activesupport (= 7.0.0)
|
27
|
+
mail (~> 2.5, >= 2.5.4)
|
28
|
+
rails-dom-testing (~> 2.0)
|
29
|
+
actionpack (7.0.0)
|
30
|
+
actionview (= 7.0.0)
|
31
|
+
activesupport (= 7.0.0)
|
32
|
+
rack (~> 2.0, >= 2.2.0)
|
33
|
+
rack-test (>= 0.6.3)
|
34
|
+
rails-dom-testing (~> 2.0)
|
35
|
+
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
36
|
+
actiontext (7.0.0)
|
37
|
+
actionpack (= 7.0.0)
|
38
|
+
activerecord (= 7.0.0)
|
39
|
+
activestorage (= 7.0.0)
|
40
|
+
activesupport (= 7.0.0)
|
41
|
+
globalid (>= 0.6.0)
|
42
|
+
nokogiri (>= 1.8.5)
|
43
|
+
actionview (7.0.0)
|
44
|
+
activesupport (= 7.0.0)
|
45
|
+
builder (~> 3.1)
|
46
|
+
erubi (~> 1.4)
|
47
|
+
rails-dom-testing (~> 2.0)
|
48
|
+
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
49
|
+
activejob (7.0.0)
|
50
|
+
activesupport (= 7.0.0)
|
51
|
+
globalid (>= 0.3.6)
|
52
|
+
activemodel (7.0.0)
|
53
|
+
activesupport (= 7.0.0)
|
54
|
+
activerecord (7.0.0)
|
55
|
+
activemodel (= 7.0.0)
|
56
|
+
activesupport (= 7.0.0)
|
57
|
+
activestorage (7.0.0)
|
58
|
+
actionpack (= 7.0.0)
|
59
|
+
activejob (= 7.0.0)
|
60
|
+
activerecord (= 7.0.0)
|
61
|
+
activesupport (= 7.0.0)
|
62
|
+
marcel (~> 1.0)
|
63
|
+
mini_mime (>= 1.1.0)
|
64
|
+
activesupport (7.0.0)
|
65
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
66
|
+
i18n (>= 1.6, < 2)
|
67
|
+
minitest (>= 5.1)
|
68
|
+
tzinfo (~> 2.0)
|
69
|
+
appraisal (2.4.1)
|
70
|
+
bundler
|
71
|
+
rake
|
72
|
+
thor (>= 0.14.0)
|
73
|
+
aws-eventstream (1.2.0)
|
74
|
+
aws-partitions (1.595.0)
|
75
|
+
aws-sdk-core (3.131.1)
|
76
|
+
aws-eventstream (~> 1, >= 1.0.2)
|
77
|
+
aws-partitions (~> 1, >= 1.525.0)
|
78
|
+
aws-sigv4 (~> 1.1)
|
79
|
+
jmespath (~> 1, >= 1.6.1)
|
80
|
+
aws-sdk-kms (1.57.0)
|
81
|
+
aws-sdk-core (~> 3, >= 3.127.0)
|
82
|
+
aws-sigv4 (~> 1.1)
|
83
|
+
aws-sdk-s3 (1.114.0)
|
84
|
+
aws-sdk-core (~> 3, >= 3.127.0)
|
85
|
+
aws-sdk-kms (~> 1)
|
86
|
+
aws-sigv4 (~> 1.4)
|
87
|
+
aws-sigv4 (1.5.0)
|
88
|
+
aws-eventstream (~> 1, >= 1.0.2)
|
89
|
+
bootsnap (1.12.0)
|
90
|
+
msgpack (~> 1.2)
|
91
|
+
builder (3.2.4)
|
92
|
+
byebug (11.1.3)
|
93
|
+
concurrent-ruby (1.1.10)
|
94
|
+
crass (1.0.6)
|
95
|
+
diff-lcs (1.5.0)
|
96
|
+
erubi (1.10.0)
|
97
|
+
globalid (1.0.0)
|
98
|
+
activesupport (>= 5.0)
|
99
|
+
i18n (1.10.0)
|
100
|
+
concurrent-ruby (~> 1.0)
|
101
|
+
jmespath (1.6.1)
|
102
|
+
loofah (2.18.0)
|
103
|
+
crass (~> 1.0.2)
|
104
|
+
nokogiri (>= 1.5.9)
|
105
|
+
mail (2.7.1)
|
106
|
+
mini_mime (>= 0.1.1)
|
107
|
+
marcel (1.0.2)
|
108
|
+
method_source (1.0.0)
|
109
|
+
mini_mime (1.1.2)
|
110
|
+
mini_portile2 (2.8.0)
|
111
|
+
minitest (5.15.0)
|
112
|
+
msgpack (1.5.2)
|
113
|
+
nio4r (2.5.8)
|
114
|
+
nokogiri (1.13.6)
|
115
|
+
mini_portile2 (~> 2.8.0)
|
116
|
+
racc (~> 1.4)
|
117
|
+
racc (1.6.0)
|
118
|
+
rack (2.2.3.1)
|
119
|
+
rack-test (1.1.0)
|
120
|
+
rack (>= 1.0, < 3)
|
121
|
+
rails (7.0.0)
|
122
|
+
actioncable (= 7.0.0)
|
123
|
+
actionmailbox (= 7.0.0)
|
124
|
+
actionmailer (= 7.0.0)
|
125
|
+
actionpack (= 7.0.0)
|
126
|
+
actiontext (= 7.0.0)
|
127
|
+
actionview (= 7.0.0)
|
128
|
+
activejob (= 7.0.0)
|
129
|
+
activemodel (= 7.0.0)
|
130
|
+
activerecord (= 7.0.0)
|
131
|
+
activestorage (= 7.0.0)
|
132
|
+
activesupport (= 7.0.0)
|
133
|
+
bundler (>= 1.15.0)
|
134
|
+
railties (= 7.0.0)
|
135
|
+
rails-dom-testing (2.0.3)
|
136
|
+
activesupport (>= 4.2.0)
|
137
|
+
nokogiri (>= 1.6)
|
138
|
+
rails-html-sanitizer (1.4.2)
|
139
|
+
loofah (~> 2.3)
|
140
|
+
railties (7.0.0)
|
141
|
+
actionpack (= 7.0.0)
|
142
|
+
activesupport (= 7.0.0)
|
143
|
+
method_source
|
144
|
+
rake (>= 12.2)
|
145
|
+
thor (~> 1.0)
|
146
|
+
zeitwerk (~> 2.5)
|
147
|
+
rake (13.0.6)
|
148
|
+
rspec (3.11.0)
|
149
|
+
rspec-core (~> 3.11.0)
|
150
|
+
rspec-expectations (~> 3.11.0)
|
151
|
+
rspec-mocks (~> 3.11.0)
|
152
|
+
rspec-core (3.11.0)
|
153
|
+
rspec-support (~> 3.11.0)
|
154
|
+
rspec-expectations (3.11.0)
|
155
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
156
|
+
rspec-support (~> 3.11.0)
|
157
|
+
rspec-mocks (3.11.1)
|
158
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
159
|
+
rspec-support (~> 3.11.0)
|
160
|
+
rspec-support (3.11.0)
|
161
|
+
sqlite3 (1.4.2)
|
162
|
+
thor (1.2.1)
|
163
|
+
tzinfo (2.0.4)
|
164
|
+
concurrent-ruby (~> 1.0)
|
165
|
+
websocket-driver (0.7.5)
|
166
|
+
websocket-extensions (>= 0.1.0)
|
167
|
+
websocket-extensions (0.1.5)
|
168
|
+
zeitwerk (2.5.4)
|
169
|
+
|
170
|
+
PLATFORMS
|
171
|
+
ruby
|
172
|
+
|
173
|
+
DEPENDENCIES
|
174
|
+
active_storage-cloud_transformations!
|
175
|
+
appraisal
|
176
|
+
aws-sdk-s3
|
177
|
+
bootsnap
|
178
|
+
byebug
|
179
|
+
rails (= 7.0)
|
180
|
+
rake
|
181
|
+
rspec (~> 3.0)
|
182
|
+
sqlite3 (~> 1.4)
|
183
|
+
|
184
|
+
BUNDLED WITH
|
185
|
+
2.1.4
|
@@ -43,9 +43,11 @@ module ActiveStorage
|
|
43
43
|
variant_record.image.attach(variant_blob)
|
44
44
|
|
45
45
|
width, height = variation.transformations.fetch(:resize_to_limit)
|
46
|
+
rotation = variation.transformations.fetch(:rotation, 0)
|
46
47
|
post! "https://huuabwxpqf.execute-api.us-west-2.amazonaws.com/prod/video/preview", {
|
47
48
|
blob_url: blob.url.split("?").first,
|
48
49
|
dimensions: "#{width}x#{height}",
|
50
|
+
rotation: rotation,
|
49
51
|
preview_image_url: preview_image_blob.url.split("?").first,
|
50
52
|
preview_image_variant_url: variant_blob.url.split("?").first,
|
51
53
|
}
|
@@ -17,22 +17,31 @@ module ActiveStorage
|
|
17
17
|
checksum: 0, # we don"t know this yet, can we get it from the results?
|
18
18
|
})
|
19
19
|
record.image.attach(output_blob)
|
20
|
-
run_crucible_job(blob, output_blob)
|
20
|
+
run_crucible_job(blob, output_blob, ignore_timeouts: true)
|
21
21
|
end
|
22
22
|
end
|
23
23
|
rescue ActiveRecord::RecordNotUnique
|
24
24
|
retry
|
25
25
|
end
|
26
26
|
|
27
|
+
def reprocess
|
28
|
+
raise ActiveStorage::InvariableError unless blob.image? || blob.video?
|
29
|
+
record = blob.variant_records.find_by!(variation_digest: variation.digest)
|
30
|
+
output_blob = record.image.blob
|
31
|
+
run_crucible_job(blob, output_blob, ignore_timeouts: true)
|
32
|
+
end
|
33
|
+
|
27
34
|
private
|
28
35
|
|
29
|
-
def run_crucible_job input_blob, output_blob
|
36
|
+
def run_crucible_job input_blob, output_blob, ignore_timeouts: false
|
30
37
|
width, height = variation.transformations.fetch(:resize_to_limit)
|
38
|
+
rotation = variation.transformations.fetch(:rotation, 0)
|
31
39
|
post! "https://huuabwxpqf.execute-api.us-west-2.amazonaws.com/prod/#{path}", {
|
32
40
|
blob_url: input_blob.url.split("?").first,
|
33
41
|
dimensions: "#{width}x#{height}",
|
42
|
+
rotation: rotation,
|
34
43
|
variant_url: output_blob.url.split("?").first,
|
35
|
-
}
|
44
|
+
}, ignore_timeouts: ignore_timeouts
|
36
45
|
end
|
37
46
|
|
38
47
|
def path
|
@@ -44,14 +53,14 @@ module ActiveStorage
|
|
44
53
|
variation.transformations.fetch(:format)
|
45
54
|
end
|
46
55
|
|
47
|
-
def post! url, body
|
56
|
+
def post! url, body, ignore_timeouts: false
|
48
57
|
uri = URI.parse(url)
|
49
58
|
http = Net::HTTP.new(uri.host, uri.port)
|
50
59
|
http.use_ssl = uri.scheme == "https"
|
51
60
|
request = Net::HTTP::Post.new(uri.request_uri, {"Content-Type": "application/json"})
|
52
61
|
request.body = body.to_json
|
53
62
|
response = http.request(request)
|
54
|
-
response.code == "201" || (raise body.to_json + response.inspect)
|
63
|
+
response.code == "201" || (response.code == "504" && ignore_timeouts) || (raise body.to_json + response.inspect + response.body)
|
55
64
|
end
|
56
65
|
end
|
57
66
|
end
|
metadata
CHANGED
@@ -1,27 +1,27 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_storage-cloud_transformations
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Micah Geisel
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-06-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activestorage
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '6.1'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '6.1'
|
27
27
|
description:
|
@@ -34,6 +34,7 @@ files:
|
|
34
34
|
- ".gitignore"
|
35
35
|
- ".rspec"
|
36
36
|
- ".travis.yml"
|
37
|
+
- Appraisals
|
37
38
|
- Gemfile
|
38
39
|
- LICENSE.txt
|
39
40
|
- README.md
|
@@ -43,6 +44,11 @@ files:
|
|
43
44
|
- bin/setup
|
44
45
|
- config/initializers/active_storage-cloud_transformations.rb
|
45
46
|
- config/routes.rb
|
47
|
+
- gemfiles/.bundle/config
|
48
|
+
- gemfiles/rails_6.1.gemfile
|
49
|
+
- gemfiles/rails_6.1.gemfile.lock
|
50
|
+
- gemfiles/rails_7.0.gemfile
|
51
|
+
- gemfiles/rails_7.0.gemfile.lock
|
46
52
|
- lib/active_storage/cloud_transformations.rb
|
47
53
|
- lib/active_storage/cloud_transformations/preview.rb
|
48
54
|
- lib/active_storage/cloud_transformations/variant.rb
|
@@ -67,7 +73,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
67
73
|
- !ruby/object:Gem::Version
|
68
74
|
version: '0'
|
69
75
|
requirements: []
|
70
|
-
rubygems_version: 3.
|
76
|
+
rubygems_version: 3.1.6
|
71
77
|
signing_key:
|
72
78
|
specification_version: 4
|
73
79
|
summary: Generate ActiveStorage Variants and Previews via external cloud services,
|