bfs-s3 0.3.2 → 0.3.3
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 +4 -4
- data/lib/bfs/bucket/s3.rb +4 -5
- data/spec/bfs/bucket/s3_spec.rb +5 -7
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 64e82eeda72f79a41868973bca6120a9533742f28e3387fc3ea43a62ff7e2ac5
|
4
|
+
data.tar.gz: bbba7f07472b885148ec0ad66c3278412ecdb16ebdff4b1f06b2ca8604f43f6a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 594b23762958eb90c9d200d081939be4eba894593d56191772cc55dad3c6f596766481b7834a696fd65220e52a31bfe99b8169d1a5ec1e268b8bd7b188654b27
|
7
|
+
data.tar.gz: bed98d39b1423065bf49077947ac85dcedf36ae31e61d7cb6d921194d20597c4bb9850a90f20bb36331bf4a8d0866e1f9f93114a23c8bd691162d1ebe8e185c5
|
data/lib/bfs/bucket/s3.rb
CHANGED
@@ -55,13 +55,12 @@ module BFS
|
|
55
55
|
path = norm_path(path)
|
56
56
|
opts = opts.merge(
|
57
57
|
bucket: name,
|
58
|
-
|
59
|
-
prefix: opts[:prefix] ? File.join(opts[:prefix], path) : path,
|
58
|
+
key: opts[:prefix] ? File.join(opts[:prefix], path) : path,
|
60
59
|
)
|
61
|
-
|
62
|
-
raise BFS::FileNotFound, path unless
|
60
|
+
info = @client.head_object(opts)
|
61
|
+
raise BFS::FileNotFound, path unless info
|
63
62
|
|
64
|
-
BFS::FileInfo.new(path,
|
63
|
+
BFS::FileInfo.new(path, info.content_length, info.last_modified, info.content_type, info.metadata)
|
65
64
|
rescue Aws::S3::Errors::NoSuchKey, Aws::S3::Errors::NoSuchBucket
|
66
65
|
raise BFS::FileNotFound, path
|
67
66
|
end
|
data/spec/bfs/bucket/s3_spec.rb
CHANGED
@@ -27,16 +27,14 @@ RSpec.describe BFS::Bucket::S3 do
|
|
27
27
|
|
28
28
|
allow(client).to receive(:list_objects_v2).with(bucket: 'mock-bucket', continuation_token: nil) do |*|
|
29
29
|
contents = files.keys.map {|key| Aws::S3::Types::Object.new(key: key) }
|
30
|
-
|
30
|
+
Aws::S3::Types::ListObjectsV2Output.new contents: contents, next_continuation_token: ''
|
31
31
|
end
|
32
|
-
allow(client).to receive(:
|
33
|
-
|
34
|
-
double 'ListObjectsV2Response', contents: [obj]
|
32
|
+
allow(client).to receive(:head_object).with(bucket: 'mock-bucket', key: 'a/b/c.txt') do |*|
|
33
|
+
Aws::S3::Types::HeadObjectOutput.new content_length: 10, last_modified: Time.now, content_type: 'text/plain', metadata: { 'key' => 'val' }
|
35
34
|
end
|
36
|
-
allow(client).to receive(:
|
37
|
-
|
35
|
+
allow(client).to receive(:head_object).with(bucket: 'mock-bucket', key: 'missing.txt') do |*|
|
36
|
+
raise Aws::S3::Errors::NoSuchKey.new(nil, nil)
|
38
37
|
end
|
39
|
-
|
40
38
|
allow(client).to receive(:copy_object).with(hash_including(bucket: 'mock-bucket')) do |opts|
|
41
39
|
src = opts[:copy_source].sub('/mock-bucket/', '')
|
42
40
|
raise Aws::S3::Errors::NoSuchKey.new(nil, nil) unless files.key?(src)
|
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.3.
|
4
|
+
version: 0.3.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: 2018-11-
|
11
|
+
date: 2018-11-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.3.
|
33
|
+
version: 0.3.3
|
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.3.
|
40
|
+
version: 0.3.3
|
41
41
|
description: https://github.com/bsm/bfs.rb
|
42
42
|
email: dimitrij@blacksquaremedia.com
|
43
43
|
executables: []
|