carrierwave-ftp 0.2.6 → 0.2.7

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 CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- ZGVlODdmMjNmMGZmODExZGM5YzU0MTUwODgxYTU4NGQ4ZTEzNjFjZA==
5
- data.tar.gz: !binary |-
6
- ZmVhNGQ3YTM1Njg1ZTE2ZTY4ZjdjNTQyYzRmZjc5MjY5ZjM1ZTBjNQ==
2
+ SHA1:
3
+ metadata.gz: 0f370d7d496e745dfca23e7d7a70dbcb8da16160
4
+ data.tar.gz: 25d1914a50c76e75add6cb0ed42a59ff93684224
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- NzczNmY3MGJkOTRlYjM1YjVkNjJhMDIyNDA4YWE2MjU4OGEyMGEwMDAwNzUy
10
- NjU5MmY5Nzk1OGVjYmQ5NzY3ZjlhMTczYzlkMjZkNzBlZGQyMWI2MTZlNjc2
11
- OGJlZGM2NmE0YWNjNDlkYWVkYWI3ODE2NTBiMjUzN2RiY2ZlYzE=
12
- data.tar.gz: !binary |-
13
- Y2VmYmM2ZWYwNzI2NDRiNGFiZDE1MGUyZWM1OGQxZWRjYzllN2RmNDRhYTA5
14
- YWJhZWZjZTIxYmRmNDYwNDRhNmM1NDc3NmNkYTQyODIwYWYwZTFlZjM2Nzcx
15
- OGU1ODc5ODBiNmFkZTM4ZmQ1NDBjYTUyMmIyNjNlZWI3NWE0ZDg=
6
+ metadata.gz: 05c229033d963004a499b7b4f3152d5dce28696e51a6569649f0eb4202757dd409c9c45fa7d30415babdfbd79b7e8e9f28d482709a7802340d08911eee10ac10
7
+ data.tar.gz: 220f6f9869674ad1e378a37cbb0513b760a66b19acc9b95c15ce5509620eab6c22c6d38a0b3febc829a8b1666e36199cc7f1855826999b8582ae24c29ef2a5dc
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # CarrierWave FTP storage
2
2
 
