s3_website 2.8.5 → 2.8.6

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: 0c1c51a6d20fed9c16cb904e23ad86da4e64921f
4
- data.tar.gz: a688890124a62db4d3aed8cb42c4b84d2ffd6aae
3
+ metadata.gz: 147c1079964479122eef8b8c049d8c14795b7605
4
+ data.tar.gz: 4fac5c7fe84796797d2a242656f504be508caa52
5
5
  SHA512:
6
- metadata.gz: 51f58e37ce1eb9a3913deb8fe6b0d201d65d1e8a56cfec93c322379ad1b38f9917b4b287a73f1be7da30a70e659680b7d62cab26ab9483e9ea5fbf6c88ea0dcf
7
- data.tar.gz: 6768b7634e1ebc228ae50b90e298d586c42125e22cb5b3f57af3c5d7152425966dd8daeb52ee0dea853bdfa9445ab77ab3c500a3aa5a33206c0c0ae1d6ca610b
6
+ metadata.gz: df826a2926ecb33997c516c8dcf4f9a8af7f92a05cd0f1af5c18b7b8c860781a784c160ad139d5f7c927a23820e3bf72bd6235d74ce62c13b59cef445594c85e
7
+ data.tar.gz: 796902606cb3a9c1aec1fb69a76decdbf6919b8bcfde45708444dc23dbefa964133b9b12d247dc2969bac9691375c9553fc65c561ddeadc21a0852d365055b20
data/changelog.md CHANGED
@@ -2,13 +2,19 @@
2
2
 
3
3
  This project uses [Semantic Versioning](http://semver.org).
4
4
 
5
+ ## 2.8.6
6
+
7
+ * Detect changed file even though the file has the same contents with another file on the S3 bucket
8
+
9
+ See <https://github.com/laurilehmijoki/s3_website/issues/156> for discussion.
10
+
5
11
  ## 2.8.5
6
12
 
7
13
  * URL encode (ä|ö|ü) in invalidation path
8
14
 
9
15
  ## 2.8.4
10
16
 
11
- * URL encude ' in invalidation path
17
+ * URL encode ' in invalidation path
12
18
 
13
19
  See <https://github.com/laurilehmijoki/s3_website/issues/63> for discussion.
14
20
 
@@ -1,3 +1,3 @@
1
1
  module S3Website
2
- VERSION = '2.8.5'
2
+ VERSION = '2.8.6'
3
3
  end
@@ -1 +1 @@
1
- 4e1ae1afeac51fc4390d05fcacf4fbe9
1
+ a5dff84ae39e23dae2a6fd3edfa51823
@@ -24,10 +24,10 @@ object UploadHelper {
24
24
  errorOrS3Files.right.flatMap { s3Files =>
25
25
  Try {
26
26
  val s3KeyIndex = s3Files.map(_.s3Key).toSet
27
- val s3Md5Index = s3Files.map(_.md5).toSet
27
+ val s3Md5Index = s3Files.map(s3File => (s3File.s3Key, s3File.md5)).toSet
28
28
  val siteFiles = listSiteFiles
29
29
  val existsOnS3 = (f: File) => s3KeyIndex contains site.resolveS3Key(f)
30
- val isChangedOnS3 = (upload: Upload) => !(s3Md5Index contains upload.md5.get)
30
+ val isChangedOnS3 = (upload: Upload) => !(s3Md5Index contains (upload.s3Key, upload.md5.get))
31
31
  val newUploads = siteFiles collect {
32
32
  case file if !existsOnS3(file) => Upload(file, NewFile)
33
33
  }
@@ -83,6 +83,14 @@ class S3WebsiteSpec extends Specification {
83
83
  noUploadsOccurred must beTrue
84
84
  }
85
85
 
86
+ "detect a changed file even though another file has the same contents as the changed file" in new BasicSetup {
87
+ setLocalFilesWithContent(("1.txt", "foo"), ("2.txt", "foo"))
88
+ setS3File("1.txt", md5Hex("bar"))
89
+ setS3File("2.txt", md5Hex("foo"))
90
+ push()
91
+ sentPutObjectRequest.getKey must equalTo("1.txt")
92
+ }
93
+
86
94
  "update a file if it has changed" in new BasicSetup {
87
95
  setLocalFileWithContent(("index.html", "<h1>old text</h1>"))
88
96
  setS3File("index.html", md5Hex("<h1>new text</h1>"))
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: s3_website
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.5
4
+ version: 2.8.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lauri Lehmijoki