Permalink
Browse files

Loading helpers too

  • Loading branch information...
1 parent c024905 commit 7145da8d8e5fdda7c9df3072c60ac242fa95413d @chetan51 committed Jan 5, 2011
Showing with 18 additions and 1 deletion.
  1. +18 −1 lib/ni.js
View
@@ -81,15 +81,17 @@ var Ni = function() {
bootStrapModels(Ni.config('root'), this.parallel());
bootStrapViews(Ni.config('root'), this.parallel());
bootStrapLibraries(Ni.config('root'), this.parallel());
+ bootStrapHelpers(Ni.config('root'), this.parallel());
},
- function buildNi(err, controllers, models, views, libraries) {
+ function buildNi(err, controllers, models, views, libraries, helpers) {
if (err) throw err;
Ni.controllers = controllers;
Ni.models = models;
Ni.views = views;
Ni.libraries = libraries;
+ Ni.helpers = helpers;
callback();
}
@@ -404,6 +406,21 @@ function bootStrapLibraries(__root, callback) {
}
/*
+ * Loads helpers.
+ */
+
+function bootStrapHelpers(__root, callback) {
+
+ bootStrapModules(__root + '/helpers', function(err, helpers) {
+
+ if (err) throw err;
+ callback(null, helpers);
+
+ });
+
+}
+
+/*
* Loads anything that is represented as a Node.js module.
* This includes controllers, models, libraries and helpers.
*/

0 comments on commit 7145da8

Please sign in to comment.