middleman-s3_sync 3.0.26 → 3.0.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 45957c6108653a82b46a661ad75eb1b77f5e6af7
4
- data.tar.gz: 163a94c3b0130c78a31850caa6448bb759aa9691
3
+ metadata.gz: 400e4e79bd39b1b9c3ec9c54683e82b6d95b359e
4
+ data.tar.gz: e4365c48e32c38f85300518d27c4eec50dad6195
5
5
  SHA512:
6
- metadata.gz: eb34b8decbcf29d9022eca8ce05128e46a5df26a85e1d0ec8c76ad85d954aef4b424d420f34a8bcf09db7fff1dffc79e74c612b5ed912291ea849ea33324f1ee
7
- data.tar.gz: 96e6f7fbb1a200e51a5df31460860859d956421f451a3561a75759ef9d97d2b112b930e506c4d392cf695a85c9180d9aaec849b3887d4b35055cd4a6be6ff425
6
+ metadata.gz: 2d4ccc0a530cf8e7a2aa0f32f246faca9d2043011dd58a7a031085f99f92b26f77fa7d7c5a8a0e5ada3bcaf55496ef405f80a63e6630089e816eb240541597da
7
+ data.tar.gz: 7925f8994ecee2ce274ec6a09c8596751f94dd61aa9b34ba7598277e408691c39bfb9e2b5dd2734487d64dea58373a97d39f0b445093be76b90bc7f7f072ed70
data/README.md CHANGED
@@ -39,12 +39,14 @@ activate :s3_sync do |s3_sync|
39
39
  s3_sync.aws_access_key_id = 'AWS KEY ID'
40
40
  s3_sync.aws_secret_access_key = 'AWS SECRET KEY'
41
41
  s3_sync.delete = false # We delete stray files by default.
42
- s3_sync.after_build = false # We do not chain after the build step by default.
42
+ s3_sync.after_build = false # We do not chain after the build step by default.
43
43
  s3_sync.prefer_gzip = true
44
44
  s3_sync.path_style = true
45
45
  s3_sync.reduced_redundancy_storage = false
46
46
  s3_sync.acl = 'public-read'
47
47
  s3_sync.encryption = false
48
+ s3_sync.prefix = ''
49
+ s3_sync.version_bucket = false
48
50
  end
49
51
  ```
50
52
 
@@ -65,6 +67,7 @@ The following defaults apply to the configuration items:
65
67
  | path_style | ```true``` |
66
68
  | encryption | ```false``` |
67
69
  | acl | ```'public-read'``` |
70
+ | version_bucket | ```false``` |
68
71
 
69
72
  You do not need to specify the settings that match the defaults. This
70
73
  simplify the configuration of the extension:
@@ -122,6 +125,27 @@ The command is:
122
125
 
123
126
  $ middleman s3_sync --bucket=my.new.bucket
124
127
 
128
+ ## Pushing to a folder within a bucket
129
+
130
+ You can push to a folder within an S3 bucket by adding using the prefix
131
+ option in the config block:
132
+
133
+ ```ruby
134
+ activate :s3_sync do |s3_sync|
135
+ # ...
136
+ s3_sync.prefix = '/prefix'
137
+ end
138
+ ```
139
+
140
+ ## Bucket Versioning
141
+
142
+ You can enable bucket versioning by setting the ```version_bucket```
143
+ setting to true within the bucket configuration.
144
+
145
+ Versioning is enabled at the bucket level, not at the object level.
146
+
147
+ You can [find out more about versioning here](https://aws.amazon.com/about-aws/whats-new/2010/02/08/versioning-feature-for-amazon-s3-now-available/).
148
+
125
149
  ## HTTP Caching
126
150
 
127
151
  By default, ```middleman-s3_sync``` does not set caching headers. In
@@ -22,6 +22,8 @@ module Middleman
22
22
 
23
23
  say_status "\nReady to apply updates to #{s3_sync_options.bucket}."
24
24
 
25
+ update_bucket_versioning
26
+
25
27
  ignore_resources
26
28
  create_resources
27
29
  update_resources
@@ -33,6 +35,10 @@ module Middleman
33
35
  end
34
36
 
35
37
  protected
38
+ def update_bucket_versioning
39
+ connection.put_bucket_versioning(s3_sync_options.bucket, "Enabled") if s3_sync_options.version_bucket
40
+ end
41
+
36
42
  def connection
37
43
  @connection ||= Fog::Storage.new({
38
44
  :provider => 'AWS',
@@ -17,6 +17,7 @@ module Middleman
17
17
  :prefer_gzip,
18
18
  :reduced_redundancy_storage,
19
19
  :path_style,
20
+ :version_bucket,
20
21
  :verbose
21
22
 
22
23
  def initialize
@@ -84,6 +85,10 @@ module Middleman
84
85
  @prefix.nil? ? "" : "#{@prefix}/"
85
86
  end
86
87
 
88
+ def version_bucket
89
+ @version_bucket.nil? ? false : @version_bucket
90
+ end
91
+
87
92
  # Read config options from an IO stream and set them on `self`. Defaults
88
93
  # to reading from the `.s3_sync` file in the MM project root if it exists.
89
94
  #
@@ -1,5 +1,5 @@
1
1
  module Middleman
2
2
  module S3Sync
3
- VERSION = "3.0.26"
3
+ VERSION = "3.0.27"
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.26
4
+ version: 3.0.27
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: 2014-05-21 00:00:00.000000000 Z
12
+ date: 2014-05-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: middleman-core