3
- [![Build Status](https://travis-ci.org/luan/carrierwave-ftp.png?branch=master)](https://travis-ci.org/luan/carrierwave-ftp)
3
+ [![Build Status](https://travis-ci.org/luan/carrierwave-ftp.svg?branch=master)](https://travis-ci.org/luan/carrierwave-ftp)
4
4
  [![Code Climate](https://codeclimate.com/github/luan/carrierwave-ftp.png)](https://codeclimate.com/github/luan/carrierwave-ftp)
5
5
  [![Dependency Status](https://gemnasium.com/luan/carrierwave-ftp.png)](https://gemnasium.com/luan/carrierwave-ftp)
6
6
 
@@ -34,7 +34,7 @@ CarrierWave.configure do |config|
34
34
  config.ftp_passwd = "secret"
35
35
  config.ftp_folder = "/public_html/uploads"
36
36
  config.ftp_url = "http://example.com/uploads"
37
- config.passive = false # false by default
37
+ config.ftp_passive = false # false by default
38
38
  end
39
39
  ```
40
40
 
@@ -22,6 +22,6 @@ Gem::Specification.new do |s|
22
22
 
23
23
  s.add_dependency "carrierwave", [">= 0.6.2"]
24
24
  s.add_dependency "net-sftp", ["~> 2.1.2"]
25
- s.add_development_dependency "rspec", ["~> 2.6"]
26
- s.add_development_dependency "rake", ["~> 0.9"]
25
+ s.add_development_dependency "rspec", ["~> 2.14"]
26
+ s.add_development_dependency "rake", ["~> 10.3"]
27
27
  end
@@ -92,10 +92,17 @@ module CarrierWave
92
92
  end
93
93
 
94
94
  def connection
95
- ftp = ExFTP.open(@uploader.ftp_host, @uploader.ftp_user, @uploader.ftp_passwd, @uploader.ftp_port)
96
- ftp.passive = @uploader.ftp_passive
97
- yield ftp
98
- ftp.close
95
+ ftp = ExFTP.new
96
+ ftp.connect(@uploader.ftp_host, @uploader.ftp_port)
97
+
98
+ begin
99
+ ftp.passive = @uploader.ftp_passive
100
+ ftp.login(@uploader.ftp_user, @uploader.ftp_passwd)
101
+
102
+ yield ftp
103
+ ensure
104
+ ftp.close
105
+ end
99
106
  end
100
107
  end
101
108
  end
@@ -1,7 +1,7 @@
1
1
  module Carrierwave
2
2
  module Storage
3
3
  class FTP
4
- VERSION = "0.2.6"
4
+ VERSION = "0.2.7"
5
5
  end
6
6
  end
7
7
  end
@@ -31,7 +31,9 @@ describe CarrierWave::Storage::FTP do
31
31
  21
32
32
  ]
33
33
 
34
- Net::FTP.should_receive(:open).with(*ftp_params).and_return(ftp)
34
+ Net::FTP.should_receive(:new).and_return(ftp)
35
+ ftp.should_receive(:connect).with('ftp.testcarrierwave.dev', 21)
36
+ ftp.should_receive(:login).with('test_user', 'test_passwd')
35
37
  ftp.should_receive(:passive=).with(true)
36
38
  ftp.should_receive(:mkdir_p).with('~/public_html/uploads')
37
39
  ftp.should_receive(:chdir).with('~/public_html/uploads')
@@ -43,7 +45,9 @@ describe CarrierWave::Storage::FTP do
43
45
  describe 'after upload' do
44
46
  before do
45
47
  ftp = double(:ftp_connection)
46
- Net::FTP.stub(:open).and_return(ftp)
48
+ Net::FTP.stub(:new).and_return(ftp)
49
+ ftp.stub(:connect)
50
+ ftp.stub(:login)
47
51
  ftp.stub(:passive=)
48
52
  ftp.stub(:mkdir_p)
49
53
  ftp.stub(:chdir)
@@ -64,7 +68,9 @@ describe CarrierWave::Storage::FTP do
64
68
  describe 'other operations' do
65
69
  before do
66
70
  @ftp = double(:ftp_connection)
67
- Net::FTP.stub(:open).and_return(@ftp)
71
+ Net::FTP.stub(:new).and_return(@ftp)
72
+ @ftp.stub(:connect)
73
+ @ftp.stub(:login)
68
74
  @ftp.stub(:passive=)
69
75
  @ftp.stub(:mkdir_p)
70
76
  @ftp.stub(:chdir)
metadata CHANGED
@@ -1,71 +1,71 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: carrierwave-ftp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luan Santos
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-02 00:00:00.000000000 Z
11
+ date: 2014-08-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: carrierwave
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ! '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 0.6.2
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ! '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.6.2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: net-sftp
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: 2.1.2
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: 2.1.2
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '2.6'
47
+ version: '2.14'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '2.6'
54
+ version: '2.14'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ~>
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '0.9'
61
+ version: '10.3'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ~>
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '0.9'
68
+ version: '10.3'
69
69
  description: Allows file upload using FTP for CarrierWave uploaders.
70
70
  email:
71
71
  - luan@luansantos.com
@@ -73,8 +73,8 @@ executables: []
73
73
  extensions: []
74
74
  extra_rdoc_files: []
75
75
  files:
76
- - .gitignore
77
- - .travis.yml
76
+ - ".gitignore"
77
+ - ".travis.yml"
78
78
  - Gemfile
79
79
  - LICENSE
80
80
  - README.md
@@ -99,17 +99,17 @@ require_paths:
99
99
  - lib
100
100
  required_ruby_version: !ruby/object:Gem::Requirement
101
101
  requirements:
102
- - - ! '>='
102
+ - - ">="
103
103
  - !ruby/object:Gem::Version
104
104
  version: '0'
105
105
  required_rubygems_version: !ruby/object:Gem::Requirement
106
106
  requirements:
107
- - - ! '>='
107
+ - - ">="
108
108
  - !ruby/object:Gem::Version
109
109
  version: '0'
110
110
  requirements: []
111
111
  rubyforge_project: carrierwave-ftp
112
- rubygems_version: 2.1.9
112
+ rubygems_version: 2.2.2
113
113
  signing_key:
114
114
  specification_version: 4
115
115
  summary: FTP support for CarrierWave