From 29ea0981869b3c8441b7a2f8cf425d000f176b04 Mon Sep 17 00:00:00 2001 From: Stefano Pezzino Date: Fri, 30 Sep 2016 22:47:50 -0400 Subject: [PATCH] #489 Add proper javadoc comments to core/lib/plugin_manager.js --- core/lib/plugin_manager.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/core/lib/plugin_manager.js b/core/lib/plugin_manager.js index fdb331a5b..bafe3a2a4 100644 --- a/core/lib/plugin_manager.js +++ b/core/lib/plugin_manager.js @@ -5,10 +5,21 @@ var plugin_manager = function (config, configPath) { fs = require('fs-extra'), util = require('./utilities'); + /** + * Loads a plugin + * + * @param pluginName {string} the name of the plugin + * @return {object} the loaded plugin + */ function loadPlugin(pluginName) { return require(path.join(process.cwd(), 'node_modules', pluginName)); } + /** + * Installs a plugin + * + * @param pluginName {string} the name of the plugin + */ function installPlugin(pluginName) { try { var pluginPath = path.resolve( @@ -40,6 +51,11 @@ var plugin_manager = function (config, configPath) { } } + /** + * Detect installed plugins + * + * @return {array} list of installed plugins + */ function detectPlugins() { var node_modules_path = path.join(process.cwd(), 'node_modules'); return fs.readdirSync(node_modules_path).filter(function (dir) { @@ -48,10 +64,18 @@ var plugin_manager = function (config, configPath) { }); } + /** + * Disables an installed plugin + * Not implemented yet + */ function disablePlugin(pluginName) { console.log('disablePlugin not implemented yet. No change made to state of plugin', pluginName); } + /** + * Enables an installed plugin + * Not implemented yet + */ function enablePlugin(pluginName) { console.log('enablePlugin not implemented yet. No change made to state of plugin', pluginName); }