bfs-gs 0.4.2 → 0.6.0
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/gs.rb +3 -2
- data/spec/bfs/bucket/gs_spec.rb +1 -1
- 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: be5e98f31d64019631ea9b0a2640680bbb62fcfca8f665d2f4469af641cf32c3
|
4
|
+
data.tar.gz: dfe4b2550520ae8cdb3424b1195f270364a991c0897b203f8737bd70911152c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e4718ac5bd08a18ce260d7bdfb061a4de1e77325bd9098cd3822d1ccee42b168bfc324ed88ab66251240fb23f1d1e902aa09726abd3bc2dfaa6dceeebec7d2c1
|
7
|
+
data.tar.gz: 20dd5ac3740c4d6374c29e9177e60b6d17054562f1e8890200c2df0507f78fedc78e0028606cb9c54cac6b100ac44645418a37caaaf49951353c7d2b51050ffb
|
data/lib/bfs/bucket/gs.rb
CHANGED
@@ -20,7 +20,7 @@ module BFS
|
|
20
20
|
# @option opts [Integer] :timeout request timeout, in seconds.
|
21
21
|
# @option opts [String] :acl set the default ACL.
|
22
22
|
# @option opts [Google::Cloud::Storage] :client custom client.
|
23
|
-
# @option opts [String] :encoding
|
23
|
+
# @option opts [String] :encoding Custom encoding.
|
24
24
|
def initialize(name, opts={})
|
25
25
|
opts = opts.dup
|
26
26
|
opts.keys.each do |key|
|
@@ -59,11 +59,12 @@ module BFS
|
|
59
59
|
raise BFS::FileNotFound, trim_prefix(path) unless file
|
60
60
|
|
61
61
|
name = trim_prefix(file.name)
|
62
|
-
BFS::FileInfo.new(name, file.size, file.updated_at.to_time, file.content_type, file.metadata)
|
62
|
+
BFS::FileInfo.new(name, file.size, file.updated_at.to_time, file.content_type, norm_meta(file.metadata))
|
63
63
|
end
|
64
64
|
|
65
65
|
# Creates a new file and opens it for writing
|
66
66
|
def create(path, opts={}, &block)
|
67
|
+
opts[:metadata] = norm_meta(opts[:metadata])
|
67
68
|
path = full_path(path)
|
68
69
|
enc = opts.delete(:encoding) || @encoding
|
69
70
|
temp = BFS::TempWriter.new(path, encoding: enc) do |t|
|
data/spec/bfs/bucket/gs_spec.rb
CHANGED
@@ -30,7 +30,7 @@ RSpec.describe BFS::Bucket::GS, if: run_spec do
|
|
30
30
|
it_behaves_like 'a bucket'
|
31
31
|
|
32
32
|
it 'should resolve from URL' do
|
33
|
-
bucket = BFS.resolve("gs://#{sandbox[:bucket]}/?
|
33
|
+
bucket = BFS.resolve("gs://#{sandbox[:bucket]}/?project_id=#{sandbox[:project]}")
|
34
34
|
expect(bucket).to be_instance_of(described_class)
|
35
35
|
expect(bucket.name).to eq(sandbox[:bucket])
|
36
36
|
expect(bucket.instance_variable_get(:@prefix)).to be_nil
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bfs-gs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dimitrij Denissenko
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-12-19 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.6.0
|
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.6.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: google-cloud-storage
|
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.0.
|
70
|
+
rubygems_version: 3.0.6
|
71
71
|
signing_key:
|
72
72
|
specification_version: 4
|
73
73
|
summary: GS bucket adapter for bfs
|