middleman-s3_sync 3.0.27 → 3.0.28
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/middleman/s3_sync/resource.rb +5 -5
- data/lib/middleman/s3_sync/version.rb +1 -1
- data/lib/middleman/s3_sync.rb +0 -2
- data/middleman-s3_sync.gemspec +2 -1
- data/spec/options_spec.rb +7 -7
- data/spec/spec_helper.rb +1 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e216c35299295bd25bf9c095d627a57d3de6ef94
|
4
|
+
data.tar.gz: b12a21e124b649a52c068e3c37c1abd916745490
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 63df5416f4776612a216ccc61efa9f2350912dcf5e62effa86c09e60992917a8614be91371e0726883fc20460917391312eee4aa185616980f451ebddfe79030
|
7
|
+
data.tar.gz: d47cbba2841bdc2ceed9b0c97cdfb56d6dfdea413373e30be06401e19352e07917e6b054105098d253952377a0e39e34f951fb501b1bbd3c4d447c381ebb9b20
|
data/README.md
CHANGED
@@ -169,7 +169,7 @@ As a result, the following ```Cache-Control``` header would be set to ```max-age
|
|
169
169
|
|
170
170
|
### Setting a Default Policy
|
171
171
|
|
172
|
-
You can set the default policy by passing an options hash to ```default_caching_policy``` in your ```config.rb``` file:
|
172
|
+
You can set the default policy by passing an options hash to ```default_caching_policy``` in your ```config.rb``` file after the ```activate :s3_sync ... end``` block:
|
173
173
|
|
174
174
|
```ruby
|
175
175
|
default_caching_policy max_age:(60 * 60 * 24 * 365)
|
@@ -164,17 +164,17 @@ module Middleman
|
|
164
164
|
:ignored
|
165
165
|
end
|
166
166
|
elsif local? && remote?
|
167
|
-
if
|
167
|
+
if options.force
|
168
|
+
:updated
|
169
|
+
elsif local_object_md5 == remote_object_md5
|
168
170
|
:identical
|
169
171
|
else
|
170
172
|
if !gzipped
|
171
173
|
# we're not gzipped, object hashes being different indicates updated content
|
172
174
|
:updated
|
173
|
-
elsif local_content_md5 != remote_content_md5
|
175
|
+
elsif !encoding_match? || local_content_md5 != remote_content_md5
|
174
176
|
# we're gzipped, so we checked the content MD5, and it also changed
|
175
177
|
:updated
|
176
|
-
elsif !encoding_match?
|
177
|
-
:updated
|
178
178
|
else
|
179
179
|
# we're gzipped, the object hashes differ, but the content hashes are equal
|
180
180
|
# this means the gzipped bits changed while the original bits did not
|
@@ -216,7 +216,7 @@ module Middleman
|
|
216
216
|
end
|
217
217
|
|
218
218
|
def encoding_match?
|
219
|
-
(gzipped && full_s3_resource.content_encoding == 'gzip') || (!gzipped && !full_s3_resource.content_encoding )
|
219
|
+
(options.prefer_gzip && gzipped && full_s3_resource.content_encoding == 'gzip') || (!options.prefer_gzip && !gzipped && !full_s3_resource.content_encoding )
|
220
220
|
end
|
221
221
|
|
222
222
|
def remote_content_md5
|
data/lib/middleman/s3_sync.rb
CHANGED
data/middleman-s3_sync.gemspec
CHANGED
@@ -29,7 +29,8 @@ Gem::Specification.new do |gem|
|
|
29
29
|
gem.add_development_dependency 'rake'
|
30
30
|
gem.add_development_dependency 'pry'
|
31
31
|
gem.add_development_dependency 'pry-nav'
|
32
|
-
gem.add_development_dependency 'rspec'
|
32
|
+
gem.add_development_dependency 'rspec', '>= 3.0.0'
|
33
|
+
gem.add_development_dependency 'rspec-its'
|
33
34
|
gem.add_development_dependency 'timerizer'
|
34
35
|
gem.add_development_dependency 'travis'
|
35
36
|
gem.add_development_dependency 'travis-lint'
|
data/spec/options_spec.rb
CHANGED
@@ -4,13 +4,13 @@ require 'middleman/s3_sync/options'
|
|
4
4
|
describe Middleman::S3Sync::Options do
|
5
5
|
subject(:options) { Middleman::S3Sync::Options.new }
|
6
6
|
|
7
|
-
its(:delete) {
|
8
|
-
its(:after_build) {
|
9
|
-
its(:prefer_gzip) {
|
10
|
-
its(:aws_secret_access_key) {
|
11
|
-
its(:aws_access_key_id) {
|
12
|
-
its(:caching_policies) {
|
13
|
-
its(:default_caching_policy) {
|
7
|
+
its(:delete) { is_expected.to eq(true) }
|
8
|
+
its(:after_build) { is_expected.to eq(false)}
|
9
|
+
its(:prefer_gzip) { is_expected.to eq(true) }
|
10
|
+
its(:aws_secret_access_key) { is_expected.to eq(ENV['AWS_SECRET_ACCESS_KEY']) }
|
11
|
+
its(:aws_access_key_id) { is_expected.to eq(ENV['AWS_ACCESS_KEY_ID']) }
|
12
|
+
its(:caching_policies) { is_expected.to be_empty }
|
13
|
+
its(:default_caching_policy) { is_expected.to be_nil }
|
14
14
|
|
15
15
|
context "browser caching policy" do
|
16
16
|
let(:policy) { options.default_caching_policy }
|
data/spec/spec_helper.rb
CHANGED
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.
|
4
|
+
version: 3.0.28
|
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-
|
12
|
+
date: 2014-06-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: middleman-core
|
@@ -153,6 +153,20 @@ dependencies:
|
|
153
153
|
version: '0'
|
154
154
|
- !ruby/object:Gem::Dependency
|
155
155
|
name: rspec
|
156
|
+
requirement: !ruby/object:Gem::Requirement
|
157
|
+
requirements:
|
158
|
+
- - '>='
|
159
|
+
- !ruby/object:Gem::Version
|
160
|
+
version: 3.0.0
|
161
|
+
type: :development
|
162
|
+
prerelease: false
|
163
|
+
version_requirements: !ruby/object:Gem::Requirement
|
164
|
+
requirements:
|
165
|
+
- - '>='
|
166
|
+
- !ruby/object:Gem::Version
|
167
|
+
version: 3.0.0
|
168
|
+
- !ruby/object:Gem::Dependency
|
169
|
+
name: rspec-its
|
156
170
|
requirement: !ruby/object:Gem::Requirement
|
157
171
|
requirements:
|
158
172
|
- - '>='
|