s3_assets_uploader 0.2.0 → 0.3.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: d76723a14ca4cc1eaa57550a911870b9b9fca01d
4
- data.tar.gz: 1ea0ea3af4123d4e1cb93271a6540aa978e97e9d
3
+ metadata.gz: 533f64deef97d41a7bae45e85b92dddb96080964
4
+ data.tar.gz: fd22da2b8b06d662b2e29fe56e2d5f32e4aeacd2
5
5
  SHA512:
6
- metadata.gz: 85f4b2575cc25c7d9999a204f142ba3255a67a9fce2fbaf648bfcdc6f519a616d9ba7a1c9a10d5f6f55dbb18ee014197ea1b2f88f58e83cb6518b6f2f267ffe2
7
- data.tar.gz: ca73f6074b9ac9368fb8e3e0ec0e50b4e0566ff483cabfa35d07dc66bf424d4b30f46aef5d23c5c8e3feefcb497c0ef43d58bdba175ee1af4f7cd3f22023015b
6
+ metadata.gz: 94e6865aebc6a86d82622c426faee38516337e908567e421c49fc3fb4aaf3303fe72c194b569b1d425bcd1b84a70f866e510390259f40d4eebb43a4be7035cd9
7
+ data.tar.gz: ee02da5636752b0e4af43d70a5b5580bea3edfdfa77de6d7c5e4dd8e6f61cc1a3bb9323a7a008670abfb5b9f692f1509ecc3cf8b33ba819e7ac0f2babc0dc0e2
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 0.3.0
2
+ - Add `config.cache_control` option
3
+ - The default value is `max-age=2592000, public` .
4
+
1
5
  # 0.2.0
2
6
  - Now Content-Type is automatically specified from asset's filename.
3
7
  - https://github.com/eagletmt/s3_assets_uploader/pull/2
@@ -1,14 +1,16 @@
1
1
  require 'aws-sdk'
2
2
 
3
3
  module S3AssetsUploader
4
- class Config < Struct.new(:s3_client, :bucket, :assets_path, :assets_prefix, :additional_paths)
4
+ class Config < Struct.new(:s3_client, :bucket, :assets_path, :assets_prefix, :additional_paths, :cache_control)
5
5
  class ValidationError < StandardError
6
6
  end
7
7
 
8
8
  DEFAULT_ASSETS_PATH = 'public/assets'.freeze
9
+ DEFAULT_CACHE_CONTROL = 'max-age=2592000, public'
9
10
 
10
11
  def initialize
11
12
  self.assets_path = DEFAULT_ASSETS_PATH
13
+ self.cache_control = DEFAULT_CACHE_CONTROL
12
14
  self.additional_paths = []
13
15
  end
14
16
 
@@ -30,6 +30,7 @@ module S3AssetsUploader
30
30
  bucket: @config.bucket,
31
31
  key: compute_asset_key(path),
32
32
  content_type: guess_content_type(path),
33
+ cache_control: @config.cache_control,
33
34
  )
34
35
  end
35
36
  end
@@ -1,3 +1,3 @@
1
1
  module S3AssetsUploader
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: s3_assets_uploader
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kohei Suzuki
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-06-01 00:00:00.000000000 Z
11
+ date: 2015-07-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk