s3_website 2.11.0 → 2.11.1

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: 7df2add8f3589b718b7f8f1eca3cde4b7d03112b
4
- data.tar.gz: eba43c04b20fc754a8cfe7c69b2a4cc596c03acd
3
+ metadata.gz: 5a112c263f78b49f6ef03c49c2bcbd1a87781153
4
+ data.tar.gz: 8358ef0acf575f7c06877725eabbc377673b3cc6
5
5
  SHA512:
6
- metadata.gz: 26d815278b9d10e2238f52445436d8fd740d1415244c95c16dc3bf9563697ca68a1a82b943810ddf895389bd3d045cbdd27e72bc15503c970f564bd031b1bb14
7
- data.tar.gz: 96f3b42495fc67196253d39d2614f9a3154b508962adf9b692141fed8152f03298cf9495482a0ea383d5ea382a2364a683e335191934c4cf0d1b0646b42513a0
6
+ metadata.gz: 5efa714adc8a6f6432f8791224b336dc763d3526d566e678c6f8d36add56777f5f0df097bfbe38189a622e1f4a69a107899b45a6014dc525ceec243095e25f1c
7
+ data.tar.gz: 06307dd8c0ef1dd324ca207f4d22eba8452a1101ccb16349e0c672d4ae344aa96d314775c6985bd49217aab2eb2d7b74a2d344df434ffc13193e605d1b5f794d
data/changelog.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  This project uses [Semantic Versioning](http://semver.org).
4
4
 
5
+ ## 2.11.1
6
+
7
+ * Prevent runaway recursion in file listing
8
+
9
+ See <https://github.com/laurilehmijoki/s3_website/issues/181> for discussion
10
+
5
11
  ## 2.11.0
6
12
 
7
13
  * Add the `s3_key_prefix` setting
@@ -1,3 +1,3 @@
1
1
  module S3Website
2
- VERSION = '2.11.0'
2
+ VERSION = '2.11.1'
3
3
  end
@@ -119,10 +119,10 @@ object Upload {
119
119
  }
120
120
 
121
121
  object Files {
122
- def recursiveListFiles(f: File): Seq[File] = {
122
+ def recursiveListFiles(maxDepth: Int = Integer.MAX_VALUE)(f: File): Seq[File] = {
123
123
  val these = f.listFiles
124
124
  if (these != null)
125
- these ++ these.filter(_.isDirectory).flatMap(recursiveListFiles)
125
+ these ++ these.filter(_.isDirectory).flatMap(recursiveListFiles(maxDepth - 1))
126
126
  else
127
127
  Nil
128
128
  }
@@ -137,7 +137,7 @@ object Files {
137
137
  if (doNotUpload) logger.debug(s"Excluded $s3Key from upload")
138
138
  doNotUpload
139
139
  }
140
- recursiveListFiles(site.rootDirectory)
140
+ recursiveListFiles()(site.rootDirectory)
141
141
  .filterNot(_.isDirectory)
142
142
  .filterNot(f => excludeFromUpload(site.resolveS3Key(f)))
143
143
  }
@@ -11,8 +11,10 @@ trait Ssg {
11
11
  object Ssg {
12
12
  val automaticallySupportedSiteGenerators = Jekyll :: Nanoc :: Nil
13
13
 
14
+ val maxAutodetectDepth = automaticallySupportedSiteGenerators.map(_.outputDirectory).map(_.split(File.separatorChar).length).max
15
+
14
16
  def autodetectSiteDir(workingDirectory: File): Option[File] =
15
- recursiveListFiles(workingDirectory).find { file =>
17
+ recursiveListFiles(maxAutodetectDepth)(workingDirectory).find { file =>
16
18
  file.isDirectory && automaticallySupportedSiteGenerators.exists(ssg => file.getAbsolutePath.endsWith(ssg.outputDirectory))
17
19
  }
18
20
  }
@@ -22,5 +24,5 @@ case object Jekyll extends Ssg {
22
24
  }
23
25
 
24
26
  case object Nanoc extends Ssg {
25
- def outputDirectory = "public/output"
27
+ def outputDirectory = s"public${File.separatorChar}output"
26
28
  }
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.11.0
4
+ version: 2.11.1
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-07-27 00:00:00.000000000 Z
11
+ date: 2015-09-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor