<commit_before>'use strict';

gulp = require 'gulp'

bower          = require 'gulp-bower'
mainBowerFiles = require 'main-bower-files'
concat         = require 'gulp-concat'
coffee         = require 'gulp-coffee'
colors         = require 'colors/safe'
karma          = require 'gulp-karma'
mocha          = require 'gulp-mocha'
nodemon        = require 'nodemon'
plumber        = require 'gulp-plumber'
rename         = require 'gulp-rename'
sourcemaps     = require 'gulp-sourcemaps'
uglify         = require 'gulp-uglify'

gulp.task 'bower', =>
  bower()
    .pipe gulp.dest 'public/lib/'

gulp.task 'bower:concat', ['bower'], =>
  gulp.src mainBowerFiles(filter: /\.js$/)
    .pipe plumber()
    .pipe sourcemaps.init()
    .pipe concat('dependencies.js')
    .pipe sourcemaps.write('.')
    .pipe gulp.dest('./public/dist/')

gulp.task 'scripts:concat', ['bower:concat'], =>
  gulp.src ['public/app/**/*.coffee']
    .pipe coffee(bare: true)
    .pipe concat('app.js')
    .pipe gulp.dest('public/dist')
    .pipe rename('app.min.js')
    .pipe uglify()
    .pipe gulp.dest 'public/dist'

gulp.task 'nodemon', ['bower:concat', 'scripts:concat'], =>
  nodemon
    script: 'server'
    ext: 'html js coffee'
    watch: [
      'app/**/*'
      'lib/*'
      'server.*'
    ]
  .on 'restart', => console.log colors.grey 'The Matrix is reloading...'

gulp.task 'test-karma', ['scripts:concat'], =>
  gulp.src ['public/test/**/*']
    .pipe karma(configFile: 'karma.conf.js')
    .on 'error', (error) => console.error error

gulp.task 'test-mocha', =>
  gulp.src ['test/**/*.coffee', '!test/coverage/**']
    .pipe mocha
      require: 'test/test_helper.coffee'
      reporter: 'spec'
    .on 'error', (error) => console.error error

gulp.task 'test', ['test-mocha', 'test-karma']

gulp.task 'watch', ['nodemon']

gulp.task 'default', ['scripts:concat']

gulp.task 'production', ['test-mocha', 'test-karma']<commit_msg>Fixed test-karma script<commit_after>'use strict';

gulp = require 'gulp'

bower          = require 'gulp-bower'
mainBowerFiles = require 'main-bower-files'
concat         = require 'gulp-concat'
coffee         = require 'gulp-coffee'
colors         = require 'colors/safe'
karma          = require 'gulp-karma'
mocha          = require 'gulp-mocha'
nodemon        = require 'nodemon'
plumber        = require 'gulp-plumber'
rename         = require 'gulp-rename'
sourcemaps     = require 'gulp-sourcemaps'
uglify         = require 'gulp-uglify'

gulp.task 'bower', =>
  bower()
    .pipe gulp.dest 'public/lib/'

gulp.task 'bower:concat', ['bower'], =>
  gulp.src mainBowerFiles(filter: /\.js$/)
    .pipe plumber()
    .pipe sourcemaps.init()
    .pipe concat('dependencies.js')
    .pipe sourcemaps.write('.')
    .pipe gulp.dest('./public/dist/')

gulp.task 'scripts:concat', ['bower:concat'], =>
  gulp.src ['public/app/**/*.coffee']
    .pipe coffee(bare: true)
    .pipe concat('app.js')
    .pipe gulp.dest('public/dist')
    .pipe rename('app.min.js')
    .pipe uglify()
    .pipe gulp.dest 'public/dist'

gulp.task 'nodemon', ['bower:concat', 'scripts:concat'], =>
  nodemon
    script: 'server'
    ext: 'html js coffee'
    watch: [
      'app/**/*'
      'lib/*'
      'server.*'
    ]
  .on 'restart', => console.log colors.grey 'The Matrix is reloading...'

gulp.task 'test-karma', =>
  gulp.src ['public/test/**/*']
    .pipe karma(configFile: 'karma.conf.js')
    .on 'error', (error) => console.error error

gulp.task 'test-mocha', =>
  gulp.src ['test/**/*.coffee', '!test/coverage/**']
    .pipe mocha
      require: 'test/test_helper.coffee'
      reporter: 'spec'
    .on 'error', (error) => console.error error

gulp.task 'test', ['test-mocha', 'test-karma']

gulp.task 'watch', ['nodemon']

gulp.task 'default', ['scripts:concat']

gulp.task 'production', ['test-mocha', 'test-karma']
{'fraction_non_alphanumeric': 0.18687924725561944, 'fraction_numerical': 0.0, 'mean_word_length': 2.885279187817259, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6367805', 'n_tokens_mistral': 1409, 'n_tokens_neox': 1386, 'n_words': 296}