<commit_before>'use strict';

require('jshint-stylish');

var gulp = require('gulp'),
    uglify = require('gulp-uglify'),
    sourcemaps = require('gulp-sourcemaps'),
    jshint = require('gulp-jshint'),
    header = require('gulp-header'),
    browserify = require('browserify'),
    webserver = require('gulp-webserver'),
    rename = require('gulp-rename'),
    pkg = require('./package.json'),
    source = require('vinyl-source-stream'),
    buffer = require('vinyl-buffer'),
    babelify = require('babelify'),
    IW = {};

IW.banner = [
  '/**',
  ' ** <%= pkg.name %> - <%= pkg.description %>',
  ' ** @author <%= pkg.author %>',
  ' ** @version v<%= pkg.version %>',
  ' **/',
  ''
].join('\n');

IW._paths = {
    main: './src/index.js',
    js: './src/**/*.js',
    demo: './demo',
    demoJS: './demo/js'
};
IW.minifiedName = 'ironwing.min.js';

gulp.task('build', ['lint'], function() {
  var b = browserify({
    entries: IW._paths.main,
    debug: true
  });

  return b.bundle()
         .pipe(source('app.min.js'))
         .pipe(buffer())
         .pipe(uglify({
          mangle: false
         }))
        .pipe(header(IW.banner, { pkg: pkg }))
        .pipe(rename('ironwing.min.js'))
        .pipe(gulp.dest('dist'));
});

gulp.task('scripts', ['lint'], function() {
  var b = browserify({
    entries: IW._paths.main,
    debug: true
  }).transform(babelify);

  return b.bundle()
         .pipe(source('app.min.js'))
         .pipe(buffer())
        .pipe(sourcemaps.init({loadMaps: true, debug: true}))
        // .pipe(uglify())
        .pipe(header(IW.banner, { pkg: pkg }))
        .pipe(sourcemaps.write('./'))
        .pipe(gulp.dest(IW._paths.demoJS));
});

gulp.task('lint', function() {
    return gulp.src(IW._paths.js)
        .pipe(jshint())
        .pipe(jshint.reporter('jshint-stylish'))
        .pipe(jshint.reporter('fail'));
});

gulp.task('webserver', function() {
  gulp.src(IW._paths.demo)
    .pipe(webserver({
      open: true
    }));
});

gulp.task('default', ['webserver'], function() {
    gulp.watch(IW._paths.js, ['scripts']);
});
<commit_msg>Fixed build task<commit_after>'use strict';

require('jshint-stylish');

var gulp = require('gulp'),
    uglify = require('gulp-uglify'),
    sourcemaps = require('gulp-sourcemaps'),
    jshint = require('gulp-jshint'),
    header = require('gulp-header'),
    browserify = require('browserify'),
    webserver = require('gulp-webserver'),
    rename = require('gulp-rename'),
    pkg = require('./package.json'),
    source = require('vinyl-source-stream'),
    buffer = require('vinyl-buffer'),
    babelify = require('babelify'),
    IW = {};

IW.banner = [
  '/**',
  ' ** <%= pkg.name %> - <%= pkg.description %>',
  ' ** @author <%= pkg.author %>',
  ' ** @version v<%= pkg.version %>',
  ' **/',
  ''
].join('\n');

IW._paths = {
    main: './src/index.js',
    js: './src/**/*.js',
    demo: './demo',
    demoJS: './demo/js'
};
IW.minifiedName = 'ironwing.min.js';

gulp.task('build', ['lint'], function() {
  var b = browserify({
    entries: IW._paths.main,
    debug: true
  }).transform(babelify);

  return b.bundle()
         .pipe(source('app.min.js'))
         .pipe(buffer())
         .pipe(uglify({
          mangle: false
         }))
        .pipe(header(IW.banner, { pkg: pkg }))
        .pipe(rename('ironwing.min.js'))
        .pipe(gulp.dest('dist'));
});

gulp.task('scripts', ['lint'], function() {
  var b = browserify({
    entries: IW._paths.main,
    debug: true
  }).transform(babelify);

  return b.bundle()
         .pipe(source('app.min.js'))
         .pipe(buffer())
        .pipe(sourcemaps.init({loadMaps: true, debug: true}))
        // .pipe(uglify())
        .pipe(header(IW.banner, { pkg: pkg }))
        .pipe(sourcemaps.write('./'))
        .pipe(gulp.dest(IW._paths.demoJS));
});

gulp.task('lint', function() {
    return gulp.src(IW._paths.js)
        .pipe(jshint())
        .pipe(jshint.reporter('jshint-stylish'))
        .pipe(jshint.reporter('fail'));
});

gulp.task('webserver', function() {
  gulp.src(IW._paths.demo)
    .pipe(webserver({
      open: true
    }));
});

gulp.task('default', ['webserver'], function() {
    gulp.watch(IW._paths.js, ['scripts']);
});

{'fraction_non_alphanumeric': 0.2263569566247926, 'fraction_numerical': 0.0, 'mean_word_length': 2.734513274336283, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '6361576', 'n_tokens_mistral': 1551, 'n_tokens_neox': 1511, 'n_words': 231}