<commit_before>var gulp = require('gulp'),
    mocha = require('gulp-mocha'),
    rjs = require('gulp-requirejs'),
    uglify = require('gulp-uglify'),
    jshint = require('gulp-jshint'),
    stylish = require('jshint-stylish'),
    docco = require('gulp-docco'),
    rename = require('gulp-rename'),
    theCode = ['src/**/*.js','tests/**/*.js'];

gulp.task('default', ['lint', 'build', 'test', 'docs']);

gulp.task('lint', function() {
  gulp.src(theCode).pipe(jshint()).pipe(jshint.reporter(stylish));
});

gulp.task('build', function() {
  rjs({
    baseUrl: 'src',
    // Use packages so module names to not conflict with other libraries.
    // For example, without using packages, the combined file would include
    // define('myHelperModule'), but using packages, it changes to
    // define('myModule/myHelperModule'), which is less likely to produce a conflict.
    packages: [
      {
        name: 'myModule',
        main: 'myModule',
        location: '.'
      }
    ],
    name: 'myModule',
    out: 'myModule.js'
  }).pipe(gulp.dest('dist'))
    .pipe(uglify())
    .pipe(rename('myModule-min.js'))
    .pipe(gulp.dest('dist'));
});

gulp.task('test', ['build'], function () {
  gulp.src(['tests/**/*.js'])
    .pipe(mocha({ reporter: 'spec' }));
});

gulp.task('docs', function () {
  gulp.src(theCode).pipe(docco()).pipe(gulp.dest('docs'))
});<commit_msg>Refactored gulpfile to use moduleName variable<commit_after>var gulp = require('gulp'),
    mocha = require('gulp-mocha'),
    rjs = require('gulp-requirejs'),
    uglify = require('gulp-uglify'),
    jshint = require('gulp-jshint'),
    stylish = require('jshint-stylish'),
    docco = require('gulp-docco'),
    rename = require('gulp-rename'),
    theCode = ['src/**/*.js','tests/**/*.js'],
    moduleName = 'myModule';

gulp.task('default', ['lint', 'build', 'test', 'docs']);

gulp.task('lint', function() {
  gulp.src(theCode)
    .pipe(jshint())
    .pipe(jshint.reporter(stylish));
});

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

  // Bundle all the AMD modules together into a single file.
  rjs({
    // Use packages so module names to not conflict with other libraries.
    // For example, without using packages, the combined file would include
    // define('myHelperModule'), but using packages, it changes to
    // define('myModule/myHelperModule'), which is less likely to produce a conflict.
    packages: [
      {
        name: moduleName,
        main: moduleName,
        location: '.'
      }
    ],
    name: moduleName,
    out: moduleName + '.js',
    baseUrl: 'src',
  })
    // Output the non-minified version.
    .pipe(gulp.dest('dist'))

    // Output the minified version.
    .pipe(uglify())
    .pipe(rename(moduleName + '-min.js'))
    .pipe(gulp.dest('dist'));
});

gulp.task('test', ['build'], function () {
  gulp.src(['tests/**/*.js'])
    .pipe(mocha({ reporter: 'spec' }));
});

gulp.task('docs', function () {
  gulp.src(theCode).pipe(docco()).pipe(gulp.dest('docs'))
});
{'fraction_non_alphanumeric': 0.19973145350788854, 'fraction_numerical': 0.0, 'mean_word_length': 3.3125904486251807, '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': '5161669', 'n_tokens_mistral': 1008, 'n_tokens_neox': 1012, 'n_words': 215}