paperclip-gcs 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -0
- data/lib/paperclip/gcs/version.rb +1 -1
- data/lib/paperclip/storage/gcs.rb +6 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a8cc76504b6ff42aee53039edc3a52197d4c74ff
|
4
|
+
data.tar.gz: 8d125159df6af16fa17c142f0bf341a94fffd90c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5624e98d042a9db18b602ae4642d0f875f6f1b00a1b1b56c7283975c5ad7506bd668c0692ef8174eb8776cf560c0059a7128dcf665ce85ad1c2a6d4befa4f03
|
7
|
+
data.tar.gz: 7b027d3345b4dfe74ccfa7a6bf5875e7702925a5032feaf1a7ec60111ceb2bad1de4d4829bee88b93ce592baf2b00b83e7b670595cb8ad6aa307284fbb5da4e1
|
data/README.md
CHANGED
@@ -180,6 +180,10 @@ Or globally:
|
|
180
180
|
gcs_storage_class: :multi_regional
|
181
181
|
```
|
182
182
|
|
183
|
+
### gcs_cache_control
|
184
|
+
|
185
|
+
The Cache-Control metadata allows you to control whether and for how long browser and Internet caches are allowed to cache your objects.
|
186
|
+
|
183
187
|
### Interpolates
|
184
188
|
|
185
189
|
#### :gcs_alias_url
|
@@ -22,6 +22,7 @@ module Paperclip
|
|
22
22
|
@gcs_metadata = normalize_style(@options[:gcs_metadata])
|
23
23
|
@gcs_permissions = normalize_style(@options[:gcs_permissions])
|
24
24
|
@gcs_storage_class = normalize_style(@options[:gcs_storage_class])
|
25
|
+
@gcs_cache_control = normalize_style(@options[:gcs_cache_control])
|
25
26
|
|
26
27
|
unless @options[:url].to_s.match(%r{\A:gcs_(alias|path|domain)_url\z}) || @options[:url] == ":asset_host".freeze
|
27
28
|
@options[:path] = path_option.gsub(/:url/, @options[:url]).sub(%r{\A:rails_root/public/system}, "".freeze)
|
@@ -70,6 +71,7 @@ module Paperclip
|
|
70
71
|
|
71
72
|
opts = {
|
72
73
|
content_type: file.content_type,
|
74
|
+
cache_control: gcs_cache_control(style),
|
73
75
|
encryption_key: gcs_encryption_key,
|
74
76
|
acl: gcs_permissions(style),
|
75
77
|
storage_class: gcs_storage_class(style),
|
@@ -143,6 +145,10 @@ module Paperclip
|
|
143
145
|
unwrap_proc(@gcs_storage_class[style] || @gcs_storage_class[:default], self, style)
|
144
146
|
end
|
145
147
|
|
148
|
+
def gcs_cache_control(style = default_style)
|
149
|
+
unwrap_proc(@gcs_cache_control[style] || @gcs_cache_control[:default], self, style)
|
150
|
+
end
|
151
|
+
|
146
152
|
def gcs_metadata(style = default_style)
|
147
153
|
unwrap_proc(@gcs_metadata[style] || @gcs_metadata[:default], self, style)
|
148
154
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paperclip-gcs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daichi HIRATA
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-01-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: paperclip
|
@@ -120,7 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
120
120
|
version: '0'
|
121
121
|
requirements: []
|
122
122
|
rubyforge_project:
|
123
|
-
rubygems_version: 2.
|
123
|
+
rubygems_version: 2.6.11
|
124
124
|
signing_key:
|
125
125
|
specification_version: 4
|
126
126
|
summary: Extends Paperclip with Google Cloud Storage
|