Added Robo task for precompiling Mustache cache

This commit is contained in:
Andrey Savchenko committed 2015-04-06 09:45:44 +03:00
1 parent b87ce58f4a
commit fb7b2f025a
1 file changed
+19
+19
View File
@@ -1,5 +1,7 @@
<?php <?php
require __DIR__ . '/vendor/autoload.php';
/** /**
* This is project's console commands configuration for Robo task runner. * This is project's console commands configuration for Robo task runner.
* *
@@ -29,6 +31,7 @@ class RoboFile extends \Robo\Tasks {
$this->makeCss(); $this->makeCss();
$this->makeJs(); $this->makeJs();
$this->makeMustache();
} }
/** /**
@@ -57,4 +60,20 @@ class RoboFile extends \Robo\Tasks {
$this->taskMinify( 'js/laps.js' ) $this->taskMinify( 'js/laps.js' )
->run(); ->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' );
}
} }