paperclip-storage-ftp 1.2.2 → 1.2.3
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 +4 -4
- data/README.md +4 -0
- data/lib/paperclip/storage/ftp/server.rb +1 -1
- data/paperclip-storage-ftp.gemspec +1 -1
- data/spec/paperclip/storage/ftp/server_spec.rb +5 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 965bee3a7fee8dede0c34063a0a209287b9fb0f2
|
4
|
+
data.tar.gz: f4bd05757450dc18aa71d08f3fbe32b2ca46017c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: daa7c2734901f9c1ecc5868aac8d6640634a2c6744becf55b5ac60b2c2a0fb855c4b6c9019c9cea3ffa57e15b978533b2826494e5840acdf5b3e26247c75a87f
|
7
|
+
data.tar.gz: 38e7d597fe488f31e53217f1572e4e594caf46c639b6799853659276ad5b75212ecab6aea8e0681f76fe5b767c62b7ef4e8048c9e2db3bac5138bb15d64be4ca
|
data/README.md
CHANGED
@@ -84,6 +84,10 @@ end
|
|
84
84
|
|
85
85
|
## Changelog
|
86
86
|
|
87
|
+
### 1.2.3
|
88
|
+
|
89
|
+
* Rescue FTPPermError exception during `file_exists?` [#22](https://github.com/xing/paperclip-storage-ftp/pull/22)
|
90
|
+
|
87
91
|
### 1.2.2
|
88
92
|
|
89
93
|
* Remove empty parent directories after image deletion [#21](https://github.com/xing/paperclip-storage-ftp/pull/21)
|
@@ -50,7 +50,7 @@ module Paperclip
|
|
50
50
|
def file_exists?(path)
|
51
51
|
pathname = Pathname.new(path)
|
52
52
|
connection.nlst(pathname.dirname.to_s).map{|f| File.basename f }.include?(pathname.basename.to_s)
|
53
|
-
rescue Net::FTPTempError
|
53
|
+
rescue Net::FTPTempError, Net::FTPPermError
|
54
54
|
false
|
55
55
|
end
|
56
56
|
|
@@ -12,7 +12,7 @@ Gem::Specification.new do |gem|
|
|
12
12
|
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
13
13
|
gem.name = "paperclip-storage-ftp"
|
14
14
|
gem.require_paths = ["lib"]
|
15
|
-
gem.version = "1.2.
|
15
|
+
gem.version = "1.2.3"
|
16
16
|
|
17
17
|
gem.add_dependency("paperclip")
|
18
18
|
|
@@ -47,6 +47,11 @@ describe Paperclip::Storage::Ftp::Server do
|
|
47
47
|
server.connection.should_receive(:nlst).with("/files/original").and_raise(Net::FTPTempError)
|
48
48
|
server.file_exists?("/files/original/foo.jpg").should be false
|
49
49
|
end
|
50
|
+
|
51
|
+
it "returns false if the ftp server responds with a FTPPermError" do
|
52
|
+
server.connection.should_receive(:nlst).with("/files/original").and_raise(Net::FTPPermError)
|
53
|
+
server.file_exists?("/files/original/foo.jpg").should be false
|
54
|
+
end
|
50
55
|
end
|
51
56
|
|
52
57
|
context "#get_file" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paperclip-storage-ftp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sebastian Röbke
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-11-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: paperclip
|