1
0
mirror of https://github.com/JuanCanham/HackMyResume.git synced 2025-07-11 12:41:06 +01:00
This commit is contained in:
hacksalot
2016-01-17 21:46:58 -05:00
parent e9edc0d15c
commit c9e45d4991
17 changed files with 99 additions and 77 deletions

View File

@ -32,8 +32,8 @@ Definition of the ResumeFactory class.
/**
Load one or more resumes from disk.
@param opts An options object with settings for the factory as well as
passthrough settings for FRESHResume or JRSResume. Structure:
@param {Object} opts An options object with settings for the factory as well
as passthrough settings for FRESHResume or JRSResume. Structure:
{
format: 'FRESH', // Format to open as. ('FRESH', 'JRS', null)
@ -107,12 +107,15 @@ Definition of the ResumeFactory class.
// Read the file
eve && eve.stat( HME.beforeRead, { file: fileName });
rawData = FS.readFileSync( fileName, 'utf8' );
eve && eve.stat( HME.afterRead, { data: rawData });
eve && eve.stat( HME.afterRead, { file: fileName, data: rawData });
// Parse the file
eve && eve.stat( HME.beforeParse, { data: rawData });
var ret = { json: JSON.parse( rawData ) };
eve && eve.stat( HME.afterParse, { data: ret.json } );
var orgFormat = ( ret.json.meta && ret.json.meta.format &&
ret.json.meta.format.startsWith('FRESH@') ) ?
'fresh' : 'jrs';
eve && eve.stat( HME.afterParse, { file: fileName, data: ret.json, fmt: orgFormat } );
return ret;
}