1 var Class = require("../../mootools/mootools-node.js").Class; 2 var IResourceCache = require('./IResourceCache.js').IResourceCache; 3 4 /** 5 * @class In-memory resource Cache for Stylus Templates 6 * @extends IResourceCache 7 * @requires Class 8 * @requires IResourceCache 9 * 10 * @param {Object} configuration 11 */ 12 var StylusCache = function(){ 13 14 /** @ignore */ 15 this.Implements = IResourceCache; 16 17 /** @ignore */ 18 this.initialize = function(configuration){ 19 this._configuration = configuration; 20 GLOBAL['stylus'] = {}; 21 }; 22 23 /** 24 * cache resource in memory 25 * 26 * @param {String} path 27 * @param {String} contents 28 */ 29 this.cache = function(path, contents){ 30 console.log('Caching Stylus template: ' + path); 31 32 // caching stylus template 33 GLOBAL['stylus'][path] = contents; 34 }; 35 }; 36 37 StylusCache = new Class(new StylusCache()); 38 exports.StylusCache = StylusCache;