bfs-s3 0.6.5 → 0.7.4

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: bf51b2ca5b37742e046fa878b9c59a9b70b30f4cfd19e3a5a9781c89384a2574
4
- data.tar.gz: '083cf03fdbea11349338255962021c5af62c80284edfa9df23c26d1d1c209c69'
3
+ metadata.gz: ac3a8ad583c3cd4849b744a550bf281cc2c8b921538fda890981fb6fcf566a7e
4
+ data.tar.gz: 35a48baca7cc5e8d6903f1e5ef4bb215199e9635e8ae84b9fe928d98a857fd87
5
5
  SHA512:
6
- metadata.gz: 0f7449429a6ba8074007fad63f6913feb2e093345ef5d0a4c0013eee2ac572a693b506ed6de1f92e4c946b5921d531808107802ce0ec5c2d865d82efb2b564b3
7
- data.tar.gz: cd11cbce9e79e1ea78a5b2bf3445b7f8a3dbf28ff23d6903f31de9c2621500f05b3961ce7c4f8ee1f3dc45d87f8bf344f1bde02b2591bbb1c05cfe74dc231921
6
+ metadata.gz: 844c31903cb25363730e01ba630f3127ed0af3b9cbfccb249ab74d4fe7c468b27c7f94230a7ac6898447eaa01301f66ac0872911517bc135495c6c78e07d93be
7
+ data.tar.gz: 3ba0d4876291f272426843ce319b9bcea2f3487ce617bb6604e15b310525e6808838e085986d0d35d395b673519d18bab87bd5d3587b050a45b105627648cfd6
@@ -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 'aws-sdk-s3', '~> 1.38'
21
21
  s.add_dependency 'bfs', s.version
@@ -33,7 +33,7 @@ module BFS
33
33
 
34
34
  # Lists the contents of a bucket using a glob pattern
35
35
  def ls(pattern = '**/*', **opts)
36
- prefix = pattern[%r{^[^\*\?\{\}\[\]]+/}]
36
+ prefix = pattern[%r{^[^*?\{\}\[\]]+/}]
37
37
  prefix = File.join(*[@prefix, prefix].compact) if @prefix
38
38
 
39
39
  opts = opts.merge(bucket: name, prefix: @prefix)
@@ -158,9 +158,10 @@ module BFS
158
158
  end
159
159
  end
160
160
 
161
- BFS.register('s3') do |url, opts|
161
+ BFS.register('s3') do |url, opts, block|
162
162
  prefix = BFS.norm_path(opts[:prefix] || url.path)
163
163
  opts[:prefix] = prefix.empty? ? nil : prefix
164
+ opts = opts.slice(:prefix, :region, :sse, :access_key_id, :secret_access_key, :acl, :storage_class, :encoding)
164
165
 
165
- BFS::Bucket::S3.new url.host, **opts.slice(:prefix, :region, :sse, :access_key_id, :secret_access_key, :acl, :storage_class, :encoding)
166
+ BFS::Bucket::S3.open url.host, **opts, &block
166
167
  end
@@ -1,17 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
- sandbox = { bucket: 'bsm-bfs-unittest' }.freeze
4
- run_spec = \
5
- begin
6
- s = Aws::S3::Client.new
7
- s.head_bucket(bucket: sandbox[:bucket])
8
- true
9
- rescue StandardError => e
10
- warn "WARNING: unable to run #{File.basename __FILE__}: #{e.message}"
11
- false
12
- end
3
+ sandbox = { bucket: 'bsm-bfs-unittest' }.freeze
13
4
 
14
- RSpec.describe BFS::Bucket::S3, if: run_spec do
5
+ RSpec.describe BFS::Bucket::S3, s3: true do
15
6
  let(:prefix) { "x/#{SecureRandom.uuid}/" }
16
7
 
17
8
  subject do
@@ -31,15 +22,18 @@ RSpec.describe BFS::Bucket::S3, if: run_spec do
31
22
  expect(bucket.acl).to eq(:private)
32
23
  expect(bucket.encoding).to eq('binary')
33
24
  expect(bucket.instance_variable_get(:@prefix)).to be_nil
25
+ bucket.close
34
26
 
35
27
  bucket = BFS.resolve("s3://#{sandbox[:bucket]}/a/b/")
36
28
  expect(bucket).to be_instance_of(described_class)
37
29
  expect(bucket.name).to eq(sandbox[:bucket])
38
30
  expect(bucket.instance_variable_get(:@prefix)).to eq('a/b')
31
+ bucket.close
39
32
  end
40
33
 
41
34
  it 'should enumerate over a large number of files' do
42
35
  bucket = described_class.new sandbox[:bucket], prefix: 'm/'
43
36
  expect(bucket.ls('**/*').count).to eq(2121)
37
+ bucket.close
44
38
  end
45
39
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bfs-s3
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.5
4
+ version: 0.7.4
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-10-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-s3
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 0.6.5
33
+ version: 0.7.4
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
- version: 0.6.5
40
+ version: 0.7.4
41
41
  description: https://github.com/bsm/bfs.rb
42
42
  email: dimitrij@blacksquaremedia.com
43
43
  executables: []
@@ -60,7 +60,7 @@ 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
  - - ">="