paperclipftp 0.2.3 → 0.2.4
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.
- data/VERSION +1 -1
- data/lib/paperclipftp.rb +5 -14
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.4
|
data/lib/paperclipftp.rb
CHANGED
@@ -19,26 +19,17 @@ module Paperclip
|
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
22
|
-
#class << self; attr_accessor :ftp_conn; end
|
23
|
-
|
24
22
|
def exists?(style = default_style)
|
25
|
-
first_try = true
|
26
23
|
begin
|
27
24
|
Timeout::timeout(@timeout, FtpTimeout) do
|
28
25
|
file_size(ftp_path(style)) > 0
|
29
26
|
end
|
30
|
-
rescue FtpTimeout => e
|
31
|
-
# we are really timing out here, lets honor the contract
|
32
|
-
raise e
|
33
27
|
rescue Timeout::Error => e
|
34
|
-
#
|
35
|
-
#
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
else
|
40
|
-
raise e
|
41
|
-
end
|
28
|
+
# either a true timeout or a spurious one, solution is simple, close connection and
|
29
|
+
# re-raise exception, it is up to higher layers to retry on failure
|
30
|
+
debug "Timed out in exists?"
|
31
|
+
close_ftp_connection
|
32
|
+
raise e
|
42
33
|
end
|
43
34
|
end
|
44
35
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paperclipftp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 31
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 4
|
10
|
+
version: 0.2.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Damian Caruso
|