Created
February 7, 2015 20:17
-
-
Save gabeio/701c6e70baf7a3ad134f to your computer and use it in GitHub Desktop.
yo-no-say
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var del, gulp, gulpMocha, gulpLivescript, livescript, paths; | |
| del = require('del'); | |
| gulp = require('gulp'); | |
| gulpMocha = require('gulp-mocha'); | |
| gulpLivescript = require('gulp-livescript'); | |
| livescript = gulpLivescript != null ? gulpLivescript : void 8; | |
| paths = [ | |
| { | |
| scripts: './src/*.ls', | |
| tests: './test/*.ls' | |
| }, gulp.task('default', ['build'], function(done){ | |
| return done; | |
| }) | |
| ]; | |
| gulp.task('clean-db', function(done){ | |
| return del('./db', function(err){ | |
| return fs.ensureDir('./db', function(err){ | |
| return done(err); | |
| }); | |
| }); | |
| }); | |
| gulp.task('clean', function(done){ | |
| del('*.js'); | |
| return done(); | |
| }); | |
| gulp.task('build', ['clean'], function(done){ | |
| return gulp.src('./src/*.ls').pipe(livescript({ | |
| bare: true | |
| })).on('error', function(it){ | |
| throw it; | |
| }).pipe(gulp.dest('./')).on('end', function(){ | |
| del('gulpfile.js'); | |
| return done; | |
| }); | |
| }); | |
| gulp.task('clean-tests', function(done){ | |
| del('./test/*.js'); | |
| return done(); | |
| }); | |
| gulp.task('build-tests', ['clean-tests'], function(done){ | |
| return gulp.src('./test/*.ls').pipe(livescript({ | |
| bare: true | |
| })).on('error', function(it){ | |
| throw it; | |
| }).pipe(gulp.dest('./test/')).on('end', function(){ | |
| return done; | |
| }); | |
| }); | |
| gulp.task('run-tests', ['build-tests', 'build'], function(done){ | |
| return gulp.src('./test/*.js').pipe(gulpMocha()).on('error', function(it){ | |
| throw it; | |
| }).on('end', function(){ | |
| return done; | |
| }); | |
| }); | |
| gulp.task('watch-build', function(){ | |
| var x$; | |
| x$ = gulp; | |
| x$.watch(paths.scripts, ['build']); | |
| return x$; | |
| }); | |
| gulp.task('watch-tests', function(){ | |
| var x$; | |
| x$ = gulp; | |
| x$.watch(paths.tests, ['test']); | |
| return x$; | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment