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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1f1a924ccfce1e00e1528f8dd388dc410f4b9810
4
- data.tar.gz: 1df9b5cc7b0ca186322ef4a3f02564bcf00ffa11
3
+ metadata.gz: a8cc76504b6ff42aee53039edc3a52197d4c74ff
4
+ data.tar.gz: 8d125159df6af16fa17c142f0bf341a94fffd90c
5
5
  SHA512:
6
- metadata.gz: 91ef9146b4d9c3531f8b19c0ff54a226a7ab3c6fd10cb6ca0735f8e13b5a5b31fafad1b94962dc2c2a46e9ca9b60b21b410a1063abdd6079bd15c1b69b2c3656
7
- data.tar.gz: 42fd00c5d874ac04e83919f1b6cbb5c0751dc2b3df6936dd8f3dd4ca54918039503281ca3970c625b82cad98bc144d5bfffeb26b4735ed47c4eb17dd537a0aef
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
@@ -1,5 +1,5 @@
1
1
  module Paperclip
2
2
  module Gcs
3
- VERSION = "0.1.0"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
@@ -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.1.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: 2017-06-23 00:00:00.000000000 Z
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.5.1
123
+ rubygems_version: 2.6.11
124
124
  signing_key:
125
125
  specification_version: 4
126
126
  summary: Extends Paperclip with Google Cloud Storage