<commit_before>/*
 |----------------------------------------------
 | Gulp
 |----------------------------------------------
 |
 | Add any compile steps here. Always use gulp
 | to make a build
 |
 */

// Core
var gulp        = require( 'gulp' );
var rename      = require( 'gulp-rename' );
var runSequence = require( 'run-sequence' ).use( gulp );
var browserSync = require( 'browser-sync' ).create();

// Test
var jasmine   = require( 'gulp-jasmine' );
var cover     = require( 'gulp-coverage' );
var coveralls = require( 'gulp-coveralls' );
var qunit     = require( 'gulp-qunit' );

// Lint
var jscs = require( 'gulp-jscs' );

// Build
var webpack = require( 'webpack' );
var stream  = require( 'webpack-stream' );
var minify  = require( 'gulp-minify' );

/*
 |----------------------------------------------
 | Options
 |----------------------------------------------
 |
 | Paths, names, etc used throughout the build
 |
 */
var options = {
  testPaths: {
    unit: [
      'tests/unit/*.js',
      'tests/unit/**/*.js'
    ],
    spec: [
      'tests/spec/*.js',
      'tests/spec/**/*.js'
    ],
    integration: [
      'tests/integration/*.js',
      'tests/integration/**/*.js'
    ]
  },
  filePaths: {
    core: [
      'src/core/*.js',
      'src/core/**/*.js'
    ],
    framework: [
      'src/framework/*.js',
      'src/framework/**/*.js'
    ]
  },
  allPaths: [
    '*.js',
    '**/*.js',
    '!.coverdata/**',
    '!coverage/**',
    '!debug/**',
    '!node_modules/**',
    '!dist/**'
  ],
  jasmine: {
    includeStackTrace: true,
    verbose: true
  },
  entryPoint: 'index.js',
  buildPath: 'dist/js/',
  servePath: 'dist/'
};

/*
 |----------------------------------------------
 | Tasks
 |----------------------------------------------
 |
 | Gulp tasks can be run through the command
 | line using `gulp`. Use `gulp serve` for
 | continuous compiling and testing.
 |
 */

gulp.task( 'serve', [ 'default' ], function() {
  browserSync.init( {
    server: {
      baseDir: './' + options.servePath
    }
  } );

  var paths = [].concat( options.filePaths.root )
    .concat( options.filePaths.core )
    .concat( options.filePaths.framework )
    .concat( options.filePaths.game );

  gulp.watch( paths, [ 'build' ] );
} );

gulp.task( 'unit-test', function() {
  return gulp.src( 'tests/unit/fixtures/test-runner.html' )
    .pipe( qunit() );
} );

gulp.task( 'spec-test', function() {
  var src = [ 'tests/spec-loader.js' ]
    .concat( options.testPaths.spec )
    .concat( options.entryPoint );
  var temp = gulp.src( src )

  //  .pipe( cover.instrument( {
  //    pattern: options.filePaths.core,
  //    debugDirectory: 'debug'
  //  } ) )
  .pipe( jasmine( options.jasmine ) );

  //  .pipe( cover.gather() )
  //  .pipe( cover.format( {
  //     reporter: 'lcov'
  //   } ) );

  if ( process.env.CI ) {<commit_msg>Fix coveralls<commit_after>/*
 |----------------------------------------------
 | Gulp
 |----------------------------------------------
 |
 | Add any compile steps here. Always use gulp
 | to make a build
 |
 */

// Core
var gulp        = require( 'gulp' );
var rename      = require( 'gulp-rename' );
var runSequence = require( 'run-sequence' ).use( gulp );
var browserSync = require( 'browser-sync' ).create();

// Test
var jasmine   = require( 'gulp-jasmine' );
var cover     = require( 'gulp-coverage' );
var coveralls = require( 'gulp-coveralls' );
var qunit     = require( 'gulp-qunit' );

// Lint
var jscs = require( 'gulp-jscs' );

// Build
var webpack = require( 'webpack' );
var stream  = require( 'webpack-stream' );
var minify  = require( 'gulp-minify' );

/*
 |----------------------------------------------
 | Options
 |----------------------------------------------
 |
 | Paths, names, etc used throughout the build
 |
 */
var options = {
  testPaths: {
    unit: [
      'tests/unit/*.js',
      'tests/unit/**/*.js'
    ],
    spec: [
      'tests/spec/*.js',
      'tests/spec/**/*.js'
    ],
    integration: [
      'tests/integration/*.js',
      'tests/integration/**/*.js'
    ]
  },
  filePaths: {
    core: [
      'src/core/*.js',
      'src/core/**/*.js'
    ],
    framework: [
      'src/framework/*.js',
      'src/framework/**/*.js'
    ]
  },
  allPaths: [
    '*.js',
    '**/*.js',
    '!.coverdata/**',
    '!coverage/**',
    '!debug/**',
    '!node_modules/**',
    '!dist/**'
  ],
  jasmine: {
    includeStackTrace: true,
    verbose: true
  },
  entryPoint: 'index.js',
  buildPath: 'dist/js/',
  servePath: 'dist/'
};

/*
 |----------------------------------------------
 | Tasks
 |----------------------------------------------
 |
 | Gulp tasks can be run through the command
 | line using `gulp`. Use `gulp serve` for
 | continuous compiling and testing.
 |
 */

gulp.task( 'serve', [ 'default' ], function() {
  browserSync.init( {
    server: {
      baseDir: './' + options.servePath
    }
  } );

  var paths = [].concat( options.filePaths.root )
    .concat( options.filePaths.core )
    .concat( options.filePaths.framework )
    .concat( options.filePaths.game );

  gulp.watch( paths, [ 'build' ] );
} );

gulp.task( 'unit-test', function() {
  return gulp.src( 'tests/unit/fixtures/test-runner.html' )
    .pipe( qunit() );
} );

gulp.task( 'spec-test', function() {
  var src = [ 'tests/spec-loader.js' ]
    .concat( options.testPaths.spec )
    .concat( options.entryPoint );
  var temp = gulp.src( src )
   .pipe( cover.instrument( {
     pattern: options.filePaths.core,
     debugDirectory: 'debug'
   } ) )
  .pipe( jasmine( options.jasmine ) );
  .pipe( cover.gather() )
  .pipe( cover.format( {
   reporter: 'lcov'
  } ) );

  if ( process.env.CI ) {
{'fraction_non_alphanumeric': 0.2751547303271441, 'fraction_numerical': 0.0, 'mean_word_length': 1.7336877718704689, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1138962', 'n_tokens_mistral': 1911, 'n_tokens_neox': 1886, 'n_words': 391}