Skip to content

Commit 07b61d7

Browse files
Merge pull request #497 from spezzino/issue/489
#489 Add proper javadoc comments to core/lib/plugin_manager.js
2 parents f3c64e3 + 29ea098 commit 07b61d7

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

core/lib/plugin_manager.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,21 @@ var plugin_manager = function (config, configPath) {
55
fs = require('fs-extra'),
66
util = require('./utilities');
77

8+
/**
9+
* Loads a plugin
10+
*
11+
* @param pluginName {string} the name of the plugin
12+
* @return {object} the loaded plugin
13+
*/
814
function loadPlugin(pluginName) {
915
return require(path.join(process.cwd(), 'node_modules', pluginName));
1016
}
1117

18+
/**
19+
* Installs a plugin
20+
*
21+
* @param pluginName {string} the name of the plugin
22+
*/
1223
function installPlugin(pluginName) {
1324
try {
1425
var pluginPath = path.resolve(
@@ -40,6 +51,11 @@ var plugin_manager = function (config, configPath) {
4051
}
4152
}
4253

54+
/**
55+
* Detect installed plugins
56+
*
57+
* @return {array} list of installed plugins
58+
*/
4359
function detectPlugins() {
4460
var node_modules_path = path.join(process.cwd(), 'node_modules');
4561
return fs.readdirSync(node_modules_path).filter(function (dir) {
@@ -48,10 +64,18 @@ var plugin_manager = function (config, configPath) {
4864
});
4965
}
5066

67+
/**
68+
* Disables an installed plugin
69+
* Not implemented yet
70+
*/
5171
function disablePlugin(pluginName) {
5272
console.log('disablePlugin not implemented yet. No change made to state of plugin', pluginName);
5373
}
5474

75+
/**
76+
* Enables an installed plugin
77+
* Not implemented yet
78+
*/
5579
function enablePlugin(pluginName) {
5680
console.log('enablePlugin not implemented yet. No change made to state of plugin', pluginName);
5781
}

0 commit comments

Comments
 (0)