shrine-google_cloud_storage 3.0.1 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/shrine/storage/google_cloud_storage.rb +13 -11
- data/shrine-google_cloud_storage.gemspec +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4e2812d047499cf034bc9683bef6c308ba85483e40e07f2745d8603b6d5f820b
|
4
|
+
data.tar.gz: 88260f377b2ea8f7268610467f6f4be5bfb9e03995f992abc97f5dc888ae62b1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0dbe54c3cb323ea666e97701690367346f71616c821e3eb5b2e6dfc128258e1127f13b026504c4d88dfbdf4448bae78a601222305a2686b96baec0512832309
|
7
|
+
data.tar.gz: '058d11b912b501fb42a2649d83d90345f0bb3090dd3f7f1adaa9ea01b71685faf723acc164d958e3639b2eecd8baa20916a5280dcf2a295f52ca50d787701fea'
|
@@ -30,7 +30,7 @@ class Shrine
|
|
30
30
|
file = existing_file.copy(
|
31
31
|
@bucket, # dest_bucket_or_path - the bucket to copy the file to
|
32
32
|
object_name(id), # dest_path - the path to copy the file to in the given bucket
|
33
|
-
acl: @default_acl
|
33
|
+
acl: options.fetch(:acl) { @default_acl }
|
34
34
|
) do |f|
|
35
35
|
# Workaround a bug in File#copy where the content-type is not copied if you provide a block
|
36
36
|
# See https://github.com/renchap/shrine-google_cloud_storage/issues/36
|
@@ -45,14 +45,16 @@ class Shrine
|
|
45
45
|
file
|
46
46
|
else
|
47
47
|
with_file(io) do |file|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
48
|
+
file_options = @object_options.merge(
|
49
|
+
content_type: shrine_metadata["mime_type"],
|
50
|
+
acl: options.fetch(:acl) { @default_acl }
|
51
|
+
).merge(options)
|
52
|
+
|
53
|
+
get_bucket.create_file(
|
54
|
+
file,
|
55
|
+
object_name(id), # path
|
56
|
+
**file_options
|
57
|
+
)
|
56
58
|
end
|
57
59
|
end
|
58
60
|
end
|
@@ -60,7 +62,7 @@ class Shrine
|
|
60
62
|
# URL to the remote file, accepts options for customizing the URL
|
61
63
|
def url(id, **options)
|
62
64
|
if options.key? :expires
|
63
|
-
signed_url = storage.signed_url(@bucket, object_name(id), options)
|
65
|
+
signed_url = storage.signed_url(@bucket, object_name(id), **options)
|
64
66
|
signed_url.gsub!(/storage.googleapis.com\/#{@bucket}/, @host) if @host
|
65
67
|
signed_url
|
66
68
|
else
|
@@ -157,7 +159,7 @@ class Shrine
|
|
157
159
|
opts[:project] = @project if @project
|
158
160
|
opts[:credentials] = @credentials if @credentials
|
159
161
|
|
160
|
-
@storage = Google::Cloud::Storage.new(opts)
|
162
|
+
@storage = Google::Cloud::Storage.new(**opts)
|
161
163
|
end
|
162
164
|
|
163
165
|
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.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Renaud Chaput
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-04-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: shrine
|
@@ -94,7 +94,7 @@ dependencies:
|
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '4.0'
|
97
|
-
description:
|
97
|
+
description:
|
98
98
|
email:
|
99
99
|
- renchap@gmail.com
|
100
100
|
executables: []
|
@@ -108,7 +108,7 @@ homepage: https://github.com/renchap/shrine-google_cloud_storage
|
|
108
108
|
licenses:
|
109
109
|
- MIT
|
110
110
|
metadata: {}
|
111
|
-
post_install_message:
|
111
|
+
post_install_message:
|
112
112
|
rdoc_options: []
|
113
113
|
require_paths:
|
114
114
|
- lib
|
@@ -123,8 +123,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
125
|
requirements: []
|
126
|
-
rubygems_version: 3.
|
127
|
-
signing_key:
|
126
|
+
rubygems_version: 3.2.15
|
127
|
+
signing_key:
|
128
128
|
specification_version: 4
|
129
129
|
summary: Provides Google Cloud Storage storage for Shrine.
|
130
130
|
test_files: []
|