s3_website 2.7.2 → 2.7.3
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0d697820d3714dc4f00c997a1424c199d8786691
|
4
|
+
data.tar.gz: 9929b4a2e0d951b8bb58556b0aebca80ee36a82c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f8c31db585bdc5d527b90dba36a21e73ec8520eb074feab11ba19aef1a6e01dc7b3faba1c209e720dc7cf0b2768c5cebeb1b97fff8314c8e3675ca3f4ea28766
|
7
|
+
data.tar.gz: 9057ccc704fcd6a31348b4acb36d85cb7f4e23c5236b5e22f2ae63689b4ba5e2c379ddbb0d5595ca1e1caab2b8a055f885a0d1c9317539cc639aea4b73f21bc3
|
data/changelog.md
CHANGED
data/lib/s3_website/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
41d397d8e99913ad389d18409f14dc64
|
@@ -80,14 +80,16 @@ case class Upload(originalFile: File, uploadType: UploadType)(implicit site: Sit
|
|
80
80
|
.right.map(respectMostSpecific)
|
81
81
|
.fold(
|
82
82
|
(seconds: Int) => Some(seconds),
|
83
|
-
(globs: GlobsSeq) =>
|
84
|
-
|
85
|
-
|
83
|
+
(globs: GlobsSeq) => {
|
84
|
+
val matchingMaxAge = (glob: String, maxAge: Int) =>
|
85
|
+
rubyRuntime.evalScriptlet(
|
86
86
|
s"""|# encoding: utf-8
|
87
|
-
|File.fnmatch('$
|
87
|
+
|File.fnmatch('$glob', "$s3Key")""".stripMargin)
|
88
88
|
.toJava(classOf[Boolean])
|
89
89
|
.asInstanceOf[Boolean]
|
90
|
-
|
90
|
+
val fileGlobMatch = globs find Function.tupled(matchingMaxAge)
|
91
|
+
fileGlobMatch map (_._2)
|
92
|
+
}
|
91
93
|
)
|
92
94
|
}
|
93
95
|
}
|
@@ -429,7 +429,7 @@ class S3WebsiteSpec extends Specification {
|
|
429
429
|
}
|
430
430
|
}
|
431
431
|
|
432
|
-
"
|
432
|
+
"max_age in config" can {
|
433
433
|
"be applied to all files" in new BasicSetup {
|
434
434
|
config = "max_age: 60"
|
435
435
|
setLocalFile("index.html")
|
@@ -437,6 +437,17 @@ class S3WebsiteSpec extends Specification {
|
|
437
437
|
sentPutObjectRequest.getMetadata.getCacheControl must equalTo("max-age=60")
|
438
438
|
}
|
439
439
|
|
440
|
+
"supports all valid URI characters in the glob setting" in new BasicSetup {
|
441
|
+
config = """
|
442
|
+
|max_age:
|
443
|
+
| "*.html": 90
|
444
|
+
""".stripMargin
|
445
|
+
val allValidUrlCharacters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~:/?#[]@!$&'()*+,;=" // See http://stackoverflow.com/a/1547940/990356 for discussion
|
446
|
+
setLocalFile(s"$allValidUrlCharacters.html")
|
447
|
+
push
|
448
|
+
sentPutObjectRequest.getMetadata.getCacheControl must equalTo("max-age=90")
|
449
|
+
}
|
450
|
+
|
440
451
|
"be applied to files that match the glob" in new BasicSetup {
|
441
452
|
config = """
|
442
453
|
|max_age:
|
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: 2.7.
|
4
|
+
version: 2.7.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lauri Lehmijoki
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|