mirror of
https://github.com/JuanCanham/HackMyResume.git
synced 2024-12-27 23:37:22 +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.
|
||||
*/
|
||||
function analyze( sources, dst, opts, logger ) {
|
||||
function analyze( sources, dst, opts ) {
|
||||
this.stat('begin');
|
||||
var _log = logger || console.log;
|
||||
if( !sources || !sources.length ) throw { fluenterror: 3 };
|
||||
var nlzrs = _loadInspectors();
|
||||
_.each(sources, function(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.stat('end');
|
||||
}
|
||||
@ -56,7 +55,7 @@ Implementation of the 'analyze' verb for HackMyResume.
|
||||
/**
|
||||
Analyze a single resume.
|
||||
*/
|
||||
function _analyze( resumeObject, nlzrs, opts, log ) {
|
||||
function _analyze( resumeObject, nlzrs, opts ) {
|
||||
var rez = resumeObject.rez;
|
||||
var safeFormat =
|
||||
(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 logger Optional logging override.
|
||||
*/
|
||||
function build( src, dst, opts, logger, errHandler ) {
|
||||
function build( src, dst, opts ) {
|
||||
|
||||
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
|
||||
// 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.
|
||||
*/
|
||||
function prep( src, dst, opts, logger, errHandler ) {
|
||||
|
||||
// Housekeeping
|
||||
_log = logger || console.log;
|
||||
_err = errHandler || error;
|
||||
function prep( src, dst, opts ) {
|
||||
|
||||
// Cherry-pick options //_opts = extend( true, _opts, opts );
|
||||
_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.
|
||||
*/
|
||||
function convert( srcs, dst, opts, logger ) {
|
||||
function convert( srcs, dst, opts ) {
|
||||
|
||||
// Housekeeping
|
||||
var _log = logger || console.log;
|
||||
if( !srcs || !srcs.length ) { throw { fluenterror: 6 }; }
|
||||
if( !dst || !dst.length ) {
|
||||
if( srcs.length === 1 ) {
|
||||
@ -60,7 +59,7 @@ Implementation of the 'convert' verb for HackMyResume.
|
||||
|
||||
// Load the resume
|
||||
var rinfo = ResumeFactory.loadOne( src, {
|
||||
log: _log, format: null, objectify: true, throw: true
|
||||
format: null, objectify: true, throw: true
|
||||
});
|
||||
|
||||
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.
|
||||
*/
|
||||
function create( src, dst, opts/*, logger*/ ) {
|
||||
function create( src, dst, opts ) {
|
||||
|
||||
if(!src || !src.length) throw {fluenterror: HACKMYSTATUS.createNameMissing};
|
||||
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.
|
||||
*/
|
||||
function validate( sources, unused, opts, logger ) {
|
||||
var _log = logger || console.log;
|
||||
function validate( sources, unused, opts ) {
|
||||
|
||||
if( !sources || !sources.length ) { throw { fluenterror: 6 }; }
|
||||
var isValid = true;
|
||||
|
||||
@ -44,7 +44,6 @@ Implementation of the 'validate' verb for HackMyResume.
|
||||
};
|
||||
|
||||
var resumes = ResumeFactory.load( sources, {
|
||||
log: _log,
|
||||
format: null,
|
||||
objectify: false,
|
||||
throw: false,
|
||||
|
Loading…
Reference in New Issue
Block a user