<commit_before>gulp = require 'gulp'
plugins = require('gulp-load-plugins')(pattern: [
  '*{-,.}*'
  'csswring'
])



gulp.task 'jade', ->
  gulp.src '_src/**/*.jade'
  .pipe plugins.changed '.', extension: '.html'
  .pipe plugins.jadeInheritance basedir: '_src/'
  .pipe plugins.filter (file) ->
    !/\/_/.test(file.path) or !/^_/.test(file.relative)
  .pipe plugins.jade
    pretty: true
    client: false
  .pipe gulp.dest '.'
  return

gulp.task 'css', ->
  processors = [
    plugins.autoprefixerCore browsers: ['last 2 versions','ie 8']
    plugins.cssMqpacker
    plugins.csswring
    plugins.postcssAssets {loadPaths: ['images/','fonts/']}
  ]
  gulp.src '_src/styles/common.styl'
  .pipe plugins.sourcemaps.init()
  .pipe plugins.stylus()
  .pipe plugins.postcss processors
  .pipe plugins.rename suffix: '.min'
  .pipe plugins.sourcemaps.write '.'
  .pipe gulp.dest 'styles'
  return

gulp.task 'uglify', ->
  gulp.src '_src/vendor/**/*.js'
  .pipe plugins.concat 'common.min.js'
  .pipe plugins.uglify()
  .pipe gulp.dest 'scripts'
  return

#gulp.task 'modernizr', ->
#  gulp.src 'scripts/*.js'
#  .pipe plugins.modernizr
#    options: ['setClasses','addTest','html5printshiv','testProp','fnBind']
#    tests: ['forms_placeholder','flexbox','backgroundsize','audio','video','svg','touch','csstransforms']
#  .pipe plugins.uglify()
#  .pipe gulp.dest 'scripts'
#  return

gulp.task 'sprite', ->
  spriteData = gulp.src('_src/sprite/*.png')
  .pipe plugins.spritesmith
    algorithm: 'binary-tree'
    padding: 4
    imgName: 'sprite.png'
    cssName: 'sprite.json'
  spriteData.img.pipe gulp.dest 'images'
  spriteData.css.pipe gulp.dest '_src/styles/sprite'
  return

gulp.task 'imagemin', ->
  gulp.src 'images/*'
  .pipe plugins.imagemin
    progressive: true
    svgoPlugins: [ { removeViewBox: false } ]
    use: [ plugins.imageminPngquant() ]
  .pipe gulp.dest 'images'
  return

gulp.task 'browser-sync', ->
  plugins.browserSync.init ['*.html','styles/common.min.css','**/*.{png,jpg,svg}','scripts/main.js','scripts/common.min.js'],
    open: false
    server: baseDir: '.'
  return



gulp.task 'default', ['browser-sync'], ->
  gulp.watch '_src/**/*.styl',      ['css']
  gulp.watch '_src/**/*.jade',      ['jade']
  gulp.watch '_src/vendor/**/*.js', ['uglify']
  gulp.watch '_src/sprite/*',       ['sprite']
  gulp.watch 'images/*',            ['imagemin']
  return<commit_msg>Remove imagemin from watch task<commit_after>gulp = require 'gulp'
plugins = require('gulp-load-plugins')(pattern: [
  '*{-,.}*'
  'csswring'
])



gulp.task 'jade', ->
  gulp.src '_src/**/*.jade'
  .pipe plugins.changed '.', extension: '.html'
  .pipe plugins.jadeInheritance basedir: '_src/'
  .pipe plugins.filter (file) ->
    !/\/_/.test(file.path) or !/^_/.test(file.relative)
  .pipe plugins.jade
    pretty: true
    client: false
  .pipe gulp.dest '.'
  return

gulp.task 'css', ->
  processors = [
    plugins.autoprefixerCore browsers: ['last 2 versions','ie 8']
    plugins.cssMqpacker
    plugins.csswring
    plugins.postcssAssets {loadPaths: ['images/','fonts/']}
  ]
  gulp.src '_src/styles/common.styl'
  .pipe plugins.sourcemaps.init()
  .pipe plugins.stylus()
  .pipe plugins.postcss processors
  .pipe plugins.rename suffix: '.min'
  .pipe plugins.sourcemaps.write '.'
  .pipe gulp.dest 'styles'
  return

gulp.task 'uglify', ->
  gulp.src '_src/vendor/**/*.js'
  .pipe plugins.concat 'common.min.js'
  .pipe plugins.uglify()
  .pipe gulp.dest 'scripts'
  return

#gulp.task 'modernizr', ->
#  gulp.src 'scripts/*.js'
#  .pipe plugins.modernizr
#    options: ['setClasses','addTest','html5printshiv','testProp','fnBind']
#    tests: ['forms_placeholder','flexbox','backgroundsize','audio','video','svg','touch','csstransforms']
#  .pipe plugins.uglify()
#  .pipe gulp.dest 'scripts'
#  return

gulp.task 'sprite', ->
  spriteData = gulp.src('_src/sprite/*.png')
  .pipe plugins.spritesmith
    algorithm: 'binary-tree'
    padding: 4
    imgName: 'sprite.png'
    cssName: 'sprite.json'
  spriteData.img.pipe gulp.dest 'images'
  spriteData.css.pipe gulp.dest '_src/styles/sprite'
  return

gulp.task 'imagemin', ->
  gulp.src 'images/*'
  .pipe plugins.imagemin
    progressive: true
    svgoPlugins: [ { removeViewBox: false } ]
    use: [ plugins.imageminPngquant() ]
  .pipe gulp.dest 'images'
  return

gulp.task 'browser-sync', ->
  plugins.browserSync.init ['*.html','styles/common.min.css','**/*.{png,jpg,svg}','scripts/main.js','scripts/common.min.js'],
    open: false
    server: baseDir: '.'
  return



gulp.task 'default', ['browser-sync'], ->
  gulp.watch '_src/**/*.styl',      ['css']
  gulp.watch '_src/**/*.jade',      ['jade']
  gulp.watch '_src/vendor/**/*.js', ['uglify']
  gulp.watch '_src/sprite/*',       ['sprite']
  return
{'fraction_non_alphanumeric': 0.19123505976095617, 'fraction_numerical': 0.001677500524218914, 'mean_word_length': 3.4207599629286376, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 21, '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': '6367807', 'n_tokens_mistral': 1801, 'n_tokens_neox': 1772, 'n_words': 322}