<commit_before>var browserSync = require('browser-sync').create();
var concat = require('gulp-concat');
var data = require('gulp-data');
var fs = require('fs');
var gutil = require('gulp-util');
var handlebars = require('gulp-compile-handlebars');
var minify = require('gulp-clean-css');
var path = require('path');
var rename = require('gulp-rename');
var sass = require('gulp-sass');
var extend = require('extend');
var clean = require('gulp-clean');
var merge = require('gulp-merge');

module.exports = function (gulp, config) {

    config = extend(true, {
        language: "en",
        languages: [],
        dirs: {
            dist: "./dist",
            src: "./src",
            scss: "./scss",
        },
        handlebars: {
            helpers: {}
        },
    }, config);

    gutil.log("Config", gutil.colors.magenta(JSON.stringify(config)))

    gulp.task('default', ['serve']);

    gulp.task('serve', ['build'], function () {

        browserSync.init({
            server: config.dirs.dist,
            notify: false,
            reloadOnRestart: true,
            open: false,
            online: false,
            logLevel: 'info',
            ui: false,
        });

        gulp.watch([path.join(config.dirs.scss, '**/*.scss')], ['scss']);
        gulp.watch([
                path.join(config.dirs.src, 'data/**/*.json'),
                path.join(config.dirs.src, '**/*.hbs')
            ], ['handlebars'])
            .on('change', browserSync.reload);

    });

    gulp.task('build', ['handlebars', 'scss', 'static']);

    gulp.task('clean', function () {
        return gulp.src(config.dirs.dist, {
                read: false
            })
            .pipe(clean());
    });

    gulp.task('handlebars', function (cb) {

        if (config.languages) {
            config.languages.forEach(function (lang, index) {
                _buildPages(lang, lang);
            });
        } else {
            _buildPages(config.language, config.language);
        }

        _buildPages(config.language, "");

        cb();
    });

    gulp.task('scss', function () {
        return gulp
            .src(path.join(config.dirs.scss, '**/*.scss'))
            .pipe(sass().on('error', sass.logError))
            .pipe(gulp.dest(path.join(config.dirs.dist, 'css')))
            .pipe(concat('style.css'))
            .pipe(minify())
            .pipe(rename('style.min.css'))
            .pipe(gulp.dest(path.join(config.dirs.dist, 'css')))
            .pipe(browserSync.stream());
    });

    gulp.task('static', function () {

        if (!config.statics) {
            return;
        }

        // merge.streams = [];
        config.statics.forEach(function (pack) {
            merge()
                .add(gulp
                    .src(pack.files)
                    .pipe(gulp.dest(pack.destination)));
        });
<commit_msg>fix sass not parsing style filename<commit_after>var browserSync = require('browser-sync').create();
var concat = require('gulp-concat');
var data = require('gulp-data');
var fs = require('fs');
var gutil = require('gulp-util');
var handlebars = require('gulp-compile-handlebars');
var minify = require('gulp-clean-css');
var path = require('path');
var rename = require('gulp-rename');
var sass = require('gulp-sass');
var extend = require('extend');
var clean = require('gulp-clean');
var merge = require('gulp-merge');

module.exports = function (gulp, config) {

    config = extend(true, {
        language: "en",
        languages: [],
        dirs: {
            dist: "./dist",
            src: "./src",
            scss: "./scss",
        },
        handlebars: {
            helpers: {}
        },
    }, config);

    gutil.log("Config", gutil.colors.magenta(JSON.stringify(config)))

    gulp.task('default', ['serve']);

    gulp.task('serve', ['build'], function () {

        browserSync.init({
            server: config.dirs.dist,
            notify: false,
            reloadOnRestart: true,
            open: false,
            online: false,
            logLevel: 'info',
            ui: false,
        });

        gulp.watch([path.join(config.dirs.scss, '**/*.scss')], ['scss']);
        gulp.watch([
                path.join(config.dirs.src, 'data/**/*.json'),
                path.join(config.dirs.src, '**/*.hbs')
            ], ['handlebars'])
            .on('change', browserSync.reload);

    });

    gulp.task('build', ['handlebars', 'scss', 'static']);

    gulp.task('clean', function () {
        return gulp.src(config.dirs.dist, {
                read: false
            })
            .pipe(clean());
    });

    gulp.task('handlebars', function (cb) {

        if (config.languages) {
            config.languages.forEach(function (lang, index) {
                _buildPages(lang, lang);
            });
        } else {
            _buildPages(config.language, config.language);
        }

        _buildPages(config.language, "");

        cb();
    });

    gulp.task('scss', function () {
        return gulp
            .src(path.join(config.dirs.scss, '**/*.scss'))
            .pipe(sass().on('error', sass.logError))
            .pipe(gulp.dest(path.join(config.dirs.dist, 'css')))
            .pipe(minify())
            .pipe(rename({
                suffix: ".min"
            }))
            .pipe(gulp.dest(path.join(config.dirs.dist, 'css')))
            .pipe(browserSync.stream());
    });

    gulp.task('static', function () {

        if (!config.statics) {
            return;
        }

        // merge.streams = [];
        config.statics.forEach(function (pack) {
            merge()
                .add(gulp
                    .src(pack.files)
                    .pipe(gulp.dest(pack.destination)));
        });

{'fraction_non_alphanumeric': 0.17855899756352245, 'fraction_numerical': 0.0, 'mean_word_length': 1.8185384992643452, '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': '6048356', 'n_tokens_mistral': 1771, 'n_tokens_neox': 1725, 'n_words': 296}