         tasks: [
           'bgShell:pumaRestart'
           'bgShell:rake'
+          'output-coverage'
         ]
     bgShell:
       pumaRestart:

          'coffeelint:tests'
          'coffee:tests'
          'karma'
        ]
      ruby:
        files: [

  grunt.registerTask 'build', ['htmlhint','html2js','sass','coffeelint','coffee']
  grunt.registerTask 'test', ['build','bgShell:rake','karma']
  grunt.registerTask 'dist', ['build']
  grunt.registerTask 'output-coverage', 'output coverage data', () ->
    cover_out = path.join __dirname, 'coverage/.last_run.json'
    done = @async()
    fs.readFile cover_out, 'utf8', (err, data) ->
      unless err
        try
          coverage = JSON.parse(data)?.result?.covered_percent
          if coverage
            grunt.log.writeln "coverage: #{coverage}%"
            done()
            return
      grunt.log.writeln "coverage: not found"
      done()
  grunt.registerTask 'default', ['bgShell:shotgun','watch']
