bfs-ftp 0.7.2 → 0.7.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cd454e65db18af93c47c157366b9930f293c971f5a482d6de2d6448dfb673c24
4
- data.tar.gz: 1dba041b60e9e5093021eb55a050203a18b7764464add61626c083887a158385
3
+ metadata.gz: b481cc58f871c2d32a31c6b27a2d7663fabb5e780823aaf8a59766ca84ce92a7
4
+ data.tar.gz: d38ae55120b1b1ba286b0754a8cd549652a52d7dcec15938e2f174beb7a1995a
5
5
  SHA512:
6
- metadata.gz: 77e832b6c5a8c7f261cfb96b2e01351f9963644576f85b3b19fb90dcb8580b1b73ebcd7885f8b0f8493f78ad35cb097eb9c430b130f35b6672137a66f052f276
7
- data.tar.gz: 1f903add7d127b61ac330af5a8c2da9b0df3c8e3d0ce16e7c4f3417979df4393701e157687dd41db679da1f286a6ea0bef1fb0c5bff5e6056588b056c5f780a2
6
+ metadata.gz: f367b5df775d462366cc2af0017d5684cac8c59f2e291ca535050e6bbe5807aa22993f4ebab6b3a7189cd311d3644f56791c36f210d5f4a9d83111f80c93ee02
7
+ data.tar.gz: d4f8b6949f088c003e97d0de38e69e574096ddc650588e8cadee5782addba3c5c99a95a7f27b078cb92c935ccc954c3deedb5eaf32de3452a1aa26c88c05ac80
@@ -115,6 +115,9 @@ module BFS
115
115
  end
116
116
 
117
117
  BFS.register('ftp', 'sftp') do |url, opts, block|
118
+ prefix = BFS.norm_path(opts[:prefix] || url.path)
119
+ opts[:prefix] = prefix unless prefix.empty?
120
+
118
121
  extra = {
119
122
  username: url.user ? CGI.unescape(url.user) : nil,
120
123
  password: url.password ? CGI.unescape(url.password) : nil,
@@ -1,17 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
- sandbox = { host: '127.0.0.1', port: 7021, username: 'ftpuser', password: 'ftppass' }.freeze
4
- run_spec = \
5
- begin
6
- ftp = Net::FTP.new sandbox[:host], sandbox
7
- ftp.list
8
- ftp.close
9
- rescue Errno::ECONNREFUSED, Net::FTPError => e
10
- warn "WARNING: unable to run #{File.basename __FILE__}: #{e.message}"
11
- false
12
- end
3
+ sandbox = { host: '127.0.0.1', port: 7021, username: 'ftpuser', password: 'ftppass' }.freeze
13
4
 
14
- RSpec.describe BFS::Bucket::FTP, if: run_spec do
5
+ RSpec.describe BFS::Bucket::FTP, ftp: true do
15
6
  subject { described_class.new sandbox[:host], **sandbox.merge(prefix: SecureRandom.uuid) }
16
7
  after { subject.close }
17
8
 
@@ -22,5 +13,12 @@ RSpec.describe BFS::Bucket::FTP, if: run_spec do
22
13
  it 'should resolve from URL' do
23
14
  bucket = BFS.resolve('ftp://ftpuser:ftppass@127.0.0.1:7021')
24
15
  expect(bucket).to be_instance_of(described_class)
16
+ expect(bucket.instance_variable_get(:@client).pwd).to eq('/ftp/ftpuser')
17
+ bucket.close
18
+
19
+ bucket = BFS.resolve('ftp://ftpuser:ftppass@127.0.0.1:7021/a/b/')
20
+ expect(bucket).to be_instance_of(described_class)
21
+ expect(bucket.instance_variable_get(:@client).pwd).to eq('/ftp/ftpuser/a/b')
22
+ bucket.close
25
23
  end
26
24
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bfs-ftp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.2
4
+ version: 0.7.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dimitrij Denissenko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-02 00:00:00.000000000 Z
11
+ date: 2020-07-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bfs
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.7.2
19
+ version: 0.7.3
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
- version: 0.7.2
26
+ version: 0.7.3
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: net-ftp-list
29
29
  requirement: !ruby/object:Gem::Requirement