<commit_before>gulp    = require 'gulp'
coffee  = require 'gulp-coffee'
mocha   = require 'gulp-mocha'
replace = require 'gulp-replace'
rename  = require 'gulp-rename'
gutil   = require 'gulp-util'
rjs     = require 'gulp-requirejs'
fs      = require 'fs'
path    = require 'path'

gulp.task 'build', () ->
	gulp.src 'src/**/*.coffee'
	.pipe coffee()
	.pipe gulp.dest('lib')

gulp.task 'test', ['build'], () ->
	# Bootstrap test environment (mainly require.js)
	require('./test/main.coffee')
	# Load rest of the test files.
	gulp.src 'test/*.coffee'
	.pipe mocha	reporter: 'spec'

gulp.task 'default', ['build']

gulp.task 'change version', () ->
	throw new Error("Version parameter is required") unless gutil.env.version?
	version = gutil.env.version

	# Replace version in package.json
	pkg = fs.readFileSync path.join __dirname, "package.json"
	pkg = JSON.parse pkg
	pkg.version = version
	pkg = JSON.stringify pkg, null, 2
	fs.writeFileSync path.join(__dirname, "package.json"), pkg

	# Replace version in r.js wrap files
	gulp.src 'build/*.template'
	.pipe replace "{CAPACITOR_VERSION}", version
	.pipe rename extname: ".js"
	.pipe gulp.dest "build/"

gulp.task 'dist', ['build', 'test', 'change version'], () ->
	opts =
		baseUrl: "lib"
		paths:
			capacitor: "main"
			signals: "../node_modules/signals/dist/signals"
		include: ["../vendor/almond", 'main']
		nodeRequire: require
		out: "capacitor.js"
		wrap:
			startFile: "build/wrap-start.js"
			endFile: "build/wrap-end.js"

	rjs opts
	.pipe gulp.dest 'dist/'

<commit_msg>Replace tabs with spaces when compiling to fix JSDoc output from the coffee compiler<commit_after>gulp    = require 'gulp'
coffee  = require 'gulp-coffee'
mocha   = require 'gulp-mocha'
replace = require 'gulp-replace'
rename  = require 'gulp-rename'
gutil   = require 'gulp-util'
rjs     = require 'gulp-requirejs'
fs      = require 'fs'
path    = require 'path'

gulp.task 'build', () ->
	gulp.src 'src/**/*.coffee'
	.pipe replace "\t", "  " # fix JSDoc output from coffee
	.pipe coffee()
	.pipe gulp.dest('lib')

gulp.task 'test', ['build'], () ->
	# Bootstrap test environment (mainly require.js)
	require('./test/main.coffee')
	# Load rest of the test files.
	gulp.src 'test/*.coffee'
	.pipe mocha	reporter: 'spec'

gulp.task 'default', ['build']

gulp.task 'change version', () ->
	throw new Error("Version parameter is required") unless gutil.env.version?
	version = gutil.env.version

	# Replace version in package.json
	pkg = fs.readFileSync path.join __dirname, "package.json"
	pkg = JSON.parse pkg
	pkg.version = version
	pkg = JSON.stringify pkg, null, 2
	fs.writeFileSync path.join(__dirname, "package.json"), pkg

	# Replace version in r.js wrap files
	gulp.src 'build/*.template'
	.pipe replace "{CAPACITOR_VERSION}", version
	.pipe rename extname: ".js"
	.pipe gulp.dest "build/"

gulp.task 'dist', ['build', 'test', 'change version'], () ->
	opts =
		baseUrl: "lib"
		paths:
			capacitor: "main"
			signals: "../node_modules/signals/dist/signals"
		include: ["../vendor/almond", 'main']
		nodeRequire: require
		out: "capacitor.js"
		wrap:
			startFile: "build/wrap-start.js"
			endFile: "build/wrap-end.js"

	rjs opts
	.pipe gulp.dest 'dist/'


{'fraction_non_alphanumeric': 0.15644555694618273, 'fraction_numerical': 0.0006257822277847309, 'mean_word_length': 3.6945668135095446, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '1625605', 'n_tokens_mistral': 1207, 'n_tokens_neox': 1143, 'n_words': 311}