Skip to content

Commit

Permalink
Moved mixins installation to class definition
Browse files Browse the repository at this point in the history
  • Loading branch information
lbeschastny committed Sep 16, 2014
1 parent 48f06a2 commit fd924b6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
5 changes: 2 additions & 3 deletions src/webp.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@ methods = require './methods'


module.exports = class Webp extends Wrapper
mixin this, compile methods

@bin: 'cwebp'
@verbose: false

constructor: (source, bin) ->
unless @ instanceof Webp
return new Webp source, bin
super


mixin Webp, compile methods
7 changes: 3 additions & 4 deletions src/wrapper.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ When = require 'when'


module.exports = class Wrapper
mixin this, require './args'
mixin this, require './io'

constructor: (source, bin) ->
@_args = {_: []}
@_args.v = [] if @constructor.verbose
Expand All @@ -31,7 +34,3 @@ module.exports = class Wrapper
proc.removeListener 'error', reject
proc.removeListener 'close', onClose
proc.stderr.removeListener 'close', onErr


mixin Wrapper, require './args'
mixin Wrapper, require './io'

0 comments on commit fd924b6

Please sign in to comment.