<commit_before>var gulp = require('gulp'),
    concat = require('gulp-concat'),
    neat = require('node-neat'),
    please = require('gulp-pleeease'),
    plumber = require('gulp-plumber'),
    sass = require('gulp-sass'),
    sourcemaps = require('gulp-sourcemaps'),
    util = require('gulp-util'),
    bower = require('gulp-bower'),
    mainBowerFiles = require('main-bower-files'),
    path = require('path'),
    jscs = require('gulp-jscs'),
    runSequence = require('run-sequence'),
    styleguide = require('./lib/styleguide'),
    distPath = './lib/dist',
    fs = require('fs'),
    chalk = require('chalk'),
    configPath = util.env.config ? util.env.config.replace(/\/$/, '') : null,
    outputPath = util.env.output ? util.env.output.replace(/\/$/, '') : '',
    sourcePath = util.env.source ? util.env.source.replace(/\/$/, '') : '',
    config = configPath ? require(configPath) : {};

/* Tasks for development */
gulp.task('serve', function() {
  var serverModule = require('./lib/server')(sourcePath, outputPath),
    app = serverModule.app,
    server = serverModule.server;

  app.set('port', util.env.port || 3000);
  server = server.listen(app.get('port'), function() {
    console.log('Express server listening on port ' + server.address().port);
  });
});

gulp.task('jscs', function() {
  return gulp.src([
    '*.js',
    'lib/*.js',
    'test/*.js',
    'lib/app/js/app.js',
    'lib/app/js/controllers/**/**.js',
    'lib/app/js/directives/**/**.js',
    'lib/app/js/services/**/**.js'
  ])
  .pipe(jscs());
});

gulp.task('styleguide', function() {
  var distPath = '/lib/dist';
  if (!fs.existsSync(__dirname + distPath)) {
    process.stderr.write(chalk.red.bold('Error:') + ' Directory ' + distPath + ' does not exist. You probably installed library by cloning repository directly instead of NPM repository.\n');
    process.stderr.write('You need to run ' + chalk.green.bold('gulp build') + ' first\n');
    process.exit(1)
    return 1;
  }
  // Resolve overviewPath in relation to config file location
  var overviewPath;
  if (config.overviewPath) {
    overviewPath = path.resolve(path.dirname(configPath), config.overviewPath);
  }
  return gulp.src([sourcePath + '/**/*.scss'])
    .pipe(styleguide({
      extraHead: config.extraHead,
      overviewPath: overviewPath,
      sass: {
        loadPath: neat.includePaths
      }
    }))
    .pipe(gulp.dest(outputPath));
});

gulp.task('js:app', function() {
  return gulp.src(['lib/app/js/**/*.js', '!lib/app/js/vendor/**/*.js'])
    .pipe(plumber())
    .pipe(concat('app.js'))
    .pipe(gulp.dest(distPath + '/js'));<commit_msg>Request socket.io for our dev server<commit_after>var gulp = require('gulp'),
    concat = require('gulp-concat'),
    neat = require('node-neat'),
    please = require('gulp-pleeease'),
    plumber = require('gulp-plumber'),
    sass = require('gulp-sass'),
    sourcemaps = require('gulp-sourcemaps'),
    util = require('gulp-util'),
    bower = require('gulp-bower'),
    mainBowerFiles = require('main-bower-files'),
    path = require('path'),
    jscs = require('gulp-jscs'),
    runSequence = require('run-sequence'),
    styleguide = require('./lib/styleguide'),
    distPath = './lib/dist',
    fs = require('fs'),
    chalk = require('chalk'),
    configPath = util.env.config ? util.env.config.replace(/\/$/, '') : null,
    outputPath = util.env.output ? util.env.output.replace(/\/$/, '') : '',
    sourcePath = util.env.source ? util.env.source.replace(/\/$/, '') : '',
    config = configPath ? require(configPath) : {};

/* Tasks for development */
gulp.task('serve', function() {
  var serverModule = require('./lib/server')(sourcePath, outputPath),
    app = serverModule.app,
    server = serverModule.server;

  app.set('port', util.env.port || 3000);
  server = server.listen(app.get('port'), function() {
    console.log('Express server listening on port ' + server.address().port);
  });
});

gulp.task('jscs', function() {
  return gulp.src([
    '*.js',
    'lib/*.js',
    'test/*.js',
    'lib/app/js/app.js',
    'lib/app/js/controllers/**/**.js',
    'lib/app/js/directives/**/**.js',
    'lib/app/js/services/**/**.js'
  ])
  .pipe(jscs());
});

gulp.task('styleguide', function() {
  var distPath = '/lib/dist';
  if (!fs.existsSync(__dirname + distPath)) {
    process.stderr.write(chalk.red.bold('Error:') + ' Directory ' + distPath + ' does not exist. You probably installed library by cloning repository directly instead of NPM repository.\n');
    process.stderr.write('You need to run ' + chalk.green.bold('gulp build') + ' first\n');
    process.exit(1)
    return 1;
  }
  // Resolve overviewPath in relation to config file location
  var overviewPath;
  if (config.overviewPath) {
    overviewPath = path.resolve(path.dirname(configPath), config.overviewPath);
  }
  return gulp.src([sourcePath + '/**/*.scss'])
    .pipe(styleguide({
      extraHead: config.extraHead,
      overviewPath: overviewPath,
      socketIo: true, // included sockei.io script
      sass: {
        loadPath: neat.includePaths
      }
    }))
    .pipe(gulp.dest(outputPath));
});

gulp.task('js:app', function() {
  return gulp.src(['lib/app/js/**/*.js', '!lib/app/js/vendor/**/*.js'])
    .pipe(plumber())
    .pipe(concat('app.js'))
    .pipe(gulp.dest(distPath + '/js'));
{'fraction_non_alphanumeric': 0.20097854723372224, 'fraction_numerical': 0.002258185923974407, 'mean_word_length': 3.2932148626817446, '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': '4955358', 'n_tokens_mistral': 1801, 'n_tokens_neox': 1784, 'n_words': 323}