<commit_before>var gulp = require('gulp');
var rebound = require('gulp-rebound');
var merge = require('gulp-merge');
var es = require('event-stream');
var babel = require('gulp-babel');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var jshint = require('gulp-jshint');
var rename = require('gulp-rename');
var rjs = require('gulp-requirejs');
var connect = require('gulp-connect');
var sourcemaps = require('gulp-sourcemaps');
var del = require('del');
var qunit = require('node-qunit-phantomjs');
var docco = require("gulp-docco");
var git = require('gulp-git');
var pjson = require('./package.json');
var mkdirp = require('mkdirp');
var replace = require('gulp-replace');


var paths = {
    all: ['packages/**/*.js', 'wrap/*.js', 'shims/*.js', 'test/**/*.html'],
    propertyCompiler:   'packages/property-compiler/lib/**/*.js',
    reboundCompiler:    'packages/rebound-compiler/lib/**/*.js',
    reboundComponent:   'packages/rebound-component/lib/**/*.js',
    reboundData:        'packages/rebound-data/lib/**/*.js',
    reboundPrecompiler: 'packages/rebound-compiler/lib/**/*.js',
    reboundRouter:      'packages/rebound-router/lib/**/*.js',
    reboundRuntime:     'packages/runtime.js'
  };


gulp.task('clean', function(cb) {
  // You can use multiple globbing patterns as you would with `gulp.src`
  return del(['dist', 'test/demo/templates'], cb);
});

// JS hint task
gulp.task('jshint', function() {
  gulp.src('./packages/**/*.js')
  .pipe(jshint({
    curly: false,
    loopfunc: true,
    eqnull: true,
    browser: true,
    esnext: true,
    '-W058': true, // Allow prens-less constructors (new Object;)
    '-W093': true, // Allow returning assignment (return a = b;)
    '-W030': true, // Allow unused expressions. Good for conditional assignment.
    globals: {
      jQuery: true
    }
  }))
  .pipe(jshint.reporter('default'));
});

gulp.task('cjs', ['clean'], function() {
  return es.merge(
    gulp.src(paths.propertyCompiler).pipe(rename({prefix: "property-compiler/"})),
    gulp.src(paths.reboundCompiler).pipe(rename({prefix: "rebound-compiler/"})),
    gulp.src(paths.reboundComponent).pipe(rename({prefix: "rebound-component/"})),
    gulp.src(paths.reboundData).pipe(rename({prefix: "rebound-data/"})),
    gulp.src(paths.reboundCompiler).pipe(rename({prefix: "rebound-compiler/"})),
    gulp.src(paths.reboundRouter).pipe(rename({prefix: "rebound-router/"})),
    gulp.src(paths.reboundRuntime)
  )
  .pipe(babel({blacklist: ['es6.forOf','regenerator','es6.spread','es6.destructuring']}))
  .pipe(gulp.dest('dist/cjs'))
  .pipe(connect.reload());
});

gulp.task('docco', ['clean'], function() {
  return gulp.src([
    'packages/runtime.js',
    'packages/rebound-data/lib/rebound-data.js',
    'packages/rebound-data/lib/model.js',
    'packages/rebound-data/lib/collection.js',
    'packages/rebound-data/lib/computed-property.js',
    'packages/rebound-component/lib/component.js',
    'packages/rebound-component/lib/helpers.js',
    'packages/rebound-component/lib/hooks.js',
    'packages/rebound-component/lib/lazy-value.js',
    'packages/rebound-router/lib/rebound-router.js',
    'packages/rebound-component/lib/utils.js',
    'packages/property-compiler/lib/property-compiler.js',
    'packages/rebound-compiler/lib/rebound-compiler.js',
  ])
  .pipe(concat('rebound.js'))
  .pipe(docco())
  .pipe(gulp.dest('dist/docs'));
});

gulp.task('amd', ['clean'], function() {
  return es.merge(
    gulp.src(paths.propertyCompiler).pipe(rename({prefix: "property-compiler/"})),
    gulp.src(paths.reboundCompiler).pipe(rename({prefix: "rebound-compiler/"})),
    gulp.src(paths.reboundComponent).pipe(rename({prefix: "rebound-component/"})),
    gulp.src(paths.reboundData).pipe(rename({prefix: "rebound-data/"})),
    gulp.src(paths.reboundCompiler).pipe(rename({prefix: "rebound-compiler/"})),
    gulp.src(paths.reboundRouter).pipe(rename({prefix: "rebound-router/"})),
    gulp.src(paths.reboundRuntime)
  )
  .pipe(babel({
    modules: "amd",
    moduleIds: true,
    blacklist: ['es6.forOf','regenerator','es6.spread','es6.destructuring']
  }))
  .pipe(gulp.dest('dist/amd'))
  .pipe(concat('rebound.runtime.js'))
  .pipe(gulp.dest('dist'))
});

gulp.task('runtime', ['amd'], function() {
  return gulp.src([
    'shims/classList.js',
    'shims/matchesSelector.js',
    // 'bower_components/webcomponentsjs/webcomponents-lite.min.js',
    'node_modules/document-register-element/build/document-register-element.max.js',
    'bower_components/backbone/backbone.js',
    'bower_components/requirejs/require.js',
    'wrap/start.frag',
    'bower_components/almond/almond.js',
    'node_modules/htmlbars/dist/amd/htmlbars-util.amd.js',
    'node_modules/htmlbars/dist/amd/htmlbars-runtime.amd.js',
    'dist/rebound.runtime.js',
    'wrap/end.runtime.frag'
    ])
  .pipe(concat('rebound.runtime.js'))
  .pipe(gulp.dest('dist'))
  .pipe(uglify())
  .pipe(rename({basename: "rebound.runtime.min"}))
  .pipe(gulp.dest('dist'));
});

gulp.task('test-helpers', ['runtime'], function(){
  return gulp.src([
      "bower_components/underscore/underscore.js",
      "bower_components/jquery/dist/jquery.min.js",
      "bower_components/route-recognizer/dist/route-recognizer.js",
      "bower_components/FakeXMLHttpRequest/fake_xml_http_request.js",
      "bower_components/pretender/pretender.js",
      "dist/rebound.runtime.js",
      "packages/rebound-test/lib/test-helpers.js",
    ])
  .pipe(concat('rebound.test.js'))
  .pipe(gulp.dest('dist'));
});

gulp.task('compile-tests', function(){
  return gulp.src([
      "packages/*/test/*.js",
      "packages/tests.js"
    ])
  .pipe(babel({
    modules: "amd",
    moduleIds: true,
    blacklist: ['es6.forOf','regenerator','es6.spread','es6.destructuring']
  }))
  .pipe(concat('rebound.tests.js'))
  .pipe(gulp.dest('test'));
});


gulp.task('compile-demo', ['cjs', 'test-helpers', 'docco', 'runtime', 'compile-tests'],  function(){

  var demo = gulp.src(["test/demo/**/*.html", "!test/index.html", "!test/demo/index.html"])
  .pipe(rebound())
  .pipe(gulp.dest('test/demo/templates'));

  return demo;
});
gulp.task('compile-apps', ['cjs', 'test-helpers', 'docco', 'runtime', 'compile-tests'],  function(){

  var apps = gulp.src(["test/dummy-apps/**/*.html"])
  .pipe(rebound())
  .pipe(gulp.dest('test/dummy-apps'));

  return apps;
});

// Start the test server
gulp.task('connect', ['compile-demo', 'compile-apps'], function() {
  return connect.server({
    livereload: true,
    port: 8000
  });
});

// Rerun the tasks when a file changes
gulp.task('watch', ['connect'], function() {
  gulp.watch(paths.all, ['compile-demo', 'compile-apps']);
});

// The default task (called when you run `gulp` from cli)
gulp.task('default', [ 'watch' ]);

gulp.task('build', [ 'recompile-demo' ]);

gulp.task('test', function() {
  qunit('test/index.html', {
    verbose: true,
    timeout: 15
  }, function(code) {
    process.exit(code);
  })
});

