Last active
August 29, 2015 14:06
-
-
Save andrewhl/9a5dda1a0ba46cb31d49 to your computer and use it in GitHub Desktop.
This file contains 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 gulp = require('gulp'), | |
notify = require('gulp-notify'), | |
phpspec = require('gulp-phpspec'), | |
browserify = require('gulp-browserify'), | |
sass = require('gulp-sass'), | |
compass = require('gulp-compass'); | |
gulp.task('phpspec', function() { | |
var options = {notify: false}; | |
gulp.src('app/spec/**/*.php') | |
.pipe(phpspec('', options)) | |
.on('error', notify.onError({ | |
title: "Testing Failed", | |
message: "Error(s) occurred during test..." | |
})) | |
.pipe(notify({ | |
title: "Testing Passed", | |
message: "All tests have passed..." | |
})); | |
}); | |
gulp.task('scripts', function() { | |
// Single entry point to browserify | |
gulp.src('app/javascript/main.js') | |
.pipe(browserify({ | |
insertGlobals : true, | |
debug : !gulp.env.production | |
})) | |
.pipe(gulp.dest('./public/js')) | |
}); | |
gulp.task('sass', function () { | |
gulp.src('./app/assets/scss/*.scss') | |
.pipe(sass()) | |
.pipe(gulp.dest('./public/css')); | |
}); | |
gulp.task('watch', function() { | |
gulp.watch('app/spec/**/*.php', ['phpspec']) | |
gulp.watch('app/javascript/**/*.js', ['scripts']) | |
gulp.watch('app/assets/scss/**/*.scss', ['sass']) | |
}); | |
gulp.task('compass', function() { | |
gulp.src('./app/assets/scss/*.scss') | |
.pipe(compass({ | |
config_file: './config.rb', | |
css: './public/css', | |
sass: './app/assets/scss' | |
})) | |
.pipe(gulp.dest('app/assets/temp')); | |
}); | |
gulp.task('default', ['phpspec', 'scripts', 'sass', 'watch']); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment