From 750ab894825eb98c36440084895018bd928f114a Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Sun, 6 Aug 2017 14:59:19 -0400 Subject: [PATCH] Don't cache includes --- src/main/kotlin/net/shadowfacts/ekt/EKT.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/net/shadowfacts/ekt/EKT.kt b/src/main/kotlin/net/shadowfacts/ekt/EKT.kt index e32da6b..1a8a1e6 100644 --- a/src/main/kotlin/net/shadowfacts/ekt/EKT.kt +++ b/src/main/kotlin/net/shadowfacts/ekt/EKT.kt @@ -29,7 +29,7 @@ val _env = bindings["_env"] as net.shadowfacts.ekt.EKT.TemplateEnvironment val _result = StringBuilder() fun echo(it: Any) { _result.append(it) } fun include(include: String) { - val env = net.shadowfacts.ekt.EKT.TemplateEnvironment(include, _env) + val env = net.shadowfacts.ekt.EKT.TemplateEnvironment(include, _env, cacheDir = null) echo(net.shadowfacts.ekt.EKT.render(env, env.include)) } """ @@ -139,12 +139,12 @@ _result.toString() constructor(name: String, templateDir: File, includeDir: File, cacheDir: File?, init: DataProvider.() -> Unit): this(name, templateDir, includeDir, cacheDir, DataProvider.init(init)) - constructor(name: String, parent: TemplateEnvironment) { + constructor(name: String, parent: TemplateEnvironment, cacheDir: File? = parent.cacheDir) { this.rootName = parent.rootName this.name = name this.templateDir = parent.templateDir this.includeDir = parent.includeDir - this.cacheDir = parent.cacheDir + this.cacheDir = cacheDir this.data = parent.data }