s3_website 1.4.4 → 1.4.5

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: 46b9acd801794609373680934e09e07552a90894
4
- data.tar.gz: cb28b546a1e74db949e5583f39561aeee9a129d5
3
+ metadata.gz: 3cec0056627295c72fd85c41c1f4da128e6bf4ff
4
+ data.tar.gz: 8a55567ae2b010aa8bea43b33bd2efdfd3287d99
5
5
  SHA512:
6
- metadata.gz: 27a47e5a17eea3fef9e5b0a7c64bf9b06666263ed8ce7893fdf5942e9e8ce674054f688593cac9b80b6d9f3b222da619cc4ffb0199de063ccd7abefc7393ff73
7
- data.tar.gz: 29ca62a70b449c1e6c9e171ceb7b6d5fd5f396e41830be3d046273808e7e8a9399f7137a9aebe79382a78fc8eb7f04d2c24ff242dbcbdbc9cb6dc15356ca46b5
6
+ metadata.gz: 8b6fc00e2687748a152d3f7f031a20a6813b5dff2861f2203bc6574524c07883df9eea1f7779982fced473da3276fee79ec1e246297535b1a540467c8cadf05c
7
+ data.tar.gz: b6e30b9096746a2cff6a208f5e913e8388fffeaf46dad53c70c009320e77ded02dab72decc9807542077c0ca4539d61f0a77bf752bb549f2b1a600c17038961f
data/README.md CHANGED
@@ -34,15 +34,11 @@ Here's how you can get started:
34
34
 
35
35
  ### For Jekyll users
36
36
 
37
- Run the `s3_website cfg create` in the root directory of your Jekyll project.
38
- `s3_website` will automatically look for the site output in the *_site*
39
- directory.
37
+ S3_website will automatically discover your website in the *_site* directory.
40
38
 
41
39
  ### For Nanoc users
42
40
 
43
- Run the `s3_website cfg create` in the root directory of your Nanoc project.
44
- `s3_website` will automatically look for the site output in the *public/output*
45
- directory.
41
+ S3_website will automatically discover your website in the *public/output* directory.
46
42
 
47
43
  ### For others
48
44
 
@@ -338,7 +334,7 @@ See
338
334
 
339
335
  ## Known issues
340
336
 
341
- None. Please send a pull request if you spot any.
337
+ Please create an issue and send a pull request if you spot any.
342
338
 
343
339
  ## Development
344
340
 
data/changelog.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  This project uses [Semantic Versioning](http://semver.org).
4
4
 
5
+ ## 1.4.5
6
+
7
+ * If max-age=0, set `Cache-Control: no-cache, max-age=0`
8
+
5
9
  ## 1.4.4
6
10
 
7
11
  * Add support for eu-west-1 as a location constraint
@@ -70,11 +70,19 @@ module S3Website
70
70
 
71
71
  opts[:content_type] = "text/html; charset=utf-8" if mime_type == 'text/html'
72
72
  opts[:content_encoding] = "gzip" if gzip?
73
- opts[:cache_control] = "max-age=#{max_age}" if cache_control?
73
+ opts[:cache_control] = cache_control_value if cache_control?
74
74
 
75
75
  opts
76
76
  end
77
77
 
78
+ def cache_control_value
79
+ if max_age == 0
80
+ "no-cache, max-age=0"
81
+ else
82
+ "max-age=#{max_age}"
83
+ end
84
+ end
85
+
78
86
  def cache_control?
79
87
  !!config['max_age']
80
88
  end
data/s3_website.gemspec CHANGED
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "s3_website"
6
- s.version = "1.4.4"
6
+ s.version = "1.4.5"
7
7
  s.platform = Gem::Platform::RUBY
8
8
  s.authors = ["Lauri Lehmijoki"]
9
9
  s.email = ["lauri.lehmijoki@iki.fi"]
@@ -144,6 +144,16 @@ describe S3Website::Upload do
144
144
  end
145
145
  end
146
146
 
147
+ context 'the user specifies max-age as zero' do
148
+ let(:config) {{
149
+ 'max_age' => 0
150
+ }}
151
+
152
+ it 'includes the no-cache declaration in the cache-control metadata' do
153
+ subject.send(:upload_options)[:cache_control].should == 'no-cache, max-age=0'
154
+ end
155
+ end
156
+
147
157
  describe '#max_age' do
148
158
  it 'should be the universal value if one is set' do
149
159
  subject.send(:max_age).should == 300
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: s3_website
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.4
4
+ version: 1.4.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lauri Lehmijoki
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-03 00:00:00.000000000 Z
11
+ date: 2013-10-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk