Permalink
Browse files

Add a requireAll to minispade

  • Loading branch information...
wycats committed Apr 30, 2012
1 parent 4bccae7 commit d70b8e369efb9fe829b478f2418a8e32098c5b40
Showing with 8 additions and 0 deletions.
  1. +8 −0 lib/main.js
View
@@ -43,6 +43,14 @@ if (typeof document !== "undefined") {
return loaded;
},
+ requireAll: function(regex) {
+ for (var module in this.modules) {
+ if (!this.modules.hasOwnProperty(module)) { continue; }
+ if (regex && !regex.test(module)) { continue; }
+ minispade.require(module);
+ }
+ },
+
register: function(name, callback) {
minispade.modules[name] = callback;
}

0 comments on commit d70b8e3

Please sign in to comment.