<commit_before>var gulp     = require('gulp');
var $        = require('gulp-load-plugins')();
var mq       = require('media-query-extractor');
var rimraf   = require('rimraf');
var panini = require('panini');
var yargs    = require('yargs').argv;
var sequence = require('run-sequence');
var browser  = require('browser-sync');

// Look for the --production flag
var isProduction = !!(yargs.production);

// Delete the "dist" folder
// This happens every time a build starts
gulp.task('clean', function(done) {
  rimraf('../_build', done);
});

// Compile layouts, pages, and partials into flat HTML files
// Then parse using Inky templates
gulp.task('pages', function() {
  return gulp.src('./pages/**/*.html')
    .pipe(panini({
      root: './pages',
      layouts: './layouts'
    }))
    .pipe($.inky())
    .pipe(gulp.dest('../_build'));
});

// Compile Sass into CSS
gulp.task('sass', function() {
  return gulp.src('./scss/app.scss')
    .pipe($.sass().on('error', $.sass.logError))
    .pipe(gulp.dest('../_build/css'));
});

// Inline CSS and minify HTML
gulp.task('inline', function() {
  return gulp.src('../_build/*.html')
    .pipe(inline({
      css: '../_build/css/ink.css'
    }))
    .pipe(gulp.dest('../_build'));
});

gulp.task('server', ['build'], function() {
  browser.init({
    server: '../_build'
  });
});

// Build the "dist" folder by running all of the above tasks
gulp.task('build', function(cb) {
  var tasks = ['clean', ['pages', 'sass']];
  if (isProduction) tasks.push('inline');
  tasks.push(cb);
  sequence.apply(this, tasks);
});

// Build emails, run the server, and watch for file changes
gulp.task('default', ['server'], function() {
  gulp.watch('./pages/**/*.html', ['pages', browser.reload]);
  gulp.watch(['../scss/**/*.scss', './scss/**/*.scss'], ['sass', browser.reload]);
});

function inline(options) {
  var lazypipe = require('lazypipe');
  var cssPath = options.css;
  var cssMqPath = cssPath.replace(/\.css$/, '-mq.css');<commit_msg>Fix test inliner referencing the wrong CSS file<commit_after>var gulp     = require('gulp');
var $        = require('gulp-load-plugins')();
var mq       = require('media-query-extractor');
var rimraf   = require('rimraf');
var panini = require('panini');
var yargs    = require('yargs').argv;
var sequence = require('run-sequence');
var browser  = require('browser-sync');

console.log(process.argv);

// Look for the --production flag
var isProduction = !!(yargs.production);

// Delete the "dist" folder
// This happens every time a build starts
gulp.task('clean', function(done) {
  rimraf('../_build', done);
});

// Compile layouts, pages, and partials into flat HTML files
// Then parse using Inky templates
gulp.task('pages', function() {
  return gulp.src('./pages/**/*.html')
    .pipe(panini({
      root: './pages',
      layouts: './layouts'
    }))
    .pipe($.inky())
    .pipe(gulp.dest('../_build'));
});

// Compile Sass into CSS
gulp.task('sass', function() {
  return gulp.src('./scss/app.scss')
    .pipe($.sass().on('error', $.sass.logError))
    .pipe(gulp.dest('../_build/css'));
});

// Inline CSS and minify HTML
gulp.task('inline', function() {
  return gulp.src('../_build/*.html')
    .pipe(inline({
      css: '../_build/css/app.css'
    }))
    .pipe(gulp.dest('../_build'));
});

gulp.task('server', ['build'], function() {
  browser.init({
    server: '../_build'
  });
});

// Build the "dist" folder by running all of the above tasks
gulp.task('build', function(cb) {
  var tasks = ['clean', ['pages', 'sass']];
  if (isProduction) tasks.push('inline');
  tasks.push(cb);
  sequence.apply(this, tasks);
});

// Build emails, run the server, and watch for file changes
gulp.task('default', ['server'], function() {
  gulp.watch('./pages/**/*.html', ['pages', browser.reload]);
  gulp.watch(['../scss/**/*.scss', './scss/**/*.scss'], ['sass', browser.reload]);
});

function inline(options) {
  var lazypipe = require('lazypipe');
  var cssPath = options.css;
  var cssMqPath = cssPath.replace(/\.css$/, '-mq.css');
{'fraction_non_alphanumeric': 0.22197420634920634, 'fraction_numerical': 0.0, 'mean_word_length': 3.5011160714285716, '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': '5584483', 'n_tokens_mistral': 1375, 'n_tokens_neox': 1354, 'n_words': 321}