   reGenerate:           =>
     return if @reGenerationTaskName() == 'false'
     @log('config changed, regenerate')
-    gulp.run @reGenerationTaskName()
+    @gulp.run @reGenerationTaskName()
 
   generate: (cb) =>
     @task 'generate', =>

util     = require 'util'

class Generator
  constructor: (@name, configPath) ->
    @config = new Config(configPath, @reGenerate).config

  if:                 gulpif
  dest:               gulp.dest
  gulp:               gulp
  watch:              gulp.watch
  changed:            changed
  plumber:            plumber
  log:       (msg) => log.info("#{@name}: ", msg)
  taskName: (name) => "#{@name}:#{name}"
  task: (name, cb) => gulp.task(@taskName(name), cb)

  stopOnError: =>
    return true unless @config.hasOwnProperty 'stop_on_error'

    stream.pipe(plumber())

  src: (src) =>
    return @gulp.src(src) if @stopOnError()
    @preventStopOnError @gulp.src(src)

  isRepetitive:   => @config.hasOwnProperty 'repetitive'

