s3_website 2.11.1 → 2.11.2

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: 5a112c263f78b49f6ef03c49c2bcbd1a87781153
4
- data.tar.gz: 8358ef0acf575f7c06877725eabbc377673b3cc6
3
+ metadata.gz: 92d89f42b813e2ab6e76df4a90e610446855d04a
4
+ data.tar.gz: ccd002dff60a5e0fe3fe2f267e8f54dc097b70ca
5
5
  SHA512:
6
- metadata.gz: 5efa714adc8a6f6432f8791224b336dc763d3526d566e678c6f8d36add56777f5f0df097bfbe38189a622e1f4a69a107899b45a6014dc525ceec243095e25f1c
7
- data.tar.gz: 06307dd8c0ef1dd324ca207f4d22eba8452a1101ccb16349e0c672d4ae344aa96d314775c6985bd49217aab2eb2d7b74a2d344df434ffc13193e605d1b5f794d
6
+ metadata.gz: 805cf02a27b76ffcc325f042fa36a418517248283f65f4763a522736659c85cbf27ebf77de97248cc994ee2ff4c72eb7141187ff96c60145304e65727a2e660d
7
+ data.tar.gz: 269d27d08c42d22af52e521b35a9eb8f6189d01b5a662769d24748c4ebb79b7531b2cae29e14657872fe0e92545d946992e46079433ef133837ece79001b68d1
data/changelog.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  This project uses [Semantic Versioning](http://semver.org).
4
4
 
5
+ ## 2.11.2
6
+
7
+ * A new fix based on
8
+ <https://github.com/laurilehmijoki/s3_website/issues/181#issuecomment-141397992>
9
+
5
10
  ## 2.11.1
6
11
 
7
12
  * Prevent runaway recursion in file listing
@@ -1,3 +1,3 @@
1
1
  module S3Website
2
- VERSION = '2.11.1'
2
+ VERSION = '2.11.2'
3
3
  end
@@ -101,7 +101,7 @@ object Site {
101
101
  | site: dist/website""".stripMargin
102
102
 
103
103
  def resolveSiteDir(implicit yamlConfig: S3_website_yml, config: Config, cliArgs: CliArgs, workingDirectory: File): Either[ErrorReport, File] = {
104
- val siteFromAutoDetect = autodetectSiteDir(workingDirectory)
104
+ val siteFromAutoDetect = if (config.site.isEmpty) { autodetectSiteDir(workingDirectory) } else { None }
105
105
  val errOrSiteFromCliArgs: Either[ErrorReport, Option[File]] = Option(cliArgs.site) match {
106
106
  case Some(siteDirFromCliArgs) =>
107
107
  val f = new File(siteDirFromCliArgs)
@@ -119,10 +119,10 @@ object Upload {
119
119
  }
120
120
 
121
121
  object Files {
122
- def recursiveListFiles(maxDepth: Int = Integer.MAX_VALUE)(f: File): Seq[File] = {
122
+ def recursiveListFiles(f: File): Seq[File] = {
123
123
  val these = f.listFiles
124
124
  if (these != null)
125
- these ++ these.filter(_.isDirectory).flatMap(recursiveListFiles(maxDepth - 1))
125
+ these ++ these.filter(_.isDirectory).flatMap(recursiveListFiles)
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,10 +11,8 @@ 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
-
16
14
  def autodetectSiteDir(workingDirectory: File): Option[File] =
17
- recursiveListFiles(maxAutodetectDepth)(workingDirectory).find { file =>
15
+ recursiveListFiles(workingDirectory).find { file =>
18
16
  file.isDirectory && automaticallySupportedSiteGenerators.exists(ssg => file.getAbsolutePath.endsWith(ssg.outputDirectory))
19
17
  }
20
18
  }
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.11.1
4
+ version: 2.11.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lauri Lehmijoki