<commit_before>const gulp = require('gulp');
const browserSync = require ('browser-sync').create();
const browserify = require('gulp-browserify');
const source = require('vinyl-source-stream');
const browserTest = require ("browser-sync").create();
const rename = require("gulp-rename");

gulp.task('browserSync',() => {
    browserSync.init({
        server: {
            baseDir: './public',
        },
        port: process.env.PORT || 4000,
      ui: false,
      ghostMode: false
    });
});

gulp.task('browserTest', ['build'], () => {
  browserTest.init({
    server: {
      baseDir: ['./public/src', './jasmine'],
      index: 'SpecRunner.html'
    },
    port: 9000,

  });
});


gulp.task('default', ['browserSync','browserTest', 'watch', 'build']);

gulp.task('watch', () => {
  gulp.watch(['public/css/index.css', 'public/index.html', 'public/src/*.js'], browserSync.reload);
  gulp.watch(['public/src/inverted-index.js', 'jasmine/spec/inverted-index-test.js', 
  'jasmine/spec/tests/test-spec.js'], ['build']);
  gulp.watch(["public/src/inverted-index.js", 'jasmine/spec/tests/test-spec.js'], browserTest.reload);
});

gulp.task('build', function() {
    // Single entry point to browserify 
   gulp.src('jasmine/spec/inverted-index-test.js')
        .pipe(browserify({
          insertGlobals : true,
          debug : !gulp.env.production
        }))
        .pipe(rename('test-spec.js'))
        .pipe(gulp.dest('jasmine/spec/tests/'))
});<commit_msg>updates port to include env.PORT in gulpfile.js<commit_after>const gulp = require('gulp');
const browserSync = require ('browser-sync').create();
const browserify = require('gulp-browserify');
const source = require('vinyl-source-stream');
const browserTest = require ("browser-sync").create();
const rename = require("gulp-rename");

gulp.task('browserSync',() => {
  browserSync.init({
    server: {
      baseDir: './public',
    },
    port: process.env.PORT || 4000,
    ui: false,
    ghostMode: false
  });
});

gulp.task('browserTest', ['build'], () => {
  browserTest.init({
    server: {
      baseDir: ['./public/src', './jasmine'],
      index: 'SpecRunner.html'
    },
    port: 9000,
  });
});


gulp.task('default', ['browserSync','browserTest', 'watch', 'build']);

gulp.task('watch', () => {
  gulp.watch(['public/css/index.css', 'public/index.html', 'public/src/*.js'], browserSync.reload);
  gulp.watch(['public/src/inverted-index.js', 'jasmine/spec/inverted-index-test.js', 
  'jasmine/spec/tests/test-spec.js'], ['build']);
  gulp.watch(["public/src/inverted-index.js", 'jasmine/spec/tests/test-spec.js'], browserTest.reload);
});

gulp.task('build', function() {
  gulp.src('jasmine/spec/inverted-index-test.js')
    .pipe(browserify({
      insertGlobals : true,
      debug : !gulp.env.production
    }))
        .pipe(rename('test-spec.js'))
        .pipe(gulp.dest('jasmine/spec/tests/'))
});
{'fraction_non_alphanumeric': 0.2119847592656737, 'fraction_numerical': 0.005542085209560097, 'mean_word_length': 3.5266457680250785, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '5120385', 'n_tokens_mistral': 1001, 'n_tokens_neox': 970, 'n_words': 149}