JSDOC/Packer.js
authoralan <alan@desktop.akbkhome.com>
Wed, 28 Apr 2010 05:29:01 +0000 (13:29 +0800)
committeralan <alan@desktop.akbkhome.com>
Wed, 28 Apr 2010 05:29:01 +0000 (13:29 +0800)
JSDOC/Packer.js

index 8694fb7..c60f089 100644 (file)
@@ -127,7 +127,23 @@ Packer.prototype = {
     
     loadSourceFile : function()
     {
-        var lines = File.read(this.srcfile).split("\n");;
+        var lines = File.read(this.srcfile).split("\n");
+        var _this = this;
+        lines.forEach(function(f) {
+            
+            if (/^\s*\//.test(f) || !/[a-z]+/i.test(f)) { // skip comments..
+                continue;
+            }
+            if (/\.js$/.test(f)) {
+                _this.files.push( f);
+                // js file..
+                continue;
+            }
+            
+            //println("ADD"+ f.replace(/\./g, '/'));
+            _this.files.push( f.replace(/\./g, '/').replace(/\s+/g,'')+'.js');
+            
+        })
     },