<commit_before>gulp = require 'gulp'
shell = require 'gulp-shell'
git = require 'gulp-git'
release = require('gulp-release-tasks')(gulp)
source = require 'vinyl-source-stream'
browserify = require 'browserify'
browser_sync = require 'browser-sync'

UPLOAD = 'node aws/upload.js'

# Git functions

branch = -> git.revParse 'HEAD', {args: "--abbrev-ref"}

# Create bundles using browerify

bundle = (name) ->
  browserify({
    cache: {}, packageCache: {}, fullPaths: true, # watchify
    entries: ["./src/#{name}.coffee"]
    extensions: ['.coffee']
    debug: true # source maps
  })
    .bundle()
    .pipe(source("#{name}.js"))
    .pipe(gulp.dest('./web/'));

all_builds = ['main']
for build in all_builds
  gulp.task build, -> bundle build

# Reload browser using browser-sync

sync_to = (dir) ->
  browser_sync {
    server: {baseDir: ["#{dir}"]}
    files: ["#{dir}/*"]
  }

dest = 'web'
gulp.task 'sync', -> sync_to 'web'  

# Watch and resync

all_src = ['src/*', 'src/*/*', '../reactive-coffee/src/*']
gulp.task 'watch', ['sync'], ->
  gulp.watch all_src, all_builds  

# Watch when run

gulp.task 'default', ['main', 'watch']
  
# Upload to S3

gulp.task 'upload', shell.task(['node aws/upload.js'])

# Tag and upload new feature

gulp.task 'ship', ['tag', 'upload']

# Push branch changes to master and github
gulp.task 'merge', ->
  current = branch()
  git.checkout 'master'
  git.merge current
  #shell.task ["gulp tag"]
  git.checkout current
<commit_msg>Add merge callback<commit_after>gulp = require 'gulp'
shell = require 'gulp-shell'
git = require 'gulp-git'
release = require('gulp-release-tasks')(gulp)
source = require 'vinyl-source-stream'
browserify = require 'browserify'
browser_sync = require 'browser-sync'

UPLOAD = 'node aws/upload.js'

# Git functions

branch = -> git.revParse 'HEAD', {args: "--abbrev-ref"}

# Create bundles using browerify

bundle = (name) ->
  browserify({
    cache: {}, packageCache: {}, fullPaths: true, # watchify
    entries: ["./src/#{name}.coffee"]
    extensions: ['.coffee']
    debug: true # source maps
  })
    .bundle()
    .pipe(source("#{name}.js"))
    .pipe(gulp.dest('./web/'));

all_builds = ['main']
for build in all_builds
  gulp.task build, -> bundle build

# Reload browser using browser-sync

sync_to = (dir) ->
  browser_sync {
    server: {baseDir: ["#{dir}"]}
    files: ["#{dir}/*"]
  }

dest = 'web'
gulp.task 'sync', -> sync_to 'web'  

# Watch and resync

all_src = ['src/*', 'src/*/*', '../reactive-coffee/src/*']
gulp.task 'watch', ['sync'], ->
  gulp.watch all_src, all_builds  

# Watch when run

gulp.task 'default', ['main', 'watch']
  
# Upload to S3

gulp.task 'upload', shell.task(['node aws/upload.js'])

# Tag and upload new feature

gulp.task 'ship', ['tag', 'upload']

# Push branch changes to master and github
gulp.task 'merge', ->
  current = branch()
  git.checkout 'master'
  git.merge current, (err) -> if (err) throw err
  git.checkout current

{'fraction_non_alphanumeric': 0.1835765184933831, 'fraction_numerical': 0.0006786562606040041, 'mean_word_length': 3.6498422712933754, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 18, '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': '1016383', 'n_tokens_mistral': 1065, 'n_tokens_neox': 1056, 'n_words': 278}