shrine-google_cloud_storage 3.0.0 → 3.0.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '08794b4f3567a2c3b92a4d6eb5e6bcb3c39c1e11ddbc1af9025e71cb62cd42c7'
|
4
|
+
data.tar.gz: ef6f88db81fa575e99606f18e501d69b2ca8a912e1395434b2d850314ef3abad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f537db521f553056a92b3c607e143bcf7b8b868c580bd5518198c5d88b7088bb28b9173af4a653657f82546439059b12858946ffa2ebe82cdd801d01846c7894
|
7
|
+
data.tar.gz: a677c3b1588ce6fcbd686bbacae9131b1f9f239035c9fbc7042c59f9f35f21350d0149b097f33c56d55919e28e2cdff7e36b5e083a71ce6cb2a97079168d14c5
|
@@ -10,7 +10,7 @@ class Shrine
|
|
10
10
|
# Initialize a Shrine::Storage for GCS allowing for auto-discovery of the Google::Cloud::Storage client.
|
11
11
|
# @param [String] project Provide if not using auto discovery
|
12
12
|
# @see http://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud-storage/v1.6.0/guides/authentication#environmentvariables for information on discovery
|
13
|
-
def initialize(project: nil, bucket:, prefix: nil, host: nil, default_acl: nil, object_options: {})
|
13
|
+
def initialize(project: nil, bucket:, prefix: nil, host: nil, default_acl: nil, object_options: {}, credentials: nil)
|
14
14
|
@project = project
|
15
15
|
@bucket = bucket
|
16
16
|
@prefix = prefix
|
@@ -18,6 +18,7 @@ class Shrine
|
|
18
18
|
@default_acl = default_acl
|
19
19
|
@object_options = object_options
|
20
20
|
@storage = nil
|
21
|
+
@credentials = credentials
|
21
22
|
end
|
22
23
|
|
23
24
|
# If the file is an UploadFile from GCS, issues a copy command, otherwise it uploads a file.
|
@@ -150,11 +151,13 @@ class Shrine
|
|
150
151
|
|
151
152
|
# @see http://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud-storage/v1.6.0/guides/authentication
|
152
153
|
def storage
|
153
|
-
@storage
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
154
|
+
return @storage if @storage
|
155
|
+
|
156
|
+
opts = {}
|
157
|
+
opts[:project] = @project if @project
|
158
|
+
opts[:credentials] = @credentials if @credentials
|
159
|
+
|
160
|
+
@storage = Google::Cloud::Storage.new(opts)
|
158
161
|
end
|
159
162
|
|
160
163
|
def copyable?(io)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shrine-google_cloud_storage
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Renaud Chaput
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-04-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: shrine
|