Permalink
Browse files

using index file, made preheat pass thru hotplates to allow chaining,…

… renamed reheat tests
  • Loading branch information...
thlorenz committed Aug 25, 2012
1 parent a84fd69 commit 2c5e5e341c3a774b012428c480c7b1d8acb85e1d
Showing with 13 additions and 12 deletions.
  1. +4 −6 examples/app.js
  2. +4 −5 examples/server.js
  3. +2 −0 index.js
  4. +1 −1 package.json
  5. +2 −0 preheat.js
  6. 0 test/{hotplates.preheat.js → preheat.js}
View
@@ -1,12 +1,12 @@
-var hotplates = require('../hotplates')
- , preheat = require('../preheat')
+var hotplates = require('..')
, handlebars = require('handlebars')
, path = require('path')
, fs = require('fs')
, exec = require('child_process').exec
;
-preheat(
+hotplates
+ .preheat(
{ amd: true
, handlebarsPath: '../node_modules/handlebars'
, target: path.join(__dirname, 'preheated.js')
@@ -15,9 +15,7 @@ preheat(
if (err) console.error(err);
else console.log('preheated templates');
}
- );
-
-hotplates
+ )
.on('templateCompiled', function (fileInfo, name) {
console.log('Compiled: \t[ %s ] as [ %s ]', fileInfo.path, name);
})
View
@@ -1,4 +1,4 @@
-var hotplates = require('../hotplates')
+var hotplates = require('..')
, preheat = require('../preheat')
, handlebars = require('handlebars')
, path = require('path')
@@ -41,7 +41,8 @@ function serveSite () {
console.log('Server running at localhost:', PORT);
}
-preheat(
+hotplates
+ .preheat(
{ amd: true
, handlebarsPath: '../node_modules/handlebars'
, target: path.join(__dirname, 'preheated.js')
@@ -50,9 +51,7 @@ preheat(
if (err) console.error(err);
else console.log('preheated templates');
}
- );
-
-hotplates
+ )
.on('templateCompiled', function (fileInfo, name) {
console.log('Compiled: \t[ %s ] as [ %s ]', fileInfo.path, name);
})
View
@@ -0,0 +1,2 @@
+module.exports = require('./hotplates');
+module.exports.preheat = require('./preheat');
View
@@ -2,7 +2,7 @@
"name": "hotplates",
"version": "0.4.0",
"description": "Compiles and stores handlebars templates and registers partials for faster view resolution.",
- "main": "hotplates.js",
+ "main": "index.js",
"scripts": {
"test": "mocha"
},
View
@@ -50,6 +50,8 @@ function preheat(opts, cb) {
batching = false;
update();
});
+
+ return hotplates;
}
function update () {
File renamed without changes.

0 comments on commit 2c5e5e3

Please sign in to comment.