middleman-s3_sync 3.3.5 → 3.3.6

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: 9b5f5838b4a56e989bd9417e8c4397ce72b90bcc
4
- data.tar.gz: 0961a7992383b6cb33a20a8f22bdfdcd042a927b
3
+ metadata.gz: 3b9f5ece891e9dbddd91b614c8d49ef1e734e39e
4
+ data.tar.gz: 2441ef3bf923065c7b13c8b3f44117301d05f559
5
5
  SHA512:
6
- metadata.gz: caf6c9d2d2e9959f9f2904fe6873c213f381ae76bc84c71e98af239a642b0452f8374de2a4d0174d5934fecd998cb8d5adc8df0e6d996560aad6dd0e16ee1a8d
7
- data.tar.gz: 8dd4605c11e79ea8f8451c65e5b678cc7d17e0f130b5800e5463dfe930bf286ce92c656b875d09e83621a809f2ada526ee29227bfaa3f2d7ed712fe67715df0c
6
+ metadata.gz: 31f4b4ee2d16237c81f82979862f77fe10182e61b56393fc6d9a73fdeee6be5791ba73ff2a2259e71aec4963dd015aacc7d270fdc16ad0688c8e3ccb55af81f1
7
+ data.tar.gz: 0ecc8e6b6bb67412c680928b9264da7323b80a4719c6f5bbb2ea318c9228a035dd0708f104f0f8d2501abe9367f2b9487183d53d6345f1061478210407543397
data/README.md CHANGED
@@ -47,8 +47,8 @@ activate :s3_sync do |s3_sync|
47
47
  s3_sync.encryption = false
48
48
  s3_sync.prefix = ''
49
49
  s3_sync.version_bucket = false
50
+ s3_sync.index_document = 'index.html'
50
51
  s3_sync.error_document = '404.html'
51
- s3_sync.index_suffix = 'index.html'
52
52
  end
53
53
  ```
54
54
 
@@ -71,7 +71,6 @@ The following defaults apply to the configuration items:
71
71
  | encryption | ```false``` |
72
72
  | acl | ```'public-read'``` |
73
73
  | version_bucket | ```false``` |
74
- | index_suffix | ```index.html``` |
75
74
 
76
75
  You do not need to specify the settings that match the defaults. This
77
76
  simplify the configuration of the extension:
@@ -306,11 +305,11 @@ headers will be set correctly. This will cause Amazon to serve the
306
305
  compressed version of the resource. In order for this to work, you need to
307
306
  have the `:gzip` extension activated in your `config.rb`.
308
307
 
309
- #### Custom index suffix and error document
308
+ #### Custom S3 Index and Error Documents
310
309
 
311
- You can enable a custom [index suffix](http://docs.aws.amazon.com/AmazonS3/latest/dev/IndexDocumentSupport.html)
310
+ You can enable a custom [index document](http://docs.aws.amazon.com/AmazonS3/latest/dev/IndexDocumentSupport.html)
312
311
  and [error document](http://docs.aws.amazon.com/AmazonS3/latest/dev/CustomErrorDocSupport.html)
313
- settings. The ```index_suffix``` option tells which file name gets used as
312
+ settings. The ```index_document``` option tells which file name gets used as
314
313
  the index document of a directory (typically, ```index.html```), while
315
314
  ```error_document``` specifies the document to display for 4xx errors (ie,
316
315
  the 404 page).
@@ -23,8 +23,8 @@ module Middleman
23
23
  option :version_bucket, false, 'Whether to enable versionning on the S3 bucket content'
24
24
  option :verbose, false, 'Whether to provide more verbose output'
25
25
  option :dry_run, false, 'Whether to perform a dry-run'
26
- option :index_suffix, nil, 'Path of S3 directory index document'
27
- option :error_document, nil, 'Path of S3 custom error document'
26
+ option :index_document, nil, 'S3 custom index document path'
27
+ option :error_document, nil, 'S3 custom error document path'
28
28
 
29
29
  def initialize(app, options_hash = {}, &block)
30
30
  super
@@ -82,10 +82,14 @@ module Middleman
82
82
 
83
83
  def update_bucket_website
84
84
  opts = {}
85
- opts[:ErrorDocument] = s3_sync_options.error_document unless s3_sync_options.error_document.nil?
86
- opts[:IndexDocument] = s3_sync_options.index_suffix unless s3_sync_options.index_suffix.nil?
85
+ opts[:IndexDocument] = s3_sync_options.index_document if s3_sync_options.index_document
86
+ opts[:ErrorDocument] = s3_sync_options.error_document if s3_sync_options.error_document
87
+
88
+ if opts[:ErrorDocument] && !opts[:IndexDocument]
89
+ raise 'S3 requires `index_document` if `error_document` is specified'
90
+ end
91
+
87
92
  unless opts.empty?
88
- opts[:IndexDocument] ||= 'index.html' # IndexDocument is mandatory in put_bucket_website
89
93
  say_status "Putting bucket website: #{opts.to_json}"
90
94
  connection.put_bucket_website(s3_sync_options.bucket, opts)
91
95
  end
@@ -22,7 +22,7 @@ module Middleman
22
22
  :dry_run,
23
23
  :verbose,
24
24
  :content_types,
25
- :index_suffix,
25
+ :index_document,
26
26
  :error_document
27
27
  ]
28
28
  attr_accessor *OPTIONS
@@ -1,5 +1,5 @@
1
1
  module Middleman
2
2
  module S3Sync
3
- VERSION = "3.3.5"
3
+ VERSION = "3.3.6"
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.3.5
4
+ version: 3.3.6
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-11-29 00:00:00.000000000 Z
12
+ date: 2015-12-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: middleman-core