<commit_before>var gulp = require('gulp');
var connect = require('gulp-connect');
var sass = require('gulp-sass');
var plumber = require('gulp-plumber');
var pug = require('gulp-pug'); // formerly Jade

var del = require('del');
var path = require('path');
var git = require('simple-git');


// Configuration
// =============================================================================

// This is where the source code is stored.
const SOURCE_DIR = 'src'
const BUILD_DIR = 'build'

// Used for retrieving files/folders in the source directory.
function src(f) {
  return path.join(SOURCE_DIR, f);
}

var locals = {
  site: {
    title: 'David Minnerly',
    url: 'http://davidminnerly.com'
  }
}

// Paths to the files that need to be compiled.
var paths = {
  css: src('css'),
  img: src('img'),
  js: src('js'),

  // Static files that don't require pre-processing. They're simply moved when
  // building the site.
  static: [
    src('favicon.ico')
  ]
}

// Remote repositories for deploying the site. These can only be pushed to with
// proper authorization.
var remotes = {
  staging: 'ssh://git@davidminnerly.com/~/beta.davidminnerly.git',
  production: 'ssh://git@davidminnerly.com/~/davidminnerly.git'
}

// Compiling
// =============================================================================

function clean(done) {
  return del(BUILD_DIR, done);
}

function styles() {
  return gulp.src(path.join(paths.css, 'main.scss'), { base: SOURCE_DIR })
    .pipe(plumber())
    .pipe(sass({
      outputStyle: 'compressed'
    }))
    .pipe(gulp.dest(BUILD_DIR));
}

function images() {
  return gulp.src(path.join(paths.img, '**'), { base: SOURCE_DIR })
    .pipe(gulp.dest(BUILD_DIR));
}

function scripts() {
  return gulp.src(path.join(paths.js, '**'), { base: SOURCE_DIR })
    .pipe(plumber())
    .pipe(gulp.dest(BUILD_DIR));
}

function templates() {
  return gulp.src(path.join(SOURCE_DIR, '*.pug'))
    .pipe(plumber())
    .pipe(pug({
      locals: locals
    }))
    .pipe(gulp.dest(BUILD_DIR));
}

// Moving files that aren't processed by the above tasks.
function move() {
  return gulp.src(paths.static)
    .pipe(plumber())
    .pipe(gulp.dest(BUILD_DIR));
}

gulp.task('compile', gulp.parallel(move, templates, styles, images, scripts));
gulp.task('build', gulp.series(clean, 'compile'));


// Development
// =============================================================================

function server() {
  connect.server({<commit_msg>We don't need to use plumber on static files<commit_after>var gulp = require('gulp');
var connect = require('gulp-connect');
var sass = require('gulp-sass');
var plumber = require('gulp-plumber');
var pug = require('gulp-pug'); // formerly Jade

var del = require('del');
var path = require('path');
var git = require('simple-git');


// Configuration
// =============================================================================

// This is where the source code is stored.
const SOURCE_DIR = 'src'
const BUILD_DIR = 'build'

// Used for retrieving files/folders in the source directory.
function src(f) {
  return path.join(SOURCE_DIR, f);
}

var locals = {
  site: {
    title: 'David Minnerly',
    url: 'http://davidminnerly.com'
  }
}

// Paths to the files that need to be compiled.
var paths = {
  css: src('css'),
  img: src('img'),
  js: src('js'),

  // Static files that don't require pre-processing. They're simply moved when
  // building the site.
  static: [
    src('favicon.ico')
  ]
}

// Remote repositories for deploying the site. These can only be pushed to with
// proper authorization.
var remotes = {
  staging: 'ssh://git@davidminnerly.com/~/beta.davidminnerly.git',
  production: 'ssh://git@david<EMAIL>nerly.com/~/davidminnerly.git'
}

// Compiling
// =============================================================================

function clean(done) {
  return del(BUILD_DIR, done);
}

function styles() {
  return gulp.src(path.join(paths.css, 'main.scss'), { base: SOURCE_DIR })
    .pipe(plumber())
    .pipe(sass({
      outputStyle: 'compressed'
    }))
    .pipe(gulp.dest(BUILD_DIR));
}

function images() {
  return gulp.src(path.join(paths.img, '**'), { base: SOURCE_DIR })
    .pipe(gulp.dest(BUILD_DIR));
}

function scripts() {
  return gulp.src(path.join(paths.js, '**'), { base: SOURCE_DIR })
    .pipe(plumber())
    .pipe(gulp.dest(BUILD_DIR));
}

function templates() {
  return gulp.src(path.join(SOURCE_DIR, '*.pug'))
    .pipe(plumber())
    .pipe(pug({
      locals: locals
    }))
    .pipe(gulp.dest(BUILD_DIR));
}

// Moving files that aren't processed by the above tasks.
function move() {
  return gulp.src(paths.static)
    .pipe(gulp.dest(BUILD_DIR));
}

gulp.task('compile', gulp.parallel(move, templates, styles, images, scripts));
gulp.task('build', gulp.series(clean, 'compile'));


// Development
// =============================================================================

function server() {
  connect.server({
{'fraction_non_alphanumeric': 0.24838449111470112, 'fraction_numerical': 0.0, 'mean_word_length': 4.100926879505664, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 3, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6218078', 'n_tokens_mistral': 1647, 'n_tokens_neox': 1583, 'n_words': 378}