-
Notifications
You must be signed in to change notification settings - Fork 72
/
Copy pathapp.js
62 lines (53 loc) · 2.46 KB
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
var path = require('path');
var SomeHR = require('./src/SomeHR')();
require('colors');
console.log('Please, wait 2 sec to skip warnings'.bgRed.black);
setTimeout(main, 2000);
function main() {
console.log('------------------------------------------------------------------------------------'.bgBlue.blue);
console.log(' Somewhere in big & cool company... '.bgBlue.gray);
console.log('------------------------------------------------------------------------------------'.bgBlue.blue);
console.log('');
var getFileNames = function (filePaths) {
return filePaths.map(function (file) {
return path.basename(file);
}).join(', ');
};
var pack = __dirname + '/public';
SomeHR.iHaveCVPack(pack, function (err, files) {
var Iam = this,
ParseBoy,
savedFiles = 0;
if (err) {
return Iam.explainError(err);
}
if (!files.length) {
return Iam.nothingToDo();
}
SomeHR.say('My stack for today are: ' + getFileNames(files));
/** @type {ParseBoy} */
ParseBoy = Iam.needSomeoneToSortCV();
ParseBoy.willHelpWithPleasure(files, function (PreparedFile) {
ParseBoy.say('I\'m working with "' + PreparedFile.name + '" now');
ParseBoy.workingHardOn(PreparedFile, function (Resume) {
ParseBoy.say('I got Resume for ' + PreparedFile.name + ', now saving...');
ParseBoy.storeResume(PreparedFile, Resume, __dirname + '/compiled', function (err) {
if (err) {
return ParseBoy.explainError(err);
}
ParseBoy.say('Resume ' + PreparedFile.name + ' saved');
savedFiles += 1;
if (savedFiles == files.length) {
ParseBoy.say('I finished! Please, check "/compile" folder where you can find each parsed profile in JSON');
SomeHR.say('Thank you a lot! I can\'t even imagine, what would I do without your help, ParseBoy!');
ParseBoy.say('You are welcome, have a nice day!');
console.log('');
console.log('------------------------------------------------------------------------------------'.bgBlue.blue);
console.log(' The End! '.bgBlue.gray);
console.log('------------------------------------------------------------------------------------'.bgBlue.blue);
}
})
});
});
});
}