s3_website_monadic 0.0.7 → 0.0.8

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: 714e16805c804d5b86d6097a85ba4ec85a4dee14
4
- data.tar.gz: fd750b7d7de92913e893104d5945cfb78184d511
3
+ metadata.gz: 39f140d0639eb128178c9ec33176ea0f4a842904
4
+ data.tar.gz: 95e6aae697bf30b9134180521540948f49051b15
5
5
  SHA512:
6
- metadata.gz: 403cb29f93d49f16f36dd52e72f4f7f6fd897137f8b485cd7940eedbc59940528b054a051b971e9e35098155dfb4afc79cc3f284b15b6395736a7bd250152d42
7
- data.tar.gz: 1c10547952fa577f6d574d6b08aad9849a3746a723952c1262a53db05c27dcb0851c682cbc505630964840494bf513337c2b6c448292417d6bf4f73d4a14a930
6
+ metadata.gz: 9779e122e2d5cef1d51e8e085e2ec41882d98f277b9bccabb9afeab065d8ecdc61380a0ac39fb7eb968d03a7d8d1631f45fbbb60c0e79a1264f9c1a65d1b9a60
7
+ data.tar.gz: 5f501c7f29b0b92d7949f465d965693e3a1ec7dd863dec2135eb7d667c67cbf9a3ed3cd11543e17d61c557af1a4f968fa49f08165fe2631707b0c0142b4eabbf
data/s3_website.gemspec CHANGED
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "s3_website_monadic"
6
- s.version = "0.0.7"
6
+ s.version = "0.0.8"
7
7
  s.platform = Gem::Platform::RUBY
8
8
  s.authors = ["Lauri Lehmijoki"]
9
9
  s.email = ["lauri.lehmijoki@iki.fi"]
@@ -139,7 +139,7 @@ object Config {
139
139
  unsafeYaml.yamlObject.asInstanceOf[java.util.Map[String, _]].toMap get key
140
140
  }
141
141
 
142
- def erbEval(erbString: String): Try[String] = Try {
142
+ def erbEval(erbString: String, yamlConfigPath: String): Try[String] = Try {
143
143
  val erbStringWithoutComments = erbString.replaceAll("^\\s*#.*", "")
144
144
  rubyRuntime.evalScriptlet(
145
145
  s"""
@@ -151,6 +151,9 @@ object Config {
151
151
  |ERB.new(str).result
152
152
  """.stripMargin
153
153
  ).asJavaString()
154
+ } match {
155
+ case Failure(err) => Failure(new RuntimeException(s"Failed to parse ERB in $yamlConfigPath:\n${err.getMessage}"))
156
+ case x => x
154
157
  }
155
158
 
156
159
  case class UnsafeYaml(yamlObject: AnyRef)
@@ -20,7 +20,7 @@ object Site {
20
20
  def loadSite(yamlConfigPath: String, siteRootDirectory: String): Either[ErrorReport, Site] = {
21
21
  val yamlObjectTry = for {
22
22
  yamlString <- Try(fromFile(new File(yamlConfigPath)).mkString)
23
- yamlWithErbEvaluated <- erbEval(yamlString)
23
+ yamlWithErbEvaluated <- erbEval(yamlString, yamlConfigPath)
24
24
  yamlObject <- Try(new Yaml() load yamlWithErbEvaluated)
25
25
  } yield yamlObject
26
26
  yamlObjectTry match {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: s3_website_monadic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lauri Lehmijoki