s3_website 2.8.4 → 2.8.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: 3eb61e148cba2a736188f4722ffe0f83c880c3e6
4
- data.tar.gz: 18d990870b6d1f84c41517ee3fdc84e3cb2d8d8f
3
+ metadata.gz: 0c1c51a6d20fed9c16cb904e23ad86da4e64921f
4
+ data.tar.gz: a688890124a62db4d3aed8cb42c4b84d2ffd6aae
5
5
  SHA512:
6
- metadata.gz: d9b477c47017a4c3d53c06201f473f595ece6bd1e656405907b3c4cbb1f79475e02c397ffae1d67c92a2b6770d7b68cf8e3eecbc2d7a9726e48ee974f4b8b41d
7
- data.tar.gz: e97b944a26585749bef90578ec657d9dff4b40835cdfa1cdb177f937ef5cc0e029a9905ccc965111b78a42a7637e3f1e2e2f4d4f49dc4b4426f1c48cda81b9bf
6
+ metadata.gz: 51f58e37ce1eb9a3913deb8fe6b0d201d65d1e8a56cfec93c322379ad1b38f9917b4b287a73f1be7da30a70e659680b7d62cab26ab9483e9ea5fbf6c88ea0dcf
7
+ data.tar.gz: 6768b7634e1ebc228ae50b90e298d586c42125e22cb5b3f57af3c5d7152425966dd8daeb52ee0dea853bdfa9445ab77ab3c500a3aa5a33206c0c0ae1d6ca610b
data/README.md CHANGED
@@ -214,6 +214,8 @@ When you run the command `s3_website cfg apply`, it will ask you whether you
214
214
  want to deliver your website via CloudFront. If you answer yes, the command will
215
215
  create a CloudFront distribution for you.
216
216
 
217
+ If you do not want to receive this prompt, or if you are running the command in a non-interactive session, you can use `s3_website cfg apply --headless`.
218
+
217
219
  #### Using your existing CloudFront distribution
218
220
 
219
221
  If you already have a CloudFront distribution that serves data from your website
@@ -434,6 +436,7 @@ exist.
434
436
  Contributors (in alphabetical order)
435
437
  * Alan deLevie
436
438
  * Almir Sarajčić
439
+ * Andrew T. Baker
437
440
  * Cory Kaufman-Schofield
438
441
  * Chris Kelly
439
442
  * Chris Moos
data/changelog.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  This project uses [Semantic Versioning](http://semver.org).
4
4
 
5
+ ## 2.8.5
6
+
7
+ * URL encode (ä|ö|ü) in invalidation path
8
+
5
9
  ## 2.8.4
6
10
 
7
11
  * URL encude ' in invalidation path
@@ -1,3 +1,3 @@
1
1
  module S3Website
2
- VERSION = '2.8.4'
2
+ VERSION = '2.8.5'
3
3
  end
@@ -1 +1 @@
1
- 27a71e14164456987612276f4e92bdad
1
+ 4e1ae1afeac51fc4390d05fcacf4fbe9
@@ -117,9 +117,16 @@ object CloudFront {
117
117
  def toInvalidationPath(report: PushSuccessReport) = "/" + report.s3Key
118
118
 
119
119
  def encodeUnsafeChars(invalidationPath: String) =
120
- new URI("http", "cloudfront", invalidationPath, "").toURL.getPath
120
+ new URI("http", "cloudfront", invalidationPath, "")
121
+ .toURL
122
+ .getPath
121
123
  .replaceAll("'", URLEncoder.encode("'", "UTF-8")) // CloudFront does not accept ' in invalidation path
122
-
124
+ .flatMap(chr => {
125
+ if (Seq("ä", "ö", "ü").contains(chr.toString.toLowerCase))
126
+ URLEncoder.encode(chr.toString, "UTF-8")
127
+ else
128
+ chr.toString
129
+ })
123
130
 
124
131
  def needsInvalidation: PartialFunction[PushSuccessReport, Boolean] = {
125
132
  case succ: SuccessfulUpload => succ.details.fold(_.uploadType, _.uploadType) == FileUpdate
@@ -207,6 +207,14 @@ class S3WebsiteSpec extends Specification {
207
207
  sentInvalidationRequest.getInvalidationBatch.getPaths.getItems.toSeq.sorted must equalTo(("/articles/arnold%27s%20file.html" :: Nil).sorted)
208
208
  }
209
209
 
210
+ "encode unsafe characters in the keys" in new BasicSetup {
211
+ config = "cloudfront_distribution_id: EGM1J2JJX9Z"
212
+ setLocalFile("articles/Äöü.html")
213
+ setOutdatedS3Keys("articles/Äöü.html")
214
+ push()
215
+ sentInvalidationRequest.getInvalidationBatch.getPaths.getItems.toSeq.sorted must equalTo(("/articles/%C3%84%C3%B6%C3%BC.html" :: Nil).sorted)
216
+ }
217
+
210
218
  "invalidate the root object '/' if a top-level object is updated or deleted" in new BasicSetup {
211
219
  config = "cloudfront_distribution_id: EGM1J2JJX9Z"
212
220
  setLocalFile("maybe-index.html")
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.8.4
4
+ version: 2.8.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: 2015-03-01 00:00:00.000000000 Z
11
+ date: 2015-04-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor