<commit_before>gulp = require 'gulp'
$ = require('gulp-load-plugins') lazy: false
extend = require('util')._extend
streamqueue = require 'streamqueue'
spawn = require('child_process').spawn
karma = require('karma').server
karmaConfig = require './karma.json'
pkg = require './package.json'
name = pkg.name

paths =
  src: './src'
  dist: './build'
  test: './test'
  docs: './docs'
server =
  host: 'localhost'
  port: 3000
banner = '''
  /* ========================================================================
   * <%= pkg.name %> - v<%= pkg.version %>
   * <%= pkg.homepage %>
   * ========================================================================
   * Copyright 2012-2013 <%= pkg.author.name %>
   *
   * ========================================================================
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   * ========================================================================
   */


  '''

# coffee
gulp.task 'coffee', ->
  gulp
  .src "#{paths.src}/coffee/#{name}.coffee"
  .pipe $.changed "#{paths.dist}/js"
  .pipe $.coffeelint './coffeelint.json'
  .pipe $.coffeelint.reporter()
    .on 'error', $.util.log
  .pipe $.coffee bare: true
    .on 'error', $.util.log
  .pipe $.header banner, pkg: pkg
  .pipe gulp.dest "#{paths.dist}/js"
  .pipe gulp.dest "#{paths.src}/docs/assets/js"
  .pipe gulp.dest paths.test
  .pipe $.uglify()
  .pipe $.header banner, pkg: pkg
  .pipe $.rename suffix: '.min'
  .pipe gulp.dest "#{paths.dist}/js"

gulp.task 'coffee-standalone', ->
  streamqueue objectMode: true,
    gulp
    .src [
      "./bower_components/bootstrap/js/tooltip.js"
      "./bower_components/bootstrap/js/popover.js"
    ]
  ,
    gulp
    .src "#{paths.src}/coffee/#{name}.coffee"
    .pipe $.changed "#{paths.dist}/js"
    .pipe $.coffeelint './coffeelint.json'
    .pipe $.coffeelint.reporter()
      .on 'error', $.util.log
    .pipe $.coffee bare: true
      .on 'error', $.util.log
  .pipe $.concat "#{name}-standalone.js"
  .pipe $.header banner, pkg: pkg
  .pipe gulp.dest "#{paths.dist}/js"
  .pipe $.uglify()
  .pipe $.header banner, pkg: pkg
  .pipe $.rename suffix: '.min'
  .pipe gulp.dest "#{paths.dist}/js"

# less
gulp.task 'less', ->
  gulp
  .src [
    "#{paths.src}/less/#{name}.less"
  ]
  .pipe $.changed "#{paths.dist}/css"
  .pipe $.less()
    .on 'error', $.util.log
  .pipe $.header banner, pkg: pkg
  .pipe gulp.dest "#{paths.dist}/css"
  .pipe gulp.dest "#{paths.src}/docs/assets/css"
  .pipe $.less compress: true, cleancss: true
  .pipe $.header banner, pkg: pkg
  .pipe $.rename suffix: '.min'
  .pipe gulp.dest "#{paths.dist}/css"

gulp.task 'less-standalone', ->
  gulp
  .src "#{paths.src}/less/#{name}-standalone.less"
  .pipe $.changed "#{paths.dist}/css"
  .pipe $.less()
    .on 'error', $.util.log
  .pipe $.header banner, pkg: pkg
  .pipe gulp.dest "#{paths.dist}/css"
  .pipe $.less compress: true, cleancss: true
  .pipe $.header banner, pkg: pkg
  .pipe $.rename suffix: '.min'
  .pipe gulp.dest "#{paths.dist}/css"

# test
gulp.task 'test-coffee', ['coffee'], ->
  gulp
  .src "#{paths.src}/coffee/#{name}.spec.coffee"
  .pipe $.changed paths.test
  .pipe $.coffeelint './coffeelint.json'
  .pipe $.coffeelint.reporter()
    .on 'error', $.util.log
  .pipe $.coffee()
    .on 'error', $.util.log
  .pipe gulp.dest paths.test

gulp.task 'test-go', ['test-coffee'], (done) ->
  karma.start extend(karmaConfig, singleRun: true), done

# docs
gulp.task 'docs-build', ['coffee', 'less'], (done) ->
  spawn `(process.platform === "win32" ? "jekyll.bat" : "jekyll")`, ['build']
    .on 'close', done

gulp.task 'docs-copy', ['docs-build'], ->
  gulp
  .src "./bower_components/**/*"
  .pipe gulp.dest "#{paths.docs}/components"

gulp.task 'docs-coffee', ['docs-build'], ->
  gulp
  .src "#{paths.src}/coffee/#{name}.docs.coffee"
  .pipe $.changed "#{paths.docs}/assets/js"
  .pipe $.coffeelint.reporter()
    .on 'error', $.util.log
  .pipe $.coffee()
    .on 'error', $.util.log<commit_msg>Changed double to single quotes<commit_after>gulp = require 'gulp'
