<commit_before>import gulp from 'gulp';

gulp.task('clean', () => {
    let del = require('del');
    return del(['build/', 'lib/*.js']);
});

// Build

if ( parseInt(process.versions.node) < 4 ) {
    gulp.task('compile', () => {
        let babel = require('gulp-babel');
        return gulp.src('lib/*.es6')
            .pipe(babel())
            .pipe(gulp.dest('lib'));
    });
} else {
    gulp.task('compile', () => {
        let sourcemaps = require('gulp-sourcemaps');
        let changed    = require('gulp-changed');
        let babel      = require('gulp-babel');
        return gulp.src('lib/*.es6')
            .pipe(changed('lib', { extension: '.js' }))
            .pipe(sourcemaps.init())
            .pipe(babel())
            .pipe(sourcemaps.write())
            .pipe(gulp.dest('lib'));
    });
}

gulp.task('build:lib', ['compile'], () => {
    return gulp.src('lib/*.js').pipe(gulp.dest('build/lib'));
});

gulp.task('build:docs', () => {
    let ignore = require('fs').readFileSync('.npmignore').toString()
        .trim().split(/\n+/)
        .concat(['.npmignore'])
        .map( i => '!' + i );
    return gulp.src(['*'].concat(ignore))
        .pipe(gulp.dest('build'));
});

gulp.task('build', (done) => {
    let runSequence = require('run-sequence');
    runSequence('clean', ['build:lib', 'build:docs'], done);
});

// Lint

gulp.task('lint', () => {
    if ( parseInt(process.versions.node) < 4 ) {
        return false;
    }
    let eslint = require('gulp-eslint');
    return gulp.src(['*.js', 'lib/*.es6', 'test/*.js'])
        .pipe(eslint())
        .pipe(eslint.format())
        .pipe(eslint.failAfterError());
});

// Test

gulp.task('test', ['compile'], () => {
    let ava = require('gulp-ava');
    return gulp.src('test/*.es6', { read: false }).pipe(ava());
});

gulp.task('integration', ['compile'], done => {
    let postcss = require('postcss');
    let real    = require('postcss-parser-tests/real');
    let scss    = require('./');
    real(done, css => {
        return postcss().process(css, {<commit_msg>Remove node.js < 4 support<commit_after>import gulp from 'gulp';

gulp.task('clean', () => {
    let del = require('del');
    return del(['build/', 'lib/*.js']);
});

// Build

gulp.task('compile', () => {
    let sourcemaps = require('gulp-sourcemaps');
    let changed    = require('gulp-changed');
    let babel      = require('gulp-babel');
    return gulp.src('lib/*.es6')
        .pipe(changed('lib', { extension: '.js' }))
        .pipe(sourcemaps.init())
        .pipe(babel())
        .pipe(sourcemaps.write())
        .pipe(gulp.dest('lib'));
});

gulp.task('build:lib', ['compile'], () => {
    return gulp.src('lib/*.js').pipe(gulp.dest('build/lib'));
});

gulp.task('build:docs', () => {
    let ignore = require('fs').readFileSync('.npmignore').toString()
        .trim().split(/\n+/)
        .concat(['.npmignore'])
        .map( i => '!' + i );
    return gulp.src(['*'].concat(ignore))
        .pipe(gulp.dest('build'));
});

gulp.task('build', (done) => {
    let runSequence = require('run-sequence');
    runSequence('clean', ['build:lib', 'build:docs'], done);
});

// Lint

gulp.task('lint', () => {
    let eslint = require('gulp-eslint');
    return gulp.src(['*.js', 'lib/*.es6', 'test/*.js'])
        .pipe(eslint())
        .pipe(eslint.format())
        .pipe(eslint.failAfterError());
});

// Test

gulp.task('test', ['compile'], () => {
    let ava = require('gulp-ava');
    return gulp.src('test/*.es6', { read: false }).pipe(ava());
});

gulp.task('integration', ['compile'], done => {
    let postcss = require('postcss');
    let real    = require('postcss-parser-tests/real');
    let scss    = require('./');
    real(done, css => {
        return postcss().process(css, {
{'fraction_non_alphanumeric': 0.24276996550809232, 'fraction_numerical': 0.0026532236667551074, 'mean_word_length': 2.7033398821218073, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 24, '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': '1601216', 'n_tokens_mistral': 1292, 'n_tokens_neox': 1278, 'n_words': 210}