carrierwave-ftp 0.2.1 → 0.2.2
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/README.md +1 -0
- data/carrerwave-ftp.gemspec +1 -1
- data/lib/carrierwave/storage/ftp.rb +3 -1
- data/lib/carrierwave/storage/ftp/version.rb +1 -1
- data/lib/carrierwave/storage/sftp.rb +1 -0
- data/spec/ftp_spec.rb +1 -1
- data/spec/sftp_spec.rb +2 -3
- data/spec/spec_helper.rb +1 -1
- metadata +7 -7
data/README.md
CHANGED
data/carrerwave-ftp.gemspec
CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
|
|
19
19
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
20
20
|
s.require_paths = ["lib"]
|
21
21
|
|
22
|
-
s.add_dependency "carrierwave", ["
|
22
|
+
s.add_dependency "carrierwave", [">= 0.6.2"]
|
23
23
|
s.add_dependency "net-sftp", ["~> 2.0.5"]
|
24
24
|
s.add_development_dependency "rspec", ["~> 2.6"]
|
25
25
|
s.add_development_dependency "rake", ["~> 0.9"]
|
@@ -69,17 +69,19 @@ module CarrierWave
|
|
69
69
|
ftp.chdir(::File.dirname "#{@uploader.ftp_folder}/#{path}")
|
70
70
|
ftp.delete(filename)
|
71
71
|
end
|
72
|
+
rescue
|
72
73
|
end
|
73
74
|
|
74
75
|
private
|
75
76
|
|
76
77
|
def file
|
77
78
|
require 'net/http'
|
78
|
-
url = URI.parse(url)
|
79
|
+
url = URI.parse(self.url)
|
79
80
|
req = Net::HTTP::Get.new(url.path)
|
80
81
|
Net::HTTP.start(url.host, url.port) do |http|
|
81
82
|
http.request(req)
|
82
83
|
end
|
84
|
+
rescue
|
83
85
|
end
|
84
86
|
|
85
87
|
def connection
|
data/spec/ftp_spec.rb
CHANGED
@@ -18,7 +18,7 @@ describe CarrierWave::Storage::FTP do
|
|
18
18
|
end
|
19
19
|
|
20
20
|
@file = CarrierWave::SanitizedFile.new(file_path('test.jpg'))
|
21
|
-
FtpUploader.stub
|
21
|
+
FtpUploader.stub(:store_path).and_return('uploads/test.jpg')
|
22
22
|
@storage = CarrierWave::Storage::FTP.new(FtpUploader)
|
23
23
|
end
|
24
24
|
|
data/spec/sftp_spec.rb
CHANGED
@@ -20,7 +20,7 @@ describe CarrierWave::Storage::SFTP do
|
|
20
20
|
end
|
21
21
|
|
22
22
|
@file = CarrierWave::SanitizedFile.new(file_path('test.jpg'))
|
23
|
-
SftpUploader.stub
|
23
|
+
SftpUploader.stub(:store_path).and_return('uploads/test.jpg')
|
24
24
|
@storage = CarrierWave::Storage::SFTP.new(SftpUploader)
|
25
25
|
end
|
26
26
|
|
@@ -82,8 +82,7 @@ describe CarrierWave::Storage::SFTP do
|
|
82
82
|
end
|
83
83
|
|
84
84
|
it "returns the size of the file" do
|
85
|
-
@sftp.should_receive(:stat!).with('/home/test_user/public_html/uploads/test.jpg')
|
86
|
-
.and_return(Struct.new(:size).new(14))
|
85
|
+
@sftp.should_receive(:stat!).with('/home/test_user/public_html/uploads/test.jpg').and_return(Struct.new(:size).new(14))
|
87
86
|
@stored.size.should == 14
|
88
87
|
end
|
89
88
|
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: carrierwave-ftp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,14 +9,14 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-10-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: carrierwave
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
|
-
- -
|
19
|
+
- - ! '>='
|
20
20
|
- !ruby/object:Gem::Version
|
21
21
|
version: 0.6.2
|
22
22
|
type: :runtime
|
@@ -24,7 +24,7 @@ dependencies:
|
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
none: false
|
26
26
|
requirements:
|
27
|
-
- -
|
27
|
+
- - ! '>='
|
28
28
|
- !ruby/object:Gem::Version
|
29
29
|
version: 0.6.2
|
30
30
|
- !ruby/object:Gem::Dependency
|
@@ -111,7 +111,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
111
111
|
version: '0'
|
112
112
|
segments:
|
113
113
|
- 0
|
114
|
-
hash:
|
114
|
+
hash: -2440812353491325884
|
115
115
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
116
116
|
none: false
|
117
117
|
requirements:
|
@@ -120,10 +120,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
120
120
|
version: '0'
|
121
121
|
segments:
|
122
122
|
- 0
|
123
|
-
hash:
|
123
|
+
hash: -2440812353491325884
|
124
124
|
requirements: []
|
125
125
|
rubyforge_project: carrierwave-ftp
|
126
|
-
rubygems_version: 1.8.
|
126
|
+
rubygems_version: 1.8.25
|
127
127
|
signing_key:
|
128
128
|
specification_version: 3
|
129
129
|
summary: FTP support for CarrierWave
|