summaryrefslogtreecommitdiffstats
path: root/lib/plugins/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/plugins/index.js')
-rw-r--r--lib/plugins/index.js16
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/plugins/index.js b/lib/plugins/index.js
index 14a323a..f26c63d 100644
--- a/lib/plugins/index.js
+++ b/lib/plugins/index.js
@@ -10,13 +10,19 @@ PluginsManager is an interface to work with multiple plugins at once:
- Call hooks for all plugins, etc
*/
-function PluginsManager(output) {
- this.output = output;
- this.book = output.book;
+function PluginsManager(book) {
+ this.book = book;
this.log = this.book.log;
this.plugins = [];
+
+ _.bindAll(this);
}
+// Return count of plugins loaded
+PluginsManager.prototype.count = function() {
+ return _.size(this.plugins);
+};
+
// Returns a plugin by its name
PluginsManager.prototype.get = function(name) {
return _.find(this.plugins, {
@@ -60,12 +66,12 @@ PluginsManager.prototype.load = function(name) {
// Setup a plugin
// Register its filter, blocks, etc
PluginsManager.prototype._setup = function(plugin) {
-
+ this.plugins.push(plugin);
};
// Install all plugins for the book
PluginsManager.prototype.install = function() {
-
+ this.log.info.ln('installing 0 plugins');
};
module.exports = PluginsManager;