This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Add report function so we can see the modules that have been

included/excluded
  • Loading branch information...
joewalker committed Jun 22, 2011
1 parent 37c52bd commit 8f3cf58433ee05e8c65c5c3ddeb03d415acd0f23
Showing with 32 additions and 1 deletion.
  1. +31 −0 lib/dryice/index.js
  2. +1 −1 package.json
View
@@ -262,6 +262,37 @@ function CommonJsProject(roots) {
}
(function() {
+ CommonJsProject.prototype.report = function() {
+ var reply = 'CommonJS project at ' + this.roots.join(', ') + '\n';
+
+ reply += '- Required modules:\n';
+ var moduleNames = Object.keys(this.currentFiles);
+ if (moduleNames.length > 0) {
+ moduleNames.forEach(function(module) {
+ var deps = Object.keys(this.currentFiles[module].deps).length;
+ reply += ' - ' + module + ' (' + deps +
+ (deps === 1 ? ' dependency' : ' dependencies') + ')\n';
+ }, this);
+ }
+ else {
+ reply += ' - None\n';
+ }
+
+ reply += '- Ignored modules:\n';
+ var ignoredNames = Object.keys(this.ignoredFiles);
+ if (ignoredNames.length > 0) {
+ ignoredNames.forEach(function(module) {
+ var deps = this.ignoredFiles[module].deps.length;
+ reply += ' - ' + module + '\n';
+ }, this);
+ }
+ else {
+ reply += ' - None\n';
+ }
+
+ return reply;
+ };
+
CommonJsProject.prototype.assumeAllFilesLoaded = function() {
Object.keys(this.currentFiles).forEach(function(module) {
this.ignoredFiles[module] = this.currentFiles[module];
View
@@ -2,7 +2,7 @@
"name": "dryice",
"description": "A CommonJS/RequireJS packaging tool for browser scripts",
"keywords": [ "build", "requirejs" ],
- "version": "0.2.4",
+ "version": "0.2.5",
"homepage": "https://github.com/mozilla/dryice",
"author": "Joe Walker <joe@getahead.org>",
"contributors": [ ],

0 comments on commit 8f3cf58

Please sign in to comment.