bfs-ftp 0.7.4 → 0.8.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bfs/bucket/ftp.rb +2 -9
- data/spec/bfs/bucket/ftp_spec.rb +7 -5
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e1a2274fa3727fd33cef1df0ab403e5db898294ad3e1ae48f580ece29dfa7900
|
4
|
+
data.tar.gz: 1380a85411db753dbc2d4b273e8aba23a82b2831c914c3d9e8cc7a1ade14c909
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1f0328f48f717639c9fd47ff20327e3828e8ab3a7e835936dec8bc49e9dd14da0bc24c6d9bcd285eaef1dd923039a9e36ca140f7f6da531c74617d0ce3c93e61
|
7
|
+
data.tar.gz: e730fb80fa69bce311cff7a5508e4045fe24db1194e32e567f760f4231e4b0c907cb02155c5c108b83fcfab7fe12663cd22e772ae4aec124a59451f1da71b75b
|
data/lib/bfs/bucket/ftp.rb
CHANGED
@@ -52,17 +52,10 @@ module BFS
|
|
52
52
|
# Creates a new file and opens it for writing
|
53
53
|
def create(path, encoding: self.encoding, perm: self.perm, **_opts, &block)
|
54
54
|
path = norm_path(path)
|
55
|
-
|
55
|
+
BFS::Writer.new(path, encoding: encoding, perm: perm) do |t|
|
56
56
|
mkdir_p File.dirname(path)
|
57
57
|
@client.put(t, path)
|
58
|
-
end
|
59
|
-
return temp unless block
|
60
|
-
|
61
|
-
begin
|
62
|
-
yield temp
|
63
|
-
ensure
|
64
|
-
temp.close
|
65
|
-
end
|
58
|
+
end.perform(&block)
|
66
59
|
end
|
67
60
|
|
68
61
|
# Opens an existing file for reading
|
data/spec/bfs/bucket/ftp_spec.rb
CHANGED
@@ -1,16 +1,18 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
sandbox = { host: '127.0.0.1', port: 7021, username: 'ftpuser', password: 'ftppass' }.freeze
|
4
|
-
|
5
3
|
RSpec.describe BFS::Bucket::FTP, ftp: true do
|
6
|
-
subject { described_class.new
|
7
|
-
|
4
|
+
subject { described_class.new hostname, **conn_opts }
|
5
|
+
|
6
|
+
let(:hostname) { '127.0.0.1' }
|
7
|
+
let(:conn_opts) { { port: 7021, username: 'ftpuser', password: 'ftppass', prefix: SecureRandom.uuid } }
|
8
|
+
|
9
|
+
after { subject.close }
|
8
10
|
|
9
11
|
it_behaves_like 'a bucket',
|
10
12
|
content_type: false,
|
11
13
|
metadata: false
|
12
14
|
|
13
|
-
it '
|
15
|
+
it 'resolves from URL' do
|
14
16
|
bucket = BFS.resolve('ftp://ftpuser:ftppass@127.0.0.1:7021')
|
15
17
|
expect(bucket).to be_instance_of(described_class)
|
16
18
|
expect(bucket.instance_variable_get(:@client).pwd).to eq('/ftp/ftpuser')
|
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.
|
4
|
+
version: 0.8.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dimitrij Denissenko
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-05-04 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.
|
19
|
+
version: 0.8.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
|
-
version: 0.
|
26
|
+
version: 0.8.2
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: net-ftp-list
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -67,7 +67,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
requirements: []
|
70
|
-
rubygems_version: 3.1.
|
70
|
+
rubygems_version: 3.1.4
|
71
71
|
signing_key:
|
72
72
|
specification_version: 4
|
73
73
|
summary: FTP adapter for bfs
|