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:
@ -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
|
||||
|
||||
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user