mirror of
https://github.com/JuanCanham/HackMyResume.git
synced 2024-11-22 00:10:15 +00:00
Cleanup.
This commit is contained in:
parent
f77cced7f3
commit
984ae95576
@ -87,8 +87,6 @@ Output routines for HackMyResume.
|
||||
break;
|
||||
|
||||
case HME.afterTheme:
|
||||
this.theme = evt.theme;
|
||||
// this.opts.debug && L( M2C(this.msgs.beforeTheme.msg, 'green'), evt.theme );
|
||||
break;
|
||||
|
||||
case HME.beforeMerge:
|
||||
@ -107,9 +105,10 @@ Output routines for HackMyResume.
|
||||
break;
|
||||
|
||||
case HME.applyTheme:
|
||||
var numFormats = Object.keys( this.theme.formats ).length;
|
||||
this.theme = evt.theme;
|
||||
var numFormats = Object.keys( evt.theme.formats ).length;
|
||||
L( M2C(this.msgs.applyTheme.msg, 'green'),
|
||||
this.theme.name.toUpperCase(),
|
||||
evt.theme.name.toUpperCase(),
|
||||
numFormats, ( numFormats === 1 ? '' : 's') );
|
||||
break;
|
||||
|
||||
|
@ -36,7 +36,9 @@ Event code definitions.
|
||||
beforePeek: 20,
|
||||
afterPeek: 21,
|
||||
beforeInlineConvert: 22,
|
||||
afterInlineConvert: 23
|
||||
afterInlineConvert: 23,
|
||||
beforeValidate: 24,
|
||||
afterValidate: 25
|
||||
};
|
||||
|
||||
|
||||
|
@ -117,7 +117,7 @@ Implementation of the 'build' verb for HackMyResume.
|
||||
|
||||
// Add freebie formats to the theme
|
||||
addFreebieFormats( theme );
|
||||
this.stat( HMEVENT.applyTheme, { r: rez });
|
||||
this.stat( HMEVENT.applyTheme, { r: rez, theme: theme });
|
||||
|
||||
// Load the resume into a FRESHResume or JRSResume object
|
||||
_rezObj = new (RTYPES[ toFormat ])().parseJSON( rez );
|
||||
@ -161,12 +161,6 @@ Implementation of the 'build' verb for HackMyResume.
|
||||
|
||||
|
||||
|
||||
function handleInternalError( ex ) {
|
||||
console.log(ex);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
Generate a single target resume such as "out/rez.html" or "out/rez.doc".
|
||||
TODO: Refactor.
|
||||
|
@ -4,8 +4,12 @@ Implementation of the 'validate' verb for HackMyResume.
|
||||
@license MIT. See LICENSE.md for details.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
(function() {
|
||||
|
||||
|
||||
|
||||
var FS = require('fs');
|
||||
var ResumeFactory = require('../core/resume-factory');
|
||||
var SyntaxErrorEx = require('../utils/syntax-error-ex');
|
||||
@ -17,6 +21,7 @@ Implementation of the 'validate' verb for HackMyResume.
|
||||
|
||||
|
||||
|
||||
/** An invokable resume validation command. */
|
||||
var ValidateVerb = module.exports = Verb.extend({
|
||||
|
||||
init: function() {
|
||||
@ -33,16 +38,12 @@ 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 FRESH or JSON Resume format. */
|
||||
function validate( sources, unused, opts ) {
|
||||
|
||||
if( !sources || !sources.length )
|
||||
throw { fluenterror: HMSTATUS.resumeNotFoundAlt, quit: true };
|
||||
|
||||
var isValid = true;
|
||||
|
||||
var validator = require('is-my-json-valid');
|
||||
var schemas = {
|
||||
fresh: require('fresca'),
|
||||
@ -86,10 +87,10 @@ Implementation of the 'validate' verb for HackMyResume.
|
||||
return ret;
|
||||
}
|
||||
|
||||
this.stat(HMEVENT.afterValidate, { file: src.file, isValid: isValid,
|
||||
this.stat( HMEVENT.afterValidate, { file: src.file, isValid: ret.isValid,
|
||||
fmt: fmt.replace( 'jars', 'JSON Resume' ), errors: errors });
|
||||
|
||||
if( opts.assert && !isValid ) {
|
||||
if( opts.assert && !ret.isValid ) {
|
||||
throw { fluenterror: HMSTATUS.invalid, shouldExit: true };
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user