Comparing version 0.0.5 to 0.0.6
@@ -8,5 +8,6 @@ #!/usr/bin/env node | ||
.description('build PlantUML') | ||
.option('--scope <dir>', 'process directory') | ||
.action(function() { | ||
var builder = new Builder(); | ||
builder.buildProject(process.cwd()).then(function (project) { | ||
builder.buildProject(process.cwd(), args.scope).then(function (project) { | ||
var plantUml = new PlantUml(); | ||
@@ -18,5 +19,6 @@ console.log(plantUml.exportToPlantUml(project)); | ||
program.command('validate') | ||
.action(function() { | ||
.option('--scope <dir>', 'process directory') | ||
.action(function(args) { | ||
var builder = new Builder(); | ||
builder.buildProject(process.cwd()).then(function () { | ||
builder.buildProject(process.cwd(), args.scope).then(function () { | ||
builder.getErrorLog().report(); | ||
@@ -23,0 +25,0 @@ }).done(); |
@@ -15,3 +15,3 @@ var vowFs = require('vow-fs'); | ||
buildProject: function (projectDirectory) { | ||
buildProject: function (projectDirectory, scopes) { | ||
var configPath = projectDirectory + '/.analyze.js'; | ||
@@ -26,3 +26,9 @@ var config = new ProjectConfig(); | ||
} | ||
return this.build(config.getSourceRoots()); | ||
if (scopes) { | ||
config.addScopes(scopes); | ||
} | ||
if (!config.getScopes().length) { | ||
config.addScopes(config.getSourceRoots()); | ||
} | ||
return this.build(config.getScopes()); | ||
}.bind(this)); | ||
@@ -29,0 +35,0 @@ }, |
@@ -5,2 +5,3 @@ module.exports = require('inherit')({ | ||
this._sourceRoots = []; | ||
this._scopes = []; | ||
}, | ||
@@ -14,3 +15,15 @@ | ||
return this._sourceRoots; | ||
}, | ||
addScope: function (scope) { | ||
this._scopes.push(scope); | ||
}, | ||
addScopes: function (scopes) { | ||
this._scopes = this._scopes.concat(scopes); | ||
}, | ||
getScopes: function () { | ||
return this._scopes; | ||
} | ||
}); |
{ | ||
"author": "Marat Dulin", | ||
"name": "analyze", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"engines": { | ||
@@ -6,0 +6,0 @@ "node": "0.10" |
34729
958