middleman-s3_sync 3.0.46 → 3.0.47

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: 73a67a19dcdfbb8f9aee5775e7b8daefcbb13155
4
- data.tar.gz: 8346b5da14b5506205bc9eb56c5128b0c999f6e3
3
+ metadata.gz: 7b9818aa4b2d7384ea359655f3ac8a3b051fafbd
4
+ data.tar.gz: 8416884e3a0bcd584f82f144e3a0d480780ae6af
5
5
  SHA512:
6
- metadata.gz: 80b49fae0b5b0f5499d1827e9d8f09d8fbb50502f7ca2b05956cfcd66099e5727a8eba9dd429fcf34003f1200cc55fb0e764e2273028f155d72d88718354827d
7
- data.tar.gz: 543ab69d8f55b1230683ee7155b6f631904aacbeeeae50c5253adcb228ac0298366a364e45bfa79504e3f355d64d4d1573130248b400bd9a4a86fde7f0708523
6
+ metadata.gz: 63ee52ab134fc7aff450acb5dcf5d865639ea163b948c5a8b430000f09216fc523eb9267f774379f85e4b4e27c62a5892a068737bf9b081b62a3a73f44eb30d4
7
+ data.tar.gz: d65744542b6d42817502f101b174cee9bc5893cbb5061a6a41b4b161ca1ad0d2859f80f60c6b78585344e4dd85805b8abe2467d4e14016d7662b500fe9837505
data/README.md CHANGED
@@ -259,6 +259,14 @@ are (I'm looking at you Chrome!). Setting the `Cache-Control` or
259
259
  that stand between them and your content will behave the way you want
260
260
  them to. YMMV.
261
261
 
262
+ ### Path Specific Content Type
263
+
264
+ You can now set the content type of a path through the
265
+ ```s3_sync.content_types``` hash. This hasi will take precendence over
266
+ the content type discovered by the mime_types gem. The [associated pull
267
+ request](https://github.com/fredjean/middleman-s3_sync/pull/87) has a
268
+ few good examples on how to use this feature.
269
+
262
270
  ### ACLs
263
271
 
264
272
  ```middleman-s3_sync``` will set the resources's ACL to ```public-read``` by default. You
@@ -19,7 +19,8 @@ module Middleman
19
19
  :reduced_redundancy_storage,
20
20
  :path_style,
21
21
  :version_bucket,
22
- :verbose
22
+ :verbose,
23
+ :content_types
23
24
  ]
24
25
  attr_accessor *OPTIONS
25
26
 
@@ -101,6 +102,10 @@ module Middleman
101
102
  @version_bucket.nil? ? false : @version_bucket
102
103
  end
103
104
 
105
+ def content_types
106
+ @content_types || {}
107
+ end
108
+
104
109
  # Read config options from an IO stream and set them on `self`. Defaults
105
110
  # to reading from the `.s3_sync` file in the MM project root if it exists.
106
111
  #
@@ -205,6 +205,7 @@ module Middleman
205
205
  end
206
206
 
207
207
  def content_type
208
+ @content_type ||= options.content_types[path]
208
209
  @content_type ||= MIME::Types.of(path).first
209
210
  end
210
211
 
@@ -1,5 +1,5 @@
1
1
  module Middleman
2
2
  module S3Sync
3
- VERSION = "3.0.46"
3
+ VERSION = "3.0.47"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: middleman-s3_sync
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.46
4
+ version: 3.0.47
5
5
  platform: ruby
6
6
  authors:
7
7
  - Frederic Jean
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-05-09 00:00:00.000000000 Z
12
+ date: 2015-06-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: middleman-core