 { set } = require('lodash')
 { cyan } = require('chalk')
 
-module.exports = (grunt) ->
+module.exports = ({ registerMultiTask, log, verbose, file: { write} }) ->
 
-  grunt.registerMultiTask 'grayMatter', 'Extract data from specified files with Gray Matter', () ->
+  registerMultiTask 'grayMatter', 'Extract data from specified files with Gray Matter', () ->
     options = @options(
       baseDir: ''
       preprocessPath: undefined

    if typeof preprocessData == 'function'
      data = preprocessData.call(@, data)

    grunt.file.write(filedest, JSON.stringify(data, options.replacer, options.space))

    grunt.log.ok "#{cyan(processedFiles.length)} files processed"
    grunt.verbose.ok "#{processedFiles.map((file) => "\nProcessed: #{cyan(file)}")}"
    grunt.verbose.ok "File #{cyan(filedest)} created"
      filedest = file.orig.dest

      if not file.src.length
        log.error("No source files specified for #{cyan(filedest)}.")
        return

      file.src.forEach (src) =>
