     copyComponent 'angularjs', '/*'
     copyComponent 'bootstrap', '/dist/**/*'
     copyComponent 'angular-ui-router', '/release/*'
+    copyComponent 'angular-mocks', '/*'
+
+
+  gulp.task 'docs:copy:eventric', ->
+    gulp.src('build/dist/eventric.js')
+    .pipe(gulp.dest('build/docs/scripts'))
 
 
   gulp.task 'docs:generate:jade', ->

gulp        = require 'gulp'
Dgeni       = require 'dgeni'
runSequence = require 'run-sequence'
coffee      = require 'gulp-coffee'
jade        = require 'gulp-jade'
path        = require 'canonical-path'
webserver   = require 'gulp-webserver'
gutil       = require 'gulp-util'
scss        = require 'gulp-sass'
concat      = require 'gulp-concat'


module.exports = (gulp) ->

  outputFolder = 'build/docs'
  bowerFolder = 'bower_components'

  copyComponent = (component, pattern, sourceFolder, packageFile) ->
    pattern = pattern or "/**/*"
    sourceFolder = sourceFolder or bowerFolder
    packageFile = packageFile or "bower.json"
    version = require(path.resolve(sourceFolder, component, packageFile)).version
    gulp.src(sourceFolder + "/" + component + pattern).pipe gulp.dest(outputFolder + "/components/" + component + "-" + version)


  gulp.task 'docs:build', (next) ->
    runSequence 'build', 'docs:generate:dgeni', 'docs:generate:jade', 'docs:generate:coffee', 'docs:generate:scss', 'docs:assets', 'docs:webserver:start', next


  gulp.task 'docs:watch', (next) ->



  gulp.task 'docs:generate:coffee', ->
    gulp.src([
      'docs/app/src/**/*.coffee'
      '!./**/*.spec.coffee'
      ])
      .pipe(coffee({bare: true}))
      .pipe commonjsWrap
        pathModifier: (filePath) ->
          filePath = filePath.replace process.cwd(), 'eventric'
          filePath = filePath.replace /.js$/, ''

      .pipe(concat('application.js'))
      .pipe(gulp.dest('build/docs/scripts'))

