2/6/2017 - 5:05 PM

Gulpfile from

    See dev dependencies
    Compiles sass to compressed css with autoprefixing
    Compiles coffee to javascript
    Livereloads on changes to coffee, sass, and blade templates
    Runs PHPUnit tests
    Watches sass, coffee, blade, and phpunit
    Default tasks sass, coffee, phpunit, watch

var gulp = require('gulp');
var gutil = require('gulp-util');
var notify = require('gulp-notify');
var sass = require('gulp-ruby-sass');
var autoprefix = require('gulp-autoprefixer');
var coffee = require('gulp-coffee');
var phpunit = require('gulp-phpunit');//notify requires >= v 0.0.3
var fs = require('fs'); //only used for icon file with growlNotifier

// livereload
var livereload = require('gulp-livereload');
var lr = require('tiny-lr');
var server = lr();

//uncomment for growl notify for windows users
//Specify custom icon by passing object to growl() { icon: fs.readFileSync('path_to_icon_file') } 
//var growl = ('gulp-notify-growl');
//var growlNotifier = growl();

//CSS directories
var sassDir = 'app/assets/sass';
var targetCSSDir = 'public/css';

//javascript directories
var coffeeDir = 'app/assets/coffee';
var targetJSDir = 'public/js';

// blade directory
var bladeDir = 'app/views';

// Tasks
/* sass compile */
gulp.task('sass', function() {
    return gulp.src(sassDir + '/main.scss')
        .pipe(sass({ style: 'compressed'}).on('error', gutil.log))
        .pipe(autoprefix('last 10 versions'))
        .pipe(notify('CSS compiled, prefixed, and minified.'));
        //growlNotifier for windows
        //.pipe(notify({title: 'CSS Compiled', message: 'compiled, prefixed, and minified.', notifier: growlNotifier}));

/* coffee compile */
gulp.task('coffee', function() {
    return gulp.src(coffeeDir + '/**/*.coffee')
        .pipe(coffee().on('error', gutil.log))

/* Blade Templates */
gulp.task('blade', function() {
    return gulp.src(bladeDir + '/**/*.blade.php')

/* PHPUnit */
gulp.task('phpunit', function() {
    //notify defaults to false. If you don't want to use a notifier or worry with errors in this task leave it off
    var options = {debug: false, notify: true} 
        .pipe(phpunit('', options)) //empty phpunit path defaults ./vendor/bin/phpunit for windows specify with double back slashes
        //both notify and notify.onError will take optional notifier: growlNotifier for windows notifications
        //if options.notify is true be sure to handle the error here or suffer the consequenses!
        .on('error', notify.onError({
            title: 'PHPUnit Failed',
            message: 'One or more tests failed, see the cli for details.'
        //will fire only if no error is caught
            title: 'PHPUnit Passed',
            message: 'All tests passed!'

/* Watcher */
gulp.task('watch', function() {
    server.listen(35729, function(err) {
        if(err) {console.log(err);} + '/**/*.blade.php', ['blade']); + '/**/*.scss', ['sass']); + '/**/*.coffee', ['coffee']);
    });'app/**/*.php', ['phpunit']); 

/* Default Task */
gulp.task('default', ['sass', 'coffee', 'phpunit', 'watch']);
var gulp = require('gulp');
var minifycss = require('gulp-minify-css');
var autoprefixer = require('gulp-autoprefixer');
var notify = require('gulp-notify');
var sass = require('gulp-ruby-sass');

gulp.task('css', function() {
    return gulp.src('sass/main.sass')
        .pipe(sass({ style: 'compressed' }))
        .pipe(autoprefixer('last 15 version'))
        .pipe(notify({ message: 'All done, master!' }));

gulp.task('default', function() {'css');'sass/**/*.sass', function() {'css');
var gulp = require('gulp'),  
    sys = require('sys'),
    exec = require('child_process').exec;

gulp.task('phpunit', function() {
    exec('phpunit', function(error, stdout) {

gulp.task('default', function() {'**/*.php', { debounceDelay: 2000 }, ['phpunit']);