<commit_before>// http://blog.ponyfoo.com/2014/01/27/my-first-gulp-adventure
var gulp = require('gulp');
var gutil = require('gulp-util');
var bump = require('gulp-bump');
var git = require('gulp-git');
var jshint = require('gulp-jshint');
var clean = require('gulp-clean');
var rename = require('gulp-rename');
var uglify = require('gulp-uglify');
var size = require('gulp-size');
var connect = require('connect');
var mocha = require('gulp-mocha');
var mochaPhantomJS = require('gulp-mocha-phantomjs');

var BUMP_TYPES = ['major', 'minor', 'patch', 'prerelease'];

gulp.task('lint', function () {
  gulp.src('./src/*.js')
    .pipe(jshint())
    .pipe(jshint.reporter('default'));
});

gulp.task('mocha', function () {
  return gulp.src('test/index.html')
          .pipe(mochaPhantomJS({reporter: 'list'}));
});

gulp.task('build', ['lint'], function () {
  gulp.src('./src/jquery.textarea_autosize.js')
    .pipe(gulp.dest('./dist'))
    .pipe(rename('jquery.textarea_autosize.min.js'))
    .pipe(uglify())
    .pipe(size({showFiles: true}))
    .pipe(gulp.dest('./dist'));
});

gulp.task('watch', ['build'], function() {
  return gulp.watch('src/*.js', ['build']);
});

gulp.task('validation', function () {
  if (BUMP_TYPES.indexOf(gutil.env.type) == -1)
    throw new Error('\ntype argument is required for gulp bump\nSupported values: major, minor, patch, prerelease\n\nExample:\n\tgulp bump --type major');
});

gulp.task('bump', ['validation', 'build'], function () {
  return gulp.src(['./package.json', './bower.json'])
    .pipe(bump({type: gutil.env.type}))
    .pipe(gulp.dest('./'));
});

gulp.task('tag', ['build'], function () {
  var pkg = require('./package.json');
  var v = 'v' + pkg.version;
  var message = 'Release ' + v;

  return gulp.src('./')
    .pipe(git.commit(message))
    .pipe(git.tag(v, message))
    .pipe(git.push('origin', 'master', '--tags'))
    .pipe(gulp.dest('./'));
});

gulp.task('npm', ['tag'], function (done) {
  require('child_process')
    .spawn('npm', ['publish'], { stdio: 'inherit' })
    .on('close', done);
});

gulp.task('server', function() {
  connect.createServer(connect.static(__dirname)).listen(3000);
});

gulp.task('browser', ['server'], function() {
  child_process.spawn('open', ['http://localhost:3000/index.html']);
});

gulp.task('test', ['lint', 'mocha']);
gulp.task('ci', ['build']);
gulp.task('release', ['npm']);

gulp.task('default', ['watch', 'browser']);
<commit_msg>Replace gulp git with command line calls<commit_after>// http://blog.ponyfoo.com/2014/01/27/my-first-gulp-adventure
var gulp = require('gulp');
var gutil = require('gulp-util');
var bump = require('gulp-bump');
var git = require('gulp-git');
var jshint = require('gulp-jshint');
var clean = require('gulp-clean');
var rename = require('gulp-rename');
var uglify = require('gulp-uglify');
var size = require('gulp-size');
var connect = require('connect');
var mocha = require('gulp-mocha');
var mochaPhantomJS = require('gulp-mocha-phantomjs');

var BUMP_TYPES = ['major', 'minor', 'patch', 'prerelease'];

gulp.task('lint', function () {
  gulp.src('./src/*.js')
    .pipe(jshint())
    .pipe(jshint.reporter('default'));
});

gulp.task('mocha', function () {
  return gulp.src('test/index.html')
          .pipe(mochaPhantomJS({reporter: 'list'}));
});

gulp.task('build', ['lint'], function () {
  gulp.src('./src/jquery.textarea_autosize.js')
    .pipe(gulp.dest('./dist'))
    .pipe(rename('jquery.textarea_autosize.min.js'))
    .pipe(uglify())
    .pipe(size({showFiles: true}))
    .pipe(gulp.dest('./dist'));
});

gulp.task('watch', ['build'], function() {
  return gulp.watch('src/*.js', ['build']);
});

gulp.task('validation', function () {
  if (BUMP_TYPES.indexOf(gutil.env.type) == -1)
    throw new Error('\ntype argument is required for gulp bump\nSupported values: major, minor, patch, prerelease\n\nExample:\n\tgulp bump --type major');
});

gulp.task('bump', ['validation', 'build'], function () {
  return gulp.src(['./package.json', './bower.json'])
    .pipe(bump({type: gutil.env.type}))
    .pipe(gulp.dest('./'));
});

gulp.task('tag', ['build'], function () {
  var pkg = require('./package.json');
  var v = 'v' + pkg.version;
  var message = 'Release ' + v;
  
  var exec = require('child_process').exec;
  exec('git commit -a -m "' + message + '"', function (error, stdout, stderr) {});
  exec('git tag -a -m "' + message + '"', function (error, stdout, stderr) {});
  exec('git push origin --tags', function (error, stdout, stderr) {});
});

gulp.task('npm', ['tag'], function (done) {
  require('child_process')
    .spawn('npm', ['publish'], { stdio: 'inherit' })
    .on('close', done);
});

gulp.task('server', function() {
  connect.createServer(connect.static(__dirname)).listen(3000);
});

gulp.task('browser', ['server'], function() {
  child_process.spawn('open', ['http://localhost:3000/index.html']);
});

gulp.task('test', ['lint', 'mocha']);
gulp.task('ci', ['build']);
gulp.task('release', ['npm']);

gulp.task('default', ['watch', 'browser']);

{'fraction_non_alphanumeric': 0.24270109235352533, 'fraction_numerical': 0.006752730883813307, 'mean_word_length': 4.515881708652793, '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': '2517147', 'n_tokens_mistral': 1850, 'n_tokens_neox': 1800, 'n_words': 336}