<commit_msg>Fixed gulp build task<commit_after>var gulp = require('gulp');
var rebound = require('gulp-rebound');
var merge = require('gulp-merge');
var es = require('event-stream');
var babel = require('gulp-babel');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var jshint = require('gulp-jshint');
var rename = require('gulp-rename');
var rjs = require('gulp-requirejs');
var connect = require('gulp-connect');
var sourcemaps = require('gulp-sourcemaps');
var del = require('del');
var qunit = require('node-qunit-phantomjs');
var docco = require("gulp-docco");
var git = require('gulp-git');
var pjson = require('./package.json');
var mkdirp = require('mkdirp');
var replace = require('gulp-replace');


var paths = {
    all: ['packages/**/*.js', 'wrap/*.js', 'shims/*.js', 'test/**/*.html'],
    propertyCompiler:   'packages/property-compiler/lib/**/*.js',
    reboundCompiler:    'packages/rebound-compiler/lib/**/*.js',
    reboundComponent:   'packages/rebound-component/lib/**/*.js',
    reboundData:        'packages/rebound-data/lib/**/*.js',
    reboundPrecompiler: 'packages/rebound-compiler/lib/**/*.js',
    reboundRouter:      'packages/rebound-router/lib/**/*.js',
    reboundRuntime:     'packages/runtime.js'
  };


gulp.task('clean', function(cb) {
  // You can use multiple globbing patterns as you would with `gulp.src`
  return del(['dist', 'test/demo/templates'], cb);
});

// JS hint task
gulp.task('jshint', function() {
  gulp.src('./packages/**/*.js')
  .pipe(jshint({
    curly: false,
    loopfunc: true,
    eqnull: true,
    browser: true,
    esnext: true,
    '-W058': true, // Allow prens-less constructors (new Object;)
    '-W093': true, // Allow returning assignment (return a = b;)
    '-W030': true, // Allow unused expressions. Good for conditional assignment.
    globals: {
      jQuery: true
    }
  }))
  .pipe(jshint.reporter('default'));
});

gulp.task('cjs', ['clean'], function() {
  return es.merge(
    gulp.src(paths.propertyCompiler).pipe(rename({prefix: "property-compiler/"})),
    gulp.src(paths.reboundCompiler).pipe(rename({prefix: "rebound-compiler/"})),
    gulp.src(paths.reboundComponent).pipe(rename({prefix: "rebound-component/"})),
    gulp.src(paths.reboundData).pipe(rename({prefix: "rebound-data/"})),
    gulp.src(paths.reboundCompiler).pipe(rename({prefix: "rebound-compiler/"})),
    gulp.src(paths.reboundRouter).pipe(rename({prefix: "rebound-router/"})),
    gulp.src(paths.reboundRuntime)
  )
  .pipe(babel({blacklist: ['es6.forOf','regenerator','es6.spread','es6.destructuring']}))
  .pipe(gulp.dest('dist/cjs'))
  .pipe(connect.reload());
});

gulp.task('docco', ['clean'], function() {
  return gulp.src([
    'packages/runtime.js',
    'packages/rebound-data/lib/rebound-data.js',
    'packages/rebound-data/lib/model.js',
    'packages/rebound-data/lib/collection.js',
    'packages/rebound-data/lib/computed-property.js',
    'packages/rebound-component/lib/component.js',
    'packages/rebound-component/lib/helpers.js',
    'packages/rebound-component/lib/hooks.js',
    'packages/rebound-component/lib/lazy-value.js',
    'packages/rebound-router/lib/rebound-router.js',
    'packages/rebound-component/lib/utils.js',
    'packages/property-compiler/lib/property-compiler.js',
    'packages/rebound-compiler/lib/rebound-compiler.js',
  ])
  .pipe(concat('rebound.js'))
  .pipe(docco())
  .pipe(gulp.dest('dist/docs'));
});

