1
0
mirror of https://github.com/JuanCanham/HackMyResume.git synced 2025-05-10 07:47:07 +01:00

Finish HackMyCore reshaping.

Reintroduce HackMyCore, dropping the interim submodule, and reorganize
and improve tests.
This commit is contained in:
hacksalot
2016-01-29 15:23:57 -05:00
parent e9971eb882
commit 0f65e4c9f3
130 changed files with 5384 additions and 337 deletions

View File

@ -6,19 +6,19 @@ Error-handling routines for HackMyResume.
HMSTATUS = require('../hmc/dist/core/status-codes')
PKG = require('../../package.json')
FS = require('fs')
FCMD = require('../hmc')
PATH = require('path')
WRAP = require('word-wrap')
M2C = require('../hmc/dist/utils/md2chalk.js')
chalk = require('chalk')
extend = require('extend')
YAML = require('yamljs')
printf = require('printf')
SyntaxErrorEx = require('../hmc/dist/utils/syntax-error-ex')
require('string.prototype.startswith')
HMSTATUS = require '../core/status-codes'
PKG = require '../../package.json'
FS = require 'fs'
FCMD = require '../index'
PATH = require 'path'
WRAP = require 'word-wrap'
M2C = require '../utils/md2chalk'
chalk = require 'chalk'
extend = require 'extend'
YAML = require 'yamljs'
printf = require 'printf'
SyntaxErrorEx = require '../utils/syntax-error-ex'
require 'string.prototype.startswith'

22
src/cli/index.js Normal file
View File

@ -0,0 +1,22 @@
#! /usr/bin/env node
/**
Command-line interface (CLI) for HackMyResume.
@license MIT. See LICENSE.md for details.
@module index.js
*/
try {
require('./main')( process.argv );
}
catch( ex ) {
require('./error').err( ex, true );
}

View File

@ -6,16 +6,16 @@ Definition of the `main` function.
HMR = require '../hmc'
HMR = require '../index'
PKG = require '../../package.json'
FS = require 'fs'
EXTEND = require 'extend'
chalk = require 'chalk'
PATH = require 'path'
HMSTATUS = require '../hmc/dist/core/status-codes'
HME = require '../hmc/dist/core/event-codes'
safeLoadJSON = require '../hmc/dist/utils/safe-json-loader'
StringUtils = require '../hmc/dist/utils/string.js'
HMSTATUS = require '../core/status-codes'
HME = require '../core/event-codes'
safeLoadJSON = require '../utils/safe-json-loader'
StringUtils = require '../utils/string.js'
_ = require 'underscore'
OUTPUT = require './out'
PAD = require 'string-padding'
@ -243,10 +243,12 @@ execute = ( src, dst, opts, log ) ->
v.on( 'hmr:error', -> hand.err.apply( hand, arguments ) )
v.invoke.call( v, src, dst, _opts, log )
if v.errorCode
console.log 'Exiting with error code ' + v.errorCode
process.exit(v.errorCode)
###
Initialize HackMyResume options.
TODO: Options loading is a little hacky, for two reasons:

View File

@ -7,10 +7,10 @@ Output routines for HackMyResume.
chalk = require('chalk')
HME = require('../hmc/dist/core/event-codes')
HME = require('../core/event-codes')
_ = require('underscore')
Class = require('../hmc/dist/utils/class.js')
M2C = require('../hmc/dist/utils/md2chalk.js')
Class = require('../utils/class.js')
M2C = require('../utils/md2chalk.js')
PATH = require('path')
LO = require('lodash')
FS = require('fs')
@ -109,7 +109,7 @@ OutputHandler = module.exports = Class.extend
when HME.afterAnalyze
info = evt.info
rawTpl = FS.readFileSync( PATH.join( __dirname, 'analyze.hbs' ), 'utf8')
HANDLEBARS.registerHelper( require('../hmc/dist/helpers/console-helpers') )
HANDLEBARS.registerHelper( require('../helpers/console-helpers') )
template = HANDLEBARS.compile(rawTpl, { strict: false, assumeObjects: false })
tot = 0
info.keywords.forEach (g) -> tot += g.count