Skip to content

Commit

Permalink
[plugins] provide a way to extend modules without plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
ar2rsawseen committed Sep 22, 2015
1 parent 6e67b42 commit 6ab1af4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions extend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore
6 changes: 6 additions & 0 deletions plugins/pluginManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@ var pluginManager = function pluginManager(){
};

this.extendModule = function(name, object){
//global extend
try{
require("../extend/"+name)(object);
} catch (ex) {}

//plugin specific extend
for(var i = 0, l = plugins.length; i < l; i++){
try{
require("./"+plugins[i]+"/extend/"+name)(object);
Expand Down

0 comments on commit 6ab1af4

Please sign in to comment.