gulp.task('amd', ['clean'], function() {
  return es.merge(
    gulp.src(paths.propertyCompiler).pipe(rename({prefix: "property-compiler/"})),
    gulp.src(paths.reboundCompiler).pipe(rename({prefix: "rebound-compiler/"})),
    gulp.src(paths.reboundComponent).pipe(rename({prefix: "rebound-component/"})),
    gulp.src(paths.reboundData).pipe(rename({prefix: "rebound-data/"})),
    gulp.src(paths.reboundCompiler).pipe(rename({prefix: "rebound-compiler/"})),
    gulp.src(paths.reboundRouter).pipe(rename({prefix: "rebound-router/"})),
    gulp.src(paths.reboundRuntime)
  )
  .pipe(babel({
    modules: "amd",
    moduleIds: true,
    blacklist: ['es6.forOf','regenerator','es6.spread','es6.destructuring']
  }))
  .pipe(gulp.dest('dist/amd'))
  .pipe(concat('rebound.runtime.js'))
  .pipe(gulp.dest('dist'))
});

gulp.task('runtime', ['amd'], function() {
  return gulp.src([
    'shims/classList.js',
    'shims/matchesSelector.js',
    // 'bower_components/webcomponentsjs/webcomponents-lite.min.js',
    'node_modules/document-register-element/build/document-register-element.max.js',
    'bower_components/backbone/backbone.js',
    'bower_components/requirejs/require.js',
    'wrap/start.frag',
    'bower_components/almond/almond.js',
    'node_modules/htmlbars/dist/amd/htmlbars-util.amd.js',
    'node_modules/htmlbars/dist/amd/htmlbars-runtime.amd.js',
    'dist/rebound.runtime.js',
    'wrap/end.runtime.frag'
    ])
  .pipe(concat('rebound.runtime.js'))
  .pipe(gulp.dest('dist'))
  .pipe(uglify())
  .pipe(rename({basename: "rebound.runtime.min"}))
  .pipe(gulp.dest('dist'));
});

gulp.task('test-helpers', ['runtime'], function(){
  return gulp.src([
      "bower_components/underscore/underscore.js",
      "bower_components/jquery/dist/jquery.min.js",
      "bower_components/route-recognizer/dist/route-recognizer.js",
      "bower_components/FakeXMLHttpRequest/fake_xml_http_request.js",
      "bower_components/pretender/pretender.js",
      "dist/rebound.runtime.js",
      "packages/rebound-test/lib/test-helpers.js",
    ])
  .pipe(concat('rebound.test.js'))
  .pipe(gulp.dest('dist'));
});

gulp.task('compile-tests', function(){
  return gulp.src([
      "packages/*/test/*.js",
      "packages/tests.js"
    ])
  .pipe(babel({
    modules: "amd",
    moduleIds: true,
    blacklist: ['es6.forOf','regenerator','es6.spread','es6.destructuring']
  }))
  .pipe(concat('rebound.tests.js'))
  .pipe(gulp.dest('test'));
});


gulp.task('compile-demo', ['cjs', 'test-helpers', 'docco', 'runtime', 'compile-tests'],  function(){

  var demo = gulp.src(["test/demo/**/*.html", "!test/index.html", "!test/demo/index.html"])
  .pipe(rebound())
  .pipe(gulp.dest('test/demo/templates'));

  return demo;
});
gulp.task('compile-apps', ['cjs', 'test-helpers', 'docco', 'runtime', 'compile-tests'],  function(){

  var apps = gulp.src(["test/dummy-apps/**/*.html"])
  .pipe(rebound())
  .pipe(gulp.dest('test/dummy-apps'));

  return apps;
});

// Start the test server
gulp.task('connect', ['compile-demo', 'compile-apps'], function() {
  return connect.server({
    livereload: true,
    port: 8000
  });
});

// Rerun the tasks when a file changes
gulp.task('watch', ['connect'], function() {
  gulp.watch(paths.all, ['compile-demo', 'compile-apps']);
});

// The default task (called when you run `gulp` from cli)
gulp.task('default', [ 'watch' ]);

gulp.task('build', [ 'compile-demo', 'compile-apps' ]);

gulp.task('test', function() {
  qunit('test/index.html', {
    verbose: true,
    timeout: 15
  }, function(code) {
    process.exit(code);
  })
});


{'fraction_non_alphanumeric': 0.2080949656750572, 'fraction_numerical': 0.003432494279176201, 'mean_word_length': 4.160516605166052, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '6287410', 'n_tokens_mistral': 4985, 'n_tokens_neox': 4935, 'n_words': 690}