CLI is working, API not ready, Front broken

This commit is contained in:
Gaël Métais
2014-11-28 10:45:30 +01:00
parent b72e74e0d3
commit 1f83fe1b48
20 changed files with 1001 additions and 94 deletions
+38
View File
@@ -0,0 +1,38 @@
var Q = require('q');
var phantomasWrapper = require('./tools/phantomasWrapper');
var rulesChecker = require('./rulesChecker');
var Runner = function(params) {
'use strict';
// The pivot format
var data = {
params: params,
toolsResults: {}
};
// Execute Phantomas first
var run = phantomasWrapper.execute(data);
// Other tools go here
// Read each policy and save the results
run.then(function() {
var policies = require('./metadata/policies.json');
return rulesChecker.check(data, policies);
});
// TODO : error handler
/*run.catch(function(err) {
console.log('The run failed');
console.log(err);
});*/
run.done(data);
return run;
};
module.exports = Runner;