<commit_before>LOCALS = require("./locals.json")
{dir, server} = require("./config.json")
gulp = require("gulp")
$ = require("gulp-load-plugins")(lazy: false) #plugins

# if port is in use and  Error: listen EADDRINUSE is thrown run
# $ netstat -a -t -p
# get pid of proccess using portand kill like so
# kill -9 PID

gulp.task "connect", $.connect.server(
  host: server.hostname
  root: [dir.build]
  port: server.port
  livereload:
    port: server.livereload
)

gulp.task "jade", ->
  gulp.src(dir.source + "/*.jade")
    .pipe $.jade(locals: LOCALS)
    .pipe gulp.dest(dir.build)
    .pipe $.connect.reload()
    .pipe $.notify(message: "Jade task complete")

gulp.task "coffee", ->
  gulp.src(dir.source + dir.scripts + "**/*.coffee")
    .pipe $.coffeelint()
    .pipe $.coffeelint.reporter()
    .pipe $.coffee(bare: true).on("error", $.util.log)
    .pipe $.concat("main.js")
    .pipe gulp.dest(dir.dist + dir.scripts)
    .pipe $.rename(suffix: ".min")
    .pipe $.uglify()
    .pipe gulp.dest(dir.dist + dir.scripts)
    .pipe $.connect.reload()
    .pipe $.notify(message: "Scripts task complete")

gulp.task "stylus", ->
  gulp.src(dir.source + dir.styles + "*.styl")
    .pipe $.stylus(
      use: ["nib"]
      import: ["nib"]
    )
    .pipe gulp.dest(dir.dist + dir.styles)
    .pipe $.connect.reload()
    .pipe $.notify(message: "Styles task complete")

gulp.task "images", ->
  gulp.src(dir.source + dir.images + "**/*")
    .pipe $.newer(dir.dist + dir.images)
    .pipe $.imagemin(
      optimizationLevel: 3
      progressive: true
      interlaced: true
    )
    .pipe $.connect.reload()
    .pipe gulp.dest(dir.dist + dir.images)
    .pipe $.notify(message: "Images task complete")

gulp.task "clean", ->
  gulp.src(dir.build, read: false)
    .pipe $.clean()
    .pipe $.notify(message: "Clean task complete")

gulp.task "default", ["clean"], ->
  gulp.start "stylus", "coffee", "images", "jade"
  return<commit_msg>fix dir.dist is undefined in templates/gulpfile<commit_after>LOCALS = require("./locals.json")
{dir, server} = require("./config.json")
gulp = require("gulp")
$ = require("gulp-load-plugins")(lazy: false) #plugins

# if port is in use and Error: listen EADDRINUSE is thrown run
# $ netstat -a -t -p
# get pid of proccess using port and kill it like so
# $kill -9 PID

gulp.task "connect", $.connect.server(
  host: server.hostname
  root: [dir.build]
  port: server.port
  livereload:
    port: server.livereload
)

gulp.task "jade", ->
  gulp.src(dir.source + "/*.jade")
    .pipe $.jade(locals: LOCALS)
    .pipe gulp.dest(dir.build)
    .pipe $.connect.reload()
    .pipe $.notify(message: "Jade task complete")

gulp.task "coffee", ->
  gulp.src(dir.source + dir.scripts + "**/*.coffee")
    .pipe $.coffeelint()
    .pipe $.coffeelint.reporter()
    .pipe $.coffee(bare: true).on("error", $.util.log)
    .pipe $.concat("main.js")
    .pipe gulp.dest(dir.build + dir.scripts)
    .pipe $.rename(suffix: ".min")
    .pipe $.uglify()
    .pipe gulp.dest(dir.build + dir.scripts)
    .pipe $.connect.reload()
    .pipe $.notify(message: "Scripts task complete")

gulp.task "stylus", ->
  gulp.src(dir.source + dir.styles + "*.styl")
    .pipe $.stylus(
      use: ["nib"]
      import: ["nib"]
    )
    .pipe gulp.dest(dir.build + dir.styles)
    .pipe $.connect.reload()
    .pipe $.notify(message: "Styles task complete")

gulp.task "images", ->
  gulp.src(dir.source + dir.images + "**/*")
    .pipe $.newer(dir.build + dir.images)
    .pipe $.imagemin(
      optimizationLevel: 3
      progressive: true
      interlaced: true
    )
    .pipe $.connect.reload()
    .pipe gulp.dest(dir.build + dir.images)
    .pipe $.notify(message: "Images task complete")

gulp.task "clean", ->
  gulp.src(dir.build, read: false)
    .pipe $.clean()
    .pipe $.notify(message: "Clean task complete")

gulp.task "default", ["clean"], ->
  gulp.start "stylus", "coffee", "images", "jade"
  return
{'fraction_non_alphanumeric': 0.1853546910755149, 'fraction_numerical': 0.0010170353419781336, 'mean_word_length': 2.9617321248741186, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '7557222', 'n_tokens_mistral': 1457, 'n_tokens_neox': 1440, 'n_words': 338}