$ = require('gulp-load-plugins') lazy: false
extend = require('util')._extend
streamqueue = require 'streamqueue'
spawn = require('child_process').spawn
karma = require('karma').server
karmaConfig = require './karma.json'
pkg = require './package.json'
name = pkg.name

paths =
  src: './src'
  dist: './build'
  test: './test'
  docs: './docs'
server =
  host: 'localhost'
  port: 3000
banner = '''
  /* ========================================================================
   * <%= pkg.name %> - v<%= pkg.version %>
   * <%= pkg.homepage %>
   * ========================================================================
   * Copyright 2012-2013 <%= pkg.author.name %>
   *
   * ========================================================================
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   * ========================================================================
   */


  '''

# coffee
gulp.task 'coffee', ->
  gulp
  .src "#{paths.src}/coffee/#{name}.coffee"
  .pipe $.changed "#{paths.dist}/js"
  .pipe $.coffeelint './coffeelint.json'
  .pipe $.coffeelint.reporter()
    .on 'error', $.util.log
  .pipe $.coffee bare: true
    .on 'error', $.util.log
  .pipe $.header banner, pkg: pkg
  .pipe gulp.dest "#{paths.dist}/js"
  .pipe gulp.dest "#{paths.src}/docs/assets/js"
  .pipe gulp.dest paths.test
  .pipe $.uglify()
  .pipe $.header banner, pkg: pkg
  .pipe $.rename suffix: '.min'
  .pipe gulp.dest "#{paths.dist}/js"

gulp.task 'coffee-standalone', ->
  streamqueue objectMode: true,
    gulp
    .src [
      "./bower_components/bootstrap/js/tooltip.js"
      "./bower_components/bootstrap/js/popover.js"
    ]
  ,
    gulp
    .src "#{paths.src}/coffee/#{name}.coffee"
    .pipe $.changed "#{paths.dist}/js"
    .pipe $.coffeelint './coffeelint.json'
    .pipe $.coffeelint.reporter()
      .on 'error', $.util.log
    .pipe $.coffee bare: true
      .on 'error', $.util.log
  .pipe $.concat "#{name}-standalone.js"
  .pipe $.header banner, pkg: pkg
  .pipe gulp.dest "#{paths.dist}/js"
  .pipe $.uglify()
  .pipe $.header banner, pkg: pkg
  .pipe $.rename suffix: '.min'
  .pipe gulp.dest "#{paths.dist}/js"

# less
gulp.task 'less', ->
  gulp
  .src [
    "#{paths.src}/less/#{name}.less"
  ]
  .pipe $.changed "#{paths.dist}/css"
  .pipe $.less()
    .on 'error', $.util.log
  .pipe $.header banner, pkg: pkg
  .pipe gulp.dest "#{paths.dist}/css"
  .pipe gulp.dest "#{paths.src}/docs/assets/css"
  .pipe $.less compress: true, cleancss: true
  .pipe $.header banner, pkg: pkg
  .pipe $.rename suffix: '.min'
  .pipe gulp.dest "#{paths.dist}/css"

gulp.task 'less-standalone', ->
  gulp
  .src "#{paths.src}/less/#{name}-standalone.less"
  .pipe $.changed "#{paths.dist}/css"
  .pipe $.less()
    .on 'error', $.util.log
  .pipe $.header banner, pkg: pkg
  .pipe gulp.dest "#{paths.dist}/css"
  .pipe $.less compress: true, cleancss: true
  .pipe $.header banner, pkg: pkg
  .pipe $.rename suffix: '.min'
  .pipe gulp.dest "#{paths.dist}/css"

# test
gulp.task 'test-coffee', ['coffee'], ->
  gulp
  .src "#{paths.src}/coffee/#{name}.spec.coffee"
  .pipe $.changed paths.test
  .pipe $.coffeelint './coffeelint.json'
  .pipe $.coffeelint.reporter()
    .on 'error', $.util.log
  .pipe $.coffee()
    .on 'error', $.util.log
  .pipe gulp.dest paths.test

gulp.task 'test-go', ['test-coffee'], (done) ->
  karma.start extend(karmaConfig, singleRun: true), done

# docs
gulp.task 'docs-build', ['coffee', 'less'], (done) ->
  spawn `(process.platform === 'win32' ? 'jekyll.bat' : 'jekyll')`, ['build']
    .on 'close', done

gulp.task 'docs-copy', ['docs-build'], ->
  gulp
  .src "./bower_components/**/*"
  .pipe gulp.dest "#{paths.docs}/components"

gulp.task 'docs-coffee', ['docs-build'], ->
  gulp
  .src "#{paths.src}/coffee/#{name}.docs.coffee"
  .pipe $.changed "#{paths.docs}/assets/js"
  .pipe $.coffeelint.reporter()
    .on 'error', $.util.log
  .pipe $.coffee()
    .on 'error', $.util.log
{'fraction_non_alphanumeric': 0.24374584901483284, 'fraction_numerical': 0.003984945760460483, 'mean_word_length': 3.169358560221504, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '2705779', 'n_tokens_mistral': 3283, 'n_tokens_neox': 3086, 'n_words': 783}