1
0
mirror of https://github.com/JuanCanham/HackMyResume.git synced 2025-05-02 12:27:08 +01:00

Refactor verbs to CoffeeScript classes.

Retire Resig's class implementation.
This commit is contained in:
hacksalot
2016-02-01 23:16:49 -05:00
parent fd39cc9fd9
commit 63a0c78fc5
14 changed files with 123 additions and 69 deletions

View File

@ -17,9 +17,9 @@ chalk = require('chalk')
###* An invokable resume analysis command. ###
AnalyzeVerb = module.exports = Verb.extend
module.exports = class AnalyzeVerb extends Verb
init: -> @_super 'analyze', _analyze
constructor: -> super 'analyze', _analyze

View File

@ -39,10 +39,10 @@ verifyTheme = null
loadTheme = null
###* An invokable resume generation command. ###
BuildVerb = module.exports = Verb.extend
module.exports = class BuildVerb extends Verb
###* Create a new build verb. ###
init: () -> @_super 'build', _build
constructor: () -> super 'build', _build

View File

@ -15,9 +15,9 @@ HMEVENT = require('../core/event-codes');
ConvertVerb = module.exports = Verb.extend
module.exports = class ConvertVerb extends Verb
init: -> @_super 'convert', _convert
constructor: -> super 'convert', _convert

View File

@ -16,9 +16,9 @@ HMEVENT = require '../core/event-codes'
CreateVerb = module.exports = Verb.extend
module.exports = class CreateVerb extends Verb
init: -> @_super 'new', _create
constructor: -> super 'new', _create

View File

@ -15,9 +15,9 @@ HMEVENT = require('../core/event-codes')
PeekVerb = module.exports = Verb.extend
module.exports = class PeekVerb extends Verb
init: -> @_super 'peek', _peek
constructor: -> super 'peek', _peek

View File

@ -19,9 +19,9 @@ safeLoadJSON = require '../utils/safe-json-loader'
###* An invokable resume validation command. ###
ValidateVerb = module.exports = Verb.extend
module.exports = class ValidateVerb extends Verb
init: -> @_super 'validate', _validate
constructor: -> super 'validate', _validate

View File

@ -6,8 +6,6 @@ Definition of the Verb class.
# Use J. Resig's nifty class implementation
Class = require '../utils/class'
EVENTS = require 'events'
HMEVENT = require '../core/event-codes'
Promise = require 'pinkie-promise'
@ -18,14 +16,12 @@ Promise = require 'pinkie-promise'
An instantiation of a HackMyResume command.
@class Verb
###
Verb = module.exports = Class.extend
module.exports = class Verb
###* Constructor. Automatically called at creation. ###
init: ( moniker, workhorse ) ->
@moniker = moniker
@workhorse = workhorse
constructor: ( @moniker, @workhorse ) ->
@emitter = new EVENTS.EventEmitter()
return