annotate modules.js @ 24:b80ab94da447

Add new modules files.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Mon, 01 Nov 2010 00:02:27 +0100
parents
children b2faacfefb90
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
24
b80ab94da447 Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
1 var modules = exports;
b80ab94da447 Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
2
b80ab94da447 Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
3 var files = require('fs').readdirSync('modules');
b80ab94da447 Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
4 var regex = /^mod_.*\.js/;
b80ab94da447 Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
5
b80ab94da447 Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
6 for (var i in files) {
b80ab94da447 Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
7 var file = files[i];
b80ab94da447 Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
8 if (!regex.test(file))
b80ab94da447 Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
9 continue;
b80ab94da447 Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
10
b80ab94da447 Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
11 var module = require('./modules/' + files[i]);
b80ab94da447 Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
12 for (var j in module)
b80ab94da447 Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
13 modules[j] = module[j];
b80ab94da447 Add new modules files.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff changeset
14 }