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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 400e4e79bd39b1b9c3ec9c54683e82b6d95b359e
4
- data.tar.gz: e4365c48e32c38f85300518d27c4eec50dad6195
3
+ metadata.gz: e216c35299295bd25bf9c095d627a57d3de6ef94
4
+ data.tar.gz: b12a21e124b649a52c068e3c37c1abd916745490
5
5
  SHA512:
6
- metadata.gz: 2d4ccc0a530cf8e7a2aa0f32f246faca9d2043011dd58a7a031085f99f92b26f77fa7d7c5a8a0e5ada3bcaf55496ef405f80a63e6630089e816eb240541597da
7
- data.tar.gz: 7925f8994ecee2ce274ec6a09c8596751f94dd61aa9b34ba7598277e408691c39bfb9e2b5dd2734487d64dea58373a97d39f0b445093be76b90bc7f7f072ed70
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 local_object_md5 == remote_object_md5
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
@@ -1,5 +1,5 @@
1
1
  module Middleman
2
2
  module S3Sync
3
- VERSION = "3.0.27"
3
+ VERSION = "3.0.28"
4
4
  end
5
5
  end
@@ -133,8 +133,6 @@ module Middleman
133
133
  end
134
134
 
135
135
  def files_to_update
136
- return resources.select { |r| r.local? && !r.to_ignore? } if s3_sync_options.force
137
-
138
136
  @files_to_update ||= resources.select { |r| r.to_update? }
139
137
  end
140
138
 
@@ -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) { should be_true }
8
- its(:after_build) { should be_false }
9
- its(:prefer_gzip) { should be_true }
10
- its(:aws_secret_access_key) { should == ENV['AWS_SECRET_ACCESS_KEY'] }
11
- its(:aws_access_key_id) { should == ENV['AWS_ACCESS_KEY_ID'] }
12
- its(:caching_policies) { should be_empty }
13
- its(:default_caching_policy) { should be_nil }
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
@@ -7,6 +7,7 @@
7
7
 
8
8
  require 'middleman-s3_sync'
9
9
  require 'timerizer'
10
+ require 'rspec/its'
10
11
 
11
12
  RSpec.configure do |config|
12
13
  config.treat_symbols_as_metadata_keys_with_true_values = true
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.27
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-05-28 00:00:00.000000000 Z
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
  - - '>='