bfs-scp 0.6.4 → 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: 33ff15ddcfa479397fc70d93ebf34ab994dd4b1388698dddf525981eea479832
4
- data.tar.gz: 679f95cdb901ce1d2565462402753875bf9e32bf1943fc8da7af82cf37c0680d
3
+ metadata.gz: '082511639a1f7eb8048581b475eb529cd49c804bc2b403ae19b69eb0ab43a42a'
4
+ data.tar.gz: 548569c50be5de5d6866167260cd343e938241f2f7fe4a5b55fb88130db1f763
5
5
  SHA512:
6
- metadata.gz: 9e00b97deef4121d98e12a62f4a420557f0a2b7e8744758b5ccd65955adc13af1d2dc5d0029a2ecda0cd84c7f54ba2c91b01ff52b2e37304d79ce5aa30619d23
7
- data.tar.gz: 8b9f954dc9c3461c9e3483cbd4c93f9eabfb824f8a96f90019a08204d95d17fdb9e6a734ec71d27dd7701487028399e65b33821b935bad2ef3059b2410b799cc
6
+ metadata.gz: 24a18cba7f9bfae36ee116e026f89e3bd3755f1e16ec465b6cf8f2ed4512d27f52d239450f5686038507750879aeb03e4631cac297d9eba387618229896b1ea1
7
+ data.tar.gz: d1f1567669599b9677ecc19eb9db863605d8cfbb87170c9881b1810e0866c975200226af1d7c03fd68b57f03d72501858b359f2fe9aec93c33bc6d1648d1761d
@@ -15,7 +15,7 @@ Gem::Specification.new do |s|
15
15
  s.files = `git ls-files`.split("\n")
16
16
  s.test_files = `git ls-files -- spec/*`.split("\n")
17
17
  s.require_paths = ['lib']
18
- s.required_ruby_version = '>= 2.5.0'
18
+ s.required_ruby_version = '>= 2.6.0'
19
19
 
20
20
  s.add_dependency 'bfs', s.version
21
21
  s.add_dependency 'net-scp'
@@ -183,10 +183,12 @@ module BFS
183
183
  end
184
184
  end
185
185
 
186
- BFS.register('scp', 'ssh') do |url, opts|
186
+ BFS.register('scp', 'ssh') do |url, opts, block|
187
+ prefix = BFS.norm_path(opts[:prefix] || url.path)
188
+ opts[:prefix] = prefix unless prefix.empty?
187
189
  opts[:user] ||= CGI.unescape(url.user) if url.user
188
190
  opts[:password] ||= CGI.unescape(url.password) if url.password
189
191
  opts[:port] ||= url.port if url.port
190
192
 
191
- BFS::Bucket::SCP.new(url.host, **opts)
193
+ BFS::Bucket::SCP.open(url.host, **opts, &block)
192
194
  end
@@ -1,18 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
- sandbox = { host: '127.0.0.1', opts: { port: 7022, user: 'root', password: 'root' } }.freeze
4
- run_spec = \
5
- begin
6
- Net::SCP.start sandbox[:host], nil, sandbox[:opts].merge(timeout: 1) do |scp|
7
- scp.session.exec!('hostname')
8
- end
9
- true
10
- rescue Net::SSH::Exception, Errno::ECONNREFUSED => e
11
- warn "WARNING: unable to run #{File.basename __FILE__}: #{e.message}"
12
- false
13
- end
3
+ sandbox = { host: '127.0.0.1', opts: { port: 7022, user: 'root', password: 'root' } }.freeze
14
4
 
15
- RSpec.describe BFS::Bucket::SCP, if: run_spec do
5
+ RSpec.describe BFS::Bucket::SCP, scp: true do
16
6
  context 'absolute' do
17
7
  subject { described_class.new sandbox[:host], **sandbox[:opts].merge(prefix: SecureRandom.uuid) }
18
8
  after { subject.close }
@@ -30,6 +20,13 @@ RSpec.describe BFS::Bucket::SCP, if: run_spec do
30
20
  it 'should resolve from URL' do
31
21
  bucket = BFS.resolve('scp://root:root@127.0.0.1:7022')
32
22
  expect(bucket).to be_instance_of(described_class)
23
+ expect(bucket.instance_variable_get(:@prefix)).to be_nil
24
+ bucket.close
25
+
26
+ bucket = BFS.resolve('scp://root:root@127.0.0.1:7022/a/b/')
27
+ expect(bucket).to be_instance_of(described_class)
28
+ expect(bucket.instance_variable_get(:@prefix)).to eq('a/b/')
29
+ bucket.close
33
30
  end
34
31
 
35
32
  it 'should handle absolute and relative paths' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bfs-scp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.4
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-02-17 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.6.4
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.6.4
26
+ version: 0.7.3
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: net-scp
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -60,14 +60,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
60
60
  requirements:
61
61
  - - ">="
62
62
  - !ruby/object:Gem::Version
63
- version: 2.5.0
63
+ version: 2.6.0
64
64
  required_rubygems_version: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  requirements: []
70
- rubygems_version: 3.1.2
70
+ rubygems_version: 3.1.4
71
71
  signing_key:
72
72
  specification_version: 4
73
73
  summary: SCP/SSH adapter for bfs