mirror of
https://github.com/JuanCanham/HackMyResume.git
synced 2025-05-02 20:37:08 +01:00
Cleanup and bug fixes.
Remove file-based open methods from resume classes; force clients to use clean string-based or JSON overloads; fix processing glitch in validate(); tweak outputs; adjust tests; update CHANGELOG; etc.
This commit is contained in:
4
dist/cli/out.js
vendored
4
dist/cli/out.js
vendored
@ -135,8 +135,8 @@ Output routines for HackMyResume.
|
||||
style = evt.isValid ? 'green' : 'yellow';
|
||||
L(M2C(this.msgs.afterValidate.msg[0], 'white') + chalk[style].bold(evt.isValid ? this.msgs.afterValidate.msg[1] : this.msgs.afterValidate.msg[2]), evt.file, evt.fmt);
|
||||
if (evt.errors) {
|
||||
return _.each(evt.errors, function(err, idx) {
|
||||
return L(chalk.yellow.bold('--> ') + chalk.yellow(err.field.replace('data.', 'resume.').toUpperCase() + ' ' + err.message));
|
||||
_.each(evt.errors, function(err, idx) {
|
||||
L(chalk.yellow.bold('--> ') + chalk.yellow(err.field.replace('data.', 'resume.').toUpperCase() + ' ' + err.message));
|
||||
}, this);
|
||||
}
|
||||
break;
|
||||
|
13
dist/core/fresh-resume.js
vendored
13
dist/core/fresh-resume.js
vendored
@ -51,17 +51,6 @@ Definition of the FRESHResume class.
|
||||
}
|
||||
|
||||
|
||||
/** Initialize the FreshResume from file. */
|
||||
|
||||
FreshResume.prototype.open = function(file, opts) {
|
||||
var raw, ret;
|
||||
raw = FS.readFileSync(file, 'utf8');
|
||||
ret = this.parse(raw, opts);
|
||||
this.imp.file = file;
|
||||
return ret;
|
||||
};
|
||||
|
||||
|
||||
/** Initialize the the FreshResume from JSON string data. */
|
||||
|
||||
FreshResume.prototype.parse = function(stringData, opts) {
|
||||
@ -442,7 +431,7 @@ Definition of the FRESHResume class.
|
||||
*/
|
||||
|
||||
FreshResume["default"] = function() {
|
||||
return new FreshResume().parseJSON(require('fresh-resume-starter'));
|
||||
return new FreshResume().parseJSON(require('fresh-resume-starter').fresh);
|
||||
};
|
||||
|
||||
|
||||
|
13
dist/core/jrs-resume.js
vendored
13
dist/core/jrs-resume.js
vendored
@ -45,17 +45,6 @@ Definition of the JRSResume class.
|
||||
}
|
||||
|
||||
|
||||
/** Initialize the JSResume from file. */
|
||||
|
||||
JRSResume.prototype.open = function(file, opts) {
|
||||
var raw, ret;
|
||||
raw = FS.readFileSync(file, 'utf8');
|
||||
ret = this.parse(raw, opts);
|
||||
this.imp.file = file;
|
||||
return ret;
|
||||
};
|
||||
|
||||
|
||||
/** Initialize the the JSResume from string. */
|
||||
|
||||
JRSResume.prototype.parse = function(stringData, opts) {
|
||||
@ -364,7 +353,7 @@ Definition of the JRSResume class.
|
||||
/** Get the default (empty) sheet. */
|
||||
|
||||
JRSResume["default"] = function() {
|
||||
return new JRSResume().open(PATH.join(__dirname, 'empty-jrs.json'), 'Empty');
|
||||
return new JRSResume().parseJSON(require('fresh-resume-starter').jrs);
|
||||
};
|
||||
|
||||
|
||||
|
2
dist/renderers/handlebars-generator.js
vendored
2
dist/renderers/handlebars-generator.js
vendored
@ -43,7 +43,7 @@ Definition of the HandlebarsGenerator class.
|
||||
return template(data);
|
||||
} catch (_error) {
|
||||
throw {
|
||||
fluenterror: template ? HMSTATUS.invokeTemplate : HMSTATUS.compileTemplate,
|
||||
fluenterror: HMSTATUS[template ? 'invokeTemplate' : 'compileTemplate'],
|
||||
inner: _error
|
||||
};
|
||||
}
|
||||
|
2
dist/verbs/validate.js
vendored
2
dist/verbs/validate.js
vendored
@ -96,7 +96,7 @@ Implementation of the 'validate' verb for HackMyResume.
|
||||
};
|
||||
}
|
||||
json = obj.json;
|
||||
fmt = json.basics ? 'jrs' : 'fresh';
|
||||
fmt = json.basics ? 'jars' : 'fresh';
|
||||
errors = [];
|
||||
try {
|
||||
validate = validator(schemas[fmt], {
|
||||
|
Reference in New Issue
Block a user