fclay 1.51 → 1.54
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 +5 -5
- data/lib/fclay/attachment.rb +4 -2
- data/lib/fclay/delete_job.rb +11 -0
- data/lib/fclay/remote_storage/s3.rb +10 -6
- data/lib/fclay/version.rb +1 -1
- data/lib/fclay.rb +1 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 4bb9eeef655d9cc427327ccd22f16e3aefa41886290ce82d0b84b07e64e02e85
|
4
|
+
data.tar.gz: c5facd5f108b2037918b03a5237eac473f4347724e34bdb325f5945bce566bd9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d608dedc925519de81e69e78ecd995f75f05348ba7655a055121be030fe7108dc8d375162421b23e3c9ab4522a5eea8c1299f4cacb31cb5af79c9f79019cb6b0
|
7
|
+
data.tar.gz: 7b828c8468f71cea3405b7d033800867deb3d55d0a8ab84833d6590564664fcaacbdae75eb90f3fd7c125b32123d7137b0ecd06550ca794f9e0bb469df08e6a6
|
data/lib/fclay/attachment.rb
CHANGED
@@ -80,6 +80,8 @@ module Fclay
|
|
80
80
|
|
81
81
|
Fclay::RemoteStorage::Provider.upload(uploading_object)
|
82
82
|
|
83
|
+
# class method callback
|
84
|
+
uploading_object.class.uploaded if uploading_object.class.respond_to?(:uploaded)
|
83
85
|
end
|
84
86
|
|
85
87
|
def fclay_attachment_presence
|
@@ -154,7 +156,7 @@ module Fclay
|
|
154
156
|
end
|
155
157
|
|
156
158
|
def delete_tmp_file
|
157
|
-
FileUtils.rm(@file.try(:path) || @file[:path],
|
159
|
+
FileUtils.rm(@file.try(:path) || @file[:path], force: true) if @file
|
158
160
|
@file = nil
|
159
161
|
end
|
160
162
|
|
@@ -222,7 +224,7 @@ module Fclay
|
|
222
224
|
|
223
225
|
begin
|
224
226
|
(self.class.fclay_options[:styles].try(:keys) || [nil]).each do |style|
|
225
|
-
|
227
|
+
Fclay::DeleteJob.set(wait: 5.minutes).perform_later(local_file_path(style))
|
226
228
|
end
|
227
229
|
rescue
|
228
230
|
Rails.logger.info "Deleting Media #{id} sync file not found"
|
@@ -10,12 +10,16 @@ class Fclay::RemoteStorage::S3 < Fclay::RemoteStorage::Base
|
|
10
10
|
|
11
11
|
def upload(options = {})
|
12
12
|
(@options[:styles].try(:keys) || [nil]).each do |style|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
13
|
+
begin
|
14
|
+
obj = bucket_object(style)
|
15
|
+
obj.put({
|
16
|
+
body: File.read(uploading_object.local_file_path(style)),
|
17
|
+
acl: "public-read",
|
18
|
+
content_type: content_type
|
19
|
+
})
|
20
|
+
rescue => e
|
21
|
+
Rails.logger.debug(e.message)
|
22
|
+
end
|
19
23
|
end
|
20
24
|
|
21
25
|
super unless options[:without_update]
|
data/lib/fclay/version.rb
CHANGED
data/lib/fclay.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fclay
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '1.
|
4
|
+
version: '1.54'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rustam Galiev
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-08-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -72,6 +72,7 @@ files:
|
|
72
72
|
- lib/fclay.rb
|
73
73
|
- lib/fclay/attachment.rb
|
74
74
|
- lib/fclay/configuration.rb
|
75
|
+
- lib/fclay/delete_job.rb
|
75
76
|
- lib/fclay/includer.rb
|
76
77
|
- lib/fclay/remote_storage.rb
|
77
78
|
- lib/fclay/remote_storage/base.rb
|
@@ -102,8 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
102
103
|
- !ruby/object:Gem::Version
|
103
104
|
version: '0'
|
104
105
|
requirements: []
|
105
|
-
|
106
|
-
rubygems_version: 2.6.13
|
106
|
+
rubygems_version: 3.0.9
|
107
107
|
signing_key:
|
108
108
|
specification_version: 4
|
109
109
|
summary: Summary
|