From d455c6c332f41c73b9c9d42f21747919f28501cf Mon Sep 17 00:00:00 2001 From: gered Date: Sun, 1 Jun 2014 16:54:03 -0400 Subject: [PATCH] move options atom to avoid an upcoming circular dependency issue --- src/clj_jtwig/core.clj | 20 ++------------------ src/clj_jtwig/options.clj | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+), 18 deletions(-) create mode 100644 src/clj_jtwig/options.clj diff --git a/src/clj_jtwig/core.clj b/src/clj_jtwig/core.clj index aa7ee1f..12949c9 100644 --- a/src/clj_jtwig/core.clj +++ b/src/clj_jtwig/core.clj @@ -7,24 +7,8 @@ (java.net URL)) (:require [clojure.walk :refer [stringify-keys]]) (:use [clj-jtwig.functions] - [clj-jtwig.utils])) - -; global options -(defonce options (atom {; true/false to enable/disable compiled template caching when using templates from - ; files only. this does not affect templates being rendered directly from strings - :cache-compiled-templates true - - ; true/false to enable/disable file status checks (existance of file and last modification - ; date/time check). if true, these checks will be skipped ONLY if a compiled template for - ; the filepath given is cached already. if this is true and an attempt is made to render - ; a template which is not yet cached, these checks will still be run (this is to ensure that - ; templates can still be loaded and compiled the first time they are rendered). - ; if caching is completely disabled (via the above option), then this setting is ignored and - ; file status checks will always be performed. - ; this option is intended to help increase performance when you know in advance that your - ; templates will not be modified/deleted after they are first compiled and you want to skip - ; any unnecessary file I/O. - :skip-file-status-checks false})) + [clj-jtwig.utils] + [clj-jtwig.options])) (declare flush-template-cache!) diff --git a/src/clj_jtwig/options.clj b/src/clj_jtwig/options.clj new file mode 100644 index 0000000..b20f52c --- /dev/null +++ b/src/clj_jtwig/options.clj @@ -0,0 +1,20 @@ +(ns clj-jtwig.options) + +; global options +(defonce options + (atom + {; true/false to enable/disable compiled template caching when using templates from + ; files only. this does not affect templates being rendered directly from strings + :cache-compiled-templates true + + ; true/false to enable/disable file status checks (existance of file and last modification + ; date/time check). if true, these checks will be skipped ONLY if a compiled template for + ; the filepath given is cached already. if this is true and an attempt is made to render + ; a template which is not yet cached, these checks will still be run (this is to ensure that + ; templates can still be loaded and compiled the first time they are rendered). + ; if caching is completely disabled (via the above option), then this setting is ignored and + ; file status checks will always be performed. + ; this option is intended to help increase performance when you know in advance that your + ; templates will not be modified/deleted after they are first compiled and you want to skip + ; any unnecessary file I/O. + :skip-file-status-checks false})) \ No newline at end of file