remote_files 3.0.1 → 3.2.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
- SHA1:
3
- metadata.gz: 8e89710ce59abd74c452b69ec647263e5b472d50
4
- data.tar.gz: 28cd4601b3bb6afdcb8277079f6fa468f23aaf80
2
+ SHA256:
3
+ metadata.gz: e90fdccfe48d4c170a693ef51fff589f038c2cf3afa92467c9727e9d6c9ba70f
4
+ data.tar.gz: a4058dab1a1db6b9267e20cf3d740dc8cebf1f64787df5cfe9851bd15a90216c
5
5
  SHA512:
6
- metadata.gz: 38f737514affe7ccc5f66ca0cc21b3d5c382fd98f22e192bb484783859c71652aad38cece6a9326c7bbb15291ee385d49a2404961e8d5fc090a1bdabb68028e7
7
- data.tar.gz: 64ce9ccca9c2bb494ecc05a31d890d7c129bb9cac7df0d848c9c2db3e2b416dc9aa765a3a73ab203b9920d4dd38358acc519c42fad9931aeb3c475139ad512aa
6
+ metadata.gz: b8b914ddfb7dd0b129e9f73cc09fd864cb0f27242b630fc93a3e581454ab588ce08efd1be4bb41359fa5380ed0f289ec08d98a9d7937cdb91e3f19d90eaf3374
7
+ data.tar.gz: 932b45360d8139742d8389c876628f19b89d42a8aa786a964e424a4cc8399beccdd256e420d8e27afc367ea3c5887931f458c888f6129f3c85ba9d057e45bdc3
@@ -127,6 +127,9 @@ module RemoteFiles
127
127
  def delete_now!(file)
128
128
  exceptions = []
129
129
  stores = file.read_write_stores
130
+
131
+ raise "No stores configured" if stores.empty?
132
+
130
133
  stores.each do |store|
131
134
  begin
132
135
  store.delete!(file.identifier)
@@ -48,16 +48,22 @@ module RemoteFiles
48
48
  end
49
49
 
50
50
  def delete!(identifier)
51
- connection.delete_object(directory.key, identifier)
51
+ if identifier.to_s.chomp.empty?
52
+ message = "Empty identifier is not supported"
53
+ raise RemoteFiles::Error, message
54
+ end
55
+
56
+ connection.delete_object(directory_name, identifier)
52
57
  rescue Fog::Errors::NotFound, Excon::Errors::NotFound
53
58
  raise NotFoundError, $!.message, $!.backtrace
54
59
  end
55
60
 
56
61
  def connection
57
- connection_options = options.dup
58
- connection_options.delete(:directory)
59
- connection_options.delete(:public)
60
- @connection ||= Fog::Storage.new(connection_options)
62
+ opts = options.dup
63
+ opts.delete(:directory)
64
+ opts.delete(:public)
65
+ opts[:connection_options] ||= default_connection_options
66
+ @connection ||= Fog::Storage.new(opts)
61
67
  end
62
68
 
63
69
  def directory_name
@@ -70,6 +76,13 @@ module RemoteFiles
70
76
 
71
77
  protected
72
78
 
79
+ def default_connection_options
80
+ {
81
+ retry_limit: 0,
82
+ retry_interval: 0
83
+ }
84
+ end
85
+
73
86
  def aws_host
74
87
  case options[:region]
75
88
  when nil, 'us-east-1'
@@ -1,3 +1,3 @@
1
1
  module RemoteFiles
2
- VERSION = '3.0.1'
2
+ VERSION = '3.2.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: remote_files
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.1
4
+ version: 3.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mick Staugaard
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-27 00:00:00.000000000 Z
11
+ date: 2022-03-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fog-aws
@@ -59,7 +59,7 @@ files:
59
59
  - lib/remote_files/version.rb
60
60
  homepage: https://github.com/zendesk/remote_files
61
61
  licenses:
62
- - Apache License Version 2.0
62
+ - Apache-2.0
63
63
  metadata: {}
64
64
  post_install_message:
65
65
  rdoc_options: []
@@ -76,8 +76,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
76
76
  - !ruby/object:Gem::Version
77
77
  version: '0'
78
78
  requirements: []
79
- rubyforge_project:
80
- rubygems_version: 2.4.5.1
79
+ rubygems_version: 3.0.3.1
81
80
  signing_key:
82
81
  specification_version: 4
83
82
  summary: The purpose of the library is to implement a simple interface for uploading