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 CHANGED
@@ -30,6 +30,7 @@ CarrierWave.configure do |config|
30
30
  config.ftp_passwd = "secret"
31
31
  config.ftp_folder = "/public_html/uploads"
32
32
  config.ftp_url = "http://example.com/uploads"
33
+ config.passive = false # false by default
33
34
  end
34
35
  ```
35
36
 
@@ -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", ["~> 0.6.2"]
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
@@ -1,7 +1,7 @@
1
1
  module Carrierwave
2
2
  module Storage
3
3
  class FTP
4
- VERSION = "0.2.1"
4
+ VERSION = "0.2.2"
5
5
  end
6
6
  end
7
7
  end
@@ -66,6 +66,7 @@ module CarrierWave
66
66
  connection do |sftp|
67
67
  sftp.remove!(full_path)
68
68
  end
69
+ rescue
69
70
  end
70
71
 
71
72
  private
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!(:store_path).and_return('uploads/test.jpg')
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!(:store_path).and_return('uploads/test.jpg')
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
@@ -29,7 +29,7 @@ module CarrierWave
29
29
  t = Tempfile.new(filename)
30
30
  FileUtils.copy_file(file_path(filename), t.path)
31
31
 
32
- t.stub!(:local_path => "",
32
+ t.stub(:local_path => "",
33
33
  :original_filename => filename || fake_name,
34
34
  :content_type => mime_type)
35
35
 
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.1
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: 2012-08-28 00:00:00.000000000 Z
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: 2900138492913729311
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: 2900138492913729311
123
+ hash: -2440812353491325884
124
124
  requirements: []
125
125
  rubyforge_project: carrierwave-ftp
126
- rubygems_version: 1.8.23
126
+ rubygems_version: 1.8.25
127
127
  signing_key:
128
128
  specification_version: 3
129
129
  summary: FTP support for CarrierWave