alchemy-dragonfly-s3 5.1.4 → 5.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -2
- data/lib/alchemy/dragonfly/s3/create_picture_thumb.rb +13 -3
- data/lib/alchemy/dragonfly/s3/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ec1c13a542a1b63dd195077cd647d1e1bc0bdfaeae8a4eb51b702566d5202c12
|
4
|
+
data.tar.gz: 646fe1fa7a99c9ee7cb68eb8cc1bbddbd78640624cfafb168f5fb9371239bce0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c16231755be826fc40a78542cfb864753a0403eed16feb51186d9e526c2c76dc450810a228105644a0233844fa97171e7a83d35bd52ecedcbdaf7205d639961a
|
7
|
+
data.tar.gz: 946cf698073d4940257b251f8f53eb1ef189b53c4bf91ea081ff3142360cef5ef05cbf97631a5fad8c2c51cc58a98f1048b41e3c5e6093439ddc323786181f03
|
data/README.md
CHANGED
@@ -20,12 +20,14 @@ Add this line to your application's Gemfile:
|
|
20
20
|
gem 'alchemy-dragonfly-s3', github: 'AlchemyCMS/alchemy-dragonfly-s3'
|
21
21
|
```
|
22
22
|
|
23
|
-
For now you also need
|
23
|
+
For now you also need the master branch of AlchemyCMS*
|
24
24
|
|
25
25
|
```ruby
|
26
|
-
gem 'alchemy_cms', github: '
|
26
|
+
gem 'alchemy_cms', github: 'AlchemyCMS/alchemy_cms', branch: 'master'
|
27
27
|
```
|
28
28
|
|
29
|
+
*only necessary until Alchemy 5.1 has been released.
|
30
|
+
|
29
31
|
And then execute:
|
30
32
|
|
31
33
|
```
|
@@ -5,13 +5,23 @@ module Alchemy
|
|
5
5
|
module S3
|
6
6
|
class CreatePictureThumb
|
7
7
|
def self.call(variant, signature, uid)
|
8
|
-
|
9
|
-
|
10
|
-
variant.picture.thumbs.create!(
|
8
|
+
# create the thumb before uploading
|
9
|
+
# to prevent db race conditions
|
10
|
+
thumb = variant.picture.thumbs.create!(
|
11
11
|
picture: variant.picture,
|
12
12
|
signature: signature,
|
13
13
|
uid: uid,
|
14
14
|
)
|
15
|
+
begin
|
16
|
+
# fetch and process the image
|
17
|
+
image = variant.image
|
18
|
+
# upload the processed image
|
19
|
+
image.store(path: uid)
|
20
|
+
rescue RuntimeError, Excon::Error => e
|
21
|
+
Rails.logger.warn(e)
|
22
|
+
# destroy the thumb if processing or upload fails
|
23
|
+
thumb.destroy
|
24
|
+
end
|
15
25
|
end
|
16
26
|
end
|
17
27
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alchemy-dragonfly-s3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.1.
|
4
|
+
version: 5.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thomas von Deyen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-07-
|
11
|
+
date: 2020-07-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: alchemy_cms
|