fclay 1.51 → 1.54

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
- SHA1:
3
- metadata.gz: c86a20b5d2830154ebb94c7ffbb1cdca11e72630
4
- data.tar.gz: 54952754683ded679e8fe20e8773dff45fd35d9f
2
+ SHA256:
3
+ metadata.gz: 4bb9eeef655d9cc427327ccd22f16e3aefa41886290ce82d0b84b07e64e02e85
4
+ data.tar.gz: c5facd5f108b2037918b03a5237eac473f4347724e34bdb325f5945bce566bd9
5
5
  SHA512:
6
- metadata.gz: cb970de1b8c7179637f1b03fd0a0486249f44ec7e1677cc8e4cda58a0a513ec51031cc4d3db62c189e84587d4903f4f25d7242951eff2d7cebad925aaa617eb8
7
- data.tar.gz: b82d69e2d195843536e8fbcc33f37bd3f753bb755e002551d4c5bf7f9ef767a76d9077c233a89854169b1cbdecdafdf5b7b78129fe2f4928a866772bae2fb6ee
6
+ metadata.gz: d608dedc925519de81e69e78ecd995f75f05348ba7655a055121be030fe7108dc8d375162421b23e3c9ab4522a5eea8c1299f4cacb31cb5af79c9f79019cb6b0
7
+ data.tar.gz: 7b828c8468f71cea3405b7d033800867deb3d55d0a8ab84833d6590564664fcaacbdae75eb90f3fd7c125b32123d7137b0ecd06550ca794f9e0bb469df08e6a6
@@ -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],{:force => true}) if @file
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
- FileUtils.rm(local_file_path(style),{:force => true})
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"
@@ -0,0 +1,11 @@
1
+ module Fclay
2
+ class DeleteJob < ActiveJob::Base
3
+
4
+ queue_as :default
5
+
6
+ def perform(file)
7
+ FileUtils.rm(file, force: true)
8
+ end
9
+
10
+ end
11
+ end
@@ -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
- obj = bucket_object(style)
14
- obj.put({
15
- body: File.read(uploading_object.local_file_path(style)),
16
- acl: "public-read",
17
- content_type: content_type
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
@@ -1,3 +1,3 @@
1
1
  module Fclay
2
- VERSION = "1.51"
2
+ VERSION = "1.54"
3
3
  end
data/lib/fclay.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  require "fclay/version"
2
2
  require 'fclay/configuration'
3
3
  require 'fclay/upload_job'
4
+ require 'fclay/delete_job'
4
5
  require "fclay/attachment"
5
6
  require "fclay/includer"
6
7
  require "fclay/remote_storage"
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.51'
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: 2019-10-23 00:00:00.000000000 Z
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
- rubyforge_project:
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