From fb7b2f025a1e64b9ca7e69e2518063717823caec Mon Sep 17 00:00:00 2001 From: Andrey Savchenko Date: Mon, 6 Apr 2015 09:45:44 +0300 Subject: [PATCH] Added Robo task for precompiling Mustache cache --- RoboFile.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/RoboFile.php b/RoboFile.php index 93e74ce..2f30ef0 100644 --- a/RoboFile.php +++ b/RoboFile.php @@ -1,5 +1,7 @@ makeCss(); $this->makeJs(); + $this->makeMustache(); } /** @@ -57,4 +60,20 @@ class RoboFile extends \Robo\Tasks { $this->taskMinify( 'js/laps.js' ) ->run(); } + + /** + * Compiles plugin's mustache template + */ + public function makeMustache() { + $dir = __DIR__ . '/views/cache'; + $this->_cleanDir( $dir ); + + $mustache = new \Mustache_Engine( + array( + 'loader' => new \Mustache_Loader_FilesystemLoader( __DIR__ . '/views' ), + 'cache' => $dir, + ) + ); + $mustache->loadTemplate( 'laps' ); + } } \ No newline at end of file