mirror of
https://github.com/JuanCanham/HackMyResume.git
synced 2024-11-25 09:50:11 +00:00
Remove explicit logger and error handler params.
This commit is contained in:
parent
4c954b79df
commit
bd8b587c5b
@ -37,16 +37,15 @@ Implementation of the 'analyze' verb for HackMyResume.
|
|||||||
/**
|
/**
|
||||||
Run the 'analyze' command.
|
Run the 'analyze' command.
|
||||||
*/
|
*/
|
||||||
function analyze( sources, dst, opts, logger ) {
|
function analyze( sources, dst, opts ) {
|
||||||
this.stat('begin');
|
this.stat('begin');
|
||||||
var _log = logger || console.log;
|
|
||||||
if( !sources || !sources.length ) throw { fluenterror: 3 };
|
if( !sources || !sources.length ) throw { fluenterror: 3 };
|
||||||
var nlzrs = _loadInspectors();
|
var nlzrs = _loadInspectors();
|
||||||
_.each(sources, function(src) {
|
_.each(sources, function(src) {
|
||||||
var result = ResumeFactory.loadOne( src, {
|
var result = ResumeFactory.loadOne( src, {
|
||||||
log: _log, format: 'FRESH', objectify: true, throw: false
|
format: 'FRESH', objectify: true, throw: false
|
||||||
});
|
});
|
||||||
result.error || _analyze.call(this, result, nlzrs, opts, _log );
|
result.error || _analyze.call(this, result, nlzrs, opts );
|
||||||
}, this);
|
}, this);
|
||||||
this.stat('end');
|
this.stat('end');
|
||||||
}
|
}
|
||||||
@ -56,7 +55,7 @@ Implementation of the 'analyze' verb for HackMyResume.
|
|||||||
/**
|
/**
|
||||||
Analyze a single resume.
|
Analyze a single resume.
|
||||||
*/
|
*/
|
||||||
function _analyze( resumeObject, nlzrs, opts, log ) {
|
function _analyze( resumeObject, nlzrs, opts ) {
|
||||||
var rez = resumeObject.rez;
|
var rez = resumeObject.rez;
|
||||||
var safeFormat =
|
var safeFormat =
|
||||||
(rez.meta && rez.meta.format && rez.meta.format.startsWith('FRESH')) ?
|
(rez.meta && rez.meta.format && rez.meta.format.startsWith('FRESH')) ?
|
||||||
|
@ -51,11 +51,11 @@ Implementation of the 'generate' verb for HackMyResume.
|
|||||||
@param theme Friendly name of the resume theme. Defaults to "modern".
|
@param theme Friendly name of the resume theme. Defaults to "modern".
|
||||||
@param logger Optional logging override.
|
@param logger Optional logging override.
|
||||||
*/
|
*/
|
||||||
function build( src, dst, opts, logger, errHandler ) {
|
function build( src, dst, opts ) {
|
||||||
|
|
||||||
this.stat( HME.begin );
|
this.stat( HME.begin );
|
||||||
|
|
||||||
prep( src, dst, opts, logger, errHandler );
|
prep( src, dst, opts );
|
||||||
|
|
||||||
// Load the theme...we do this first because the theme choice (FRESH or
|
// Load the theme...we do this first because the theme choice (FRESH or
|
||||||
// JSON Resume) determines what format we'll convert the resume to.
|
// JSON Resume) determines what format we'll convert the resume to.
|
||||||
@ -102,11 +102,7 @@ Implementation of the 'generate' verb for HackMyResume.
|
|||||||
/**
|
/**
|
||||||
Prepare for a BUILD run.
|
Prepare for a BUILD run.
|
||||||
*/
|
*/
|
||||||
function prep( src, dst, opts, logger, errHandler ) {
|
function prep( src, dst, opts ) {
|
||||||
|
|
||||||
// Housekeeping
|
|
||||||
_log = logger || console.log;
|
|
||||||
_err = errHandler || error;
|
|
||||||
|
|
||||||
// Cherry-pick options //_opts = extend( true, _opts, opts );
|
// Cherry-pick options //_opts = extend( true, _opts, opts );
|
||||||
_opts.theme = (opts.theme && opts.theme.toLowerCase().trim()) || 'modern';
|
_opts.theme = (opts.theme && opts.theme.toLowerCase().trim()) || 'modern';
|
||||||
@ -300,19 +296,4 @@ Implementation of the 'generate' verb for HackMyResume.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
Handle an exception. Placeholder.
|
|
||||||
*/
|
|
||||||
function error( ex ) {
|
|
||||||
throw ex;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function MDIN(txt) { // TODO: Move this
|
|
||||||
return MD(txt || '' ).replace(/^\s*<p>|<\/p>\s*$/gi, '');
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}());
|
}());
|
||||||
|
@ -35,10 +35,9 @@ Implementation of the 'convert' verb for HackMyResume.
|
|||||||
/**
|
/**
|
||||||
Convert between FRESH and JRS formats.
|
Convert between FRESH and JRS formats.
|
||||||
*/
|
*/
|
||||||
function convert( srcs, dst, opts, logger ) {
|
function convert( srcs, dst, opts ) {
|
||||||
|
|
||||||
// Housekeeping
|
// Housekeeping
|
||||||
var _log = logger || console.log;
|
|
||||||
if( !srcs || !srcs.length ) { throw { fluenterror: 6 }; }
|
if( !srcs || !srcs.length ) { throw { fluenterror: 6 }; }
|
||||||
if( !dst || !dst.length ) {
|
if( !dst || !dst.length ) {
|
||||||
if( srcs.length === 1 ) {
|
if( srcs.length === 1 ) {
|
||||||
@ -60,7 +59,7 @@ Implementation of the 'convert' verb for HackMyResume.
|
|||||||
|
|
||||||
// Load the resume
|
// Load the resume
|
||||||
var rinfo = ResumeFactory.loadOne( src, {
|
var rinfo = ResumeFactory.loadOne( src, {
|
||||||
log: _log, format: null, objectify: true, throw: true
|
format: null, objectify: true, throw: true
|
||||||
});
|
});
|
||||||
|
|
||||||
var s = rinfo.rez
|
var s = rinfo.rez
|
||||||
|
@ -37,7 +37,7 @@ Implementation of the 'create' verb for HackMyResume.
|
|||||||
/**
|
/**
|
||||||
Create a new empty resume in either FRESH or JRS format.
|
Create a new empty resume in either FRESH or JRS format.
|
||||||
*/
|
*/
|
||||||
function create( src, dst, opts/*, logger*/ ) {
|
function create( src, dst, opts ) {
|
||||||
|
|
||||||
if(!src || !src.length) throw {fluenterror: HACKMYSTATUS.createNameMissing};
|
if(!src || !src.length) throw {fluenterror: HACKMYSTATUS.createNameMissing};
|
||||||
this.stat( HME.begin );
|
this.stat( HME.begin );
|
||||||
|
@ -32,8 +32,8 @@ Implementation of the 'validate' verb for HackMyResume.
|
|||||||
/**
|
/**
|
||||||
Validate 1 to N resumes in either FRESH or JSON Resume format.
|
Validate 1 to N resumes in either FRESH or JSON Resume format.
|
||||||
*/
|
*/
|
||||||
function validate( sources, unused, opts, logger ) {
|
function validate( sources, unused, opts ) {
|
||||||
var _log = logger || console.log;
|
|
||||||
if( !sources || !sources.length ) { throw { fluenterror: 6 }; }
|
if( !sources || !sources.length ) { throw { fluenterror: 6 }; }
|
||||||
var isValid = true;
|
var isValid = true;
|
||||||
|
|
||||||
@ -44,7 +44,6 @@ Implementation of the 'validate' verb for HackMyResume.
|
|||||||
};
|
};
|
||||||
|
|
||||||
var resumes = ResumeFactory.load( sources, {
|
var resumes = ResumeFactory.load( sources, {
|
||||||
log: _log,
|
|
||||||
format: null,
|
format: null,
|
||||||
objectify: false,
|
objectify: false,
|
||||||
throw: false,
|
throw: false,
|
||||||
|
Loading…
Reference in New Issue
Block a user