alchemy-dragonfly-s3 5.1.5 → 6.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ec1c13a542a1b63dd195077cd647d1e1bc0bdfaeae8a4eb51b702566d5202c12
4
- data.tar.gz: 646fe1fa7a99c9ee7cb68eb8cc1bbddbd78640624cfafb168f5fb9371239bce0
3
+ metadata.gz: 8731b036311b3a669e0644fe5fd9e0301bc981bdc431c102979961aa4db3671e
4
+ data.tar.gz: dbddcab7948012fe5d9a12a140fbc203dadac20157b039d74d82d86abb3a7390
5
5
  SHA512:
6
- metadata.gz: c16231755be826fc40a78542cfb864753a0403eed16feb51186d9e526c2c76dc450810a228105644a0233844fa97171e7a83d35bd52ecedcbdaf7205d639961a
7
- data.tar.gz: 946cf698073d4940257b251f8f53eb1ef189b53c4bf91ea081ff3142360cef5ef05cbf97631a5fad8c2c51cc58a98f1048b41e3c5e6093439ddc323786181f03
6
+ metadata.gz: b0ca6b6a588e561c9c154853d4393e67aeaa7950810347f84d04cf3b61a6e7621c6d228c977d6bd9c3df02c07014e632fabf579392d82687828136b70cef3c75
7
+ data.tar.gz: cd8f538c29407ba748d89f6a6b71960b0e9f9812b4924a19151909b42ddad41a3ab14edb43f04b09d546bba3124ce2b4f9c152112f599bcadf04320ce0f52eaa
data/CHANGELOG.md ADDED
@@ -0,0 +1,34 @@
1
+ ## v6.0.0
2
+
3
+ - Allow Alchemy 6.1
4
+ - Drop support for Alchemy 5.x
5
+
6
+ ## v5.2.0
7
+
8
+ - Fix loading of Alchemy factories
9
+ - Allow Alchemy 6
10
+ - Use config.to_prepare as hook to register classes
11
+
12
+ ## v5.1.5
13
+
14
+ - Prevent db race conditions while creating thumbs
15
+
16
+ ## v5.1.4
17
+
18
+ - Include necessary files in gem package
19
+
20
+ ## v5.1.3
21
+
22
+ - Use Alchemy 5.1.0.alpha
23
+
24
+ ## v5.1.2
25
+
26
+ - Add support for file attachments stored on S3
27
+
28
+ ## v5.1.1
29
+
30
+ - Ensure to create new thumbs on in memory picture
31
+
32
+ ## v5.1.0
33
+
34
+ - Alchemy 5.1 support
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- [![Build Status](https://travis-ci.com/AlchemyCMS/alchemy-dragonfly-s3.svg?branch=master)](https://travis-ci.com/AlchemyCMS/alchemy-dragonfly-s3)
1
+ [![Build Status](https://travis-ci.com/AlchemyCMS/alchemy-dragonfly-s3.svg?branch=main)](https://travis-ci.com/AlchemyCMS/alchemy-dragonfly-s3)
2
2
 
3
3
  # AlchemyCMS AWS S3
4
4
 
@@ -6,8 +6,9 @@ Provides classes for storing Alchemy pictures and file attachments on Amazon AWS
6
6
 
7
7
  ## Alchemy Version
8
8
 
9
- This branch works with Alchemy 5.1 only.
9
+ This branch works with Alchemy 6.0 and above.
10
10
 
11
+ - For a Alchemy 5.2/5.3 compatible version use the `5.2-stable` branch.
11
12
  - For a Alchemy 5.0 compatible version use the `alchemy-5` branch.
12
13
  - For a Alchemy 4 compatible version use the `alchemy-4` branch.
13
14
  - For a Alchemy 3 compatible version use the `alchemy-3` branch.
@@ -20,27 +21,12 @@ Add this line to your application's Gemfile:
20
21
  gem 'alchemy-dragonfly-s3', github: 'AlchemyCMS/alchemy-dragonfly-s3'
21
22
  ```
22
23
 
23
- For now you also need the master branch of AlchemyCMS*
24
-
25
- ```ruby
26
- gem 'alchemy_cms', github: 'AlchemyCMS/alchemy_cms', branch: 'master'
27
- ```
28
-
29
- *only necessary until Alchemy 5.1 has been released.
30
-
31
24
  And then execute:
32
25
 
33
26
  ```
34
27
  $ bundle install
35
28
  ```
36
29
 
37
- Install the picture thumbs migration from Alchemy 5.1
38
-
39
- ```
40
- $ bin/rake alchemy:install:migrations
41
- $ bin/rake db:migrate
42
- ```
43
-
44
30
  ## Setup
45
31
 
46
32
  Configure a S3 datastore for Dragonfly
@@ -50,23 +36,17 @@ Configure a S3 datastore for Dragonfly
50
36
 
51
37
  require "dragonfly/s3_data_store"
52
38
 
53
- Dragonfly.app(:alchemy_pictures).configure do
54
- plugin :imagemagick
55
- plugin :svg
56
-
57
- datastore :s3,
58
- bucket_name: ENV.fetch("ALCHEMY_S3_BUCKET_NAME"),
59
- access_key_id: ENV.fetch("ALCHEMY_S3_ACCESS_KEY_ID"),
60
- secret_access_key: ENV.fetch("ALCHEMY_S3_SECRET_ACCESS_KEY"),
61
- region: ENV.fetch("ALCHEMY_S3_REGION")
62
- end
63
-
64
- Dragonfly.app(:alchemy_attachments).configure do
65
- datastore :s3,
66
- bucket_name: ENV.fetch("ALCHEMY_S3_BUCKET_NAME"),
67
- access_key_id: ENV.fetch("ALCHEMY_S3_ACCESS_KEY_ID"),
68
- secret_access_key: ENV.fetch("ALCHEMY_S3_SECRET_ACCESS_KEY"),
69
- region: ENV.fetch("ALCHEMY_S3_REGION")
39
+ Rails.application.credentials.aws.tap do |aws_config|
40
+ Dragonfly.app(:alchemy_pictures).configure do
41
+ plugin :imagemagick
42
+ plugin :svg
43
+ secret: Rails.application.credentials.secret_key_base
44
+ datastore :s3, aws_config
45
+ end
46
+
47
+ Dragonfly.app(:alchemy_attachments).configure do
48
+ datastore :s3, aws_config
49
+ end
70
50
  end
71
51
  ```
72
52
 
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ $:.push File.expand_path("lib", __dir__)
4
+
5
+ require "alchemy/dragonfly/s3/version"
6
+
7
+ # Describe your gem and declare its dependencies:
8
+ Gem::Specification.new do |s|
9
+ s.name = "alchemy-dragonfly-s3"
10
+ s.version = Alchemy::Dragonfly::S3::VERSION
11
+ s.authors = ["Thomas von Deyen"]
12
+ s.email = ["thomas@vondeyen.com"]
13
+ s.homepage = "https://alchemy-cms.com"
14
+ s.summary = "AlchemyCMS Dragonfly S3."
15
+ s.description = "AlchemyCMS Integration for the Dragonfly S3 datastore."
16
+ s.license = "MIT"
17
+
18
+ s.files = Dir[
19
+ "app/**/*",
20
+ "lib/**/*",
21
+ "alchemy-dragonfly-s3.gemspec",
22
+ "CHANGELOG.md",
23
+ "MIT-LICENSE",
24
+ "README.md",
25
+ ]
26
+
27
+ s.add_dependency "alchemy_cms", [">= 6.0.0", "< 7"]
28
+ s.add_dependency "dragonfly-s3_data_store", "~> 1.3"
29
+
30
+ s.add_development_dependency "rspec-rails", "~> 4.0"
31
+ s.add_development_dependency "factory_bot_rails", "~> 6.0"
32
+ s.add_development_dependency "simplecov", "~> 0.17"
33
+ end
@@ -7,20 +7,23 @@ module Alchemy
7
7
  def self.call(variant, signature, uid)
8
8
  # create the thumb before uploading
9
9
  # to prevent db race conditions
10
- thumb = variant.picture.thumbs.create!(
11
- picture: variant.picture,
12
- signature: signature,
13
- uid: uid,
14
- )
10
+ thumb = nil
11
+ if variant.picture.valid?
12
+ thumb = Alchemy::PictureThumb.create!(
13
+ picture: variant.picture,
14
+ signature: signature,
15
+ uid: uid,
16
+ )
17
+ end
15
18
  begin
16
19
  # fetch and process the image
17
20
  image = variant.image
18
21
  # upload the processed image
19
22
  image.store(path: uid)
20
23
  rescue RuntimeError, Excon::Error => e
21
- Rails.logger.warn(e)
24
+ ErrorTracking.notification_handler.call(e)
22
25
  # destroy the thumb if processing or upload fails
23
- thumb.destroy
26
+ thumb&.destroy
24
27
  end
25
28
  end
26
29
  end
@@ -6,7 +6,7 @@ module Alchemy
6
6
  class Engine < ::Rails::Engine
7
7
  engine_name "alchemy_dragonfly_s3"
8
8
 
9
- config.after_initialize do
9
+ config.to_prepare do
10
10
  Alchemy::Attachment.url_class = Alchemy::Attachment::S3Url
11
11
  Alchemy::Picture.url_class = Alchemy::Picture::S3Url
12
12
  Alchemy::PictureThumb.generator_class = Alchemy::Dragonfly::S3::CreatePictureThumb
@@ -3,7 +3,7 @@
3
3
  module Alchemy
4
4
  module Dragonfly
5
5
  module S3
6
- VERSION = "5.1.5"
6
+ VERSION = "6.0.0"
7
7
  end
8
8
  end
9
9
  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.5
4
+ version: 6.0.0
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-21 00:00:00.000000000 Z
11
+ date: 2023-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: alchemy_cms
@@ -16,20 +16,20 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 5.1.0.alpha
19
+ version: 6.0.0
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '6'
22
+ version: '7'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: 5.1.0.alpha
29
+ version: 6.0.0
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '6'
32
+ version: '7'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: dragonfly-s3_data_store
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -93,8 +93,10 @@ executables: []
93
93
  extensions: []
94
94
  extra_rdoc_files: []
95
95
  files:
96
+ - CHANGELOG.md
96
97
  - MIT-LICENSE
97
98
  - README.md
99
+ - alchemy-dragonfly-s3.gemspec
98
100
  - app/models/alchemy/attachment/s3_url.rb
99
101
  - app/models/alchemy/picture/s3_url.rb
100
102
  - lib/alchemy-dragonfly-s3.rb
@@ -120,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
120
122
  - !ruby/object:Gem::Version
121
123
  version: '0'
122
124
  requirements: []
123
- rubygems_version: 3.0.3
125
+ rubygems_version: 3.3.26
124
126
  signing_key:
125
127
  specification_version: 4
126
128
  summary: AlchemyCMS Dragonfly S3.