creativelive/gulp-diff — pull request #2 by mietek (2014-08-30 19:33:29+00:00)
Title: Add 'fail' and 'quiet' options

Fairly self-explanatory.

This is my use case:
```js
gulp.task('prod.styles', function () {
return gulp.src('src/styles/main.sass')
.pipe($.rubySass())
.pipe($.minifyCss())
.pipe($.replace(/(background:.*?(left|center|right)) center/g, '$1'))
.pipe($.cssbeautify())
.pipe($.rename('main-before.css'))
.pipe(gulp.dest('dist/prod/_styles/_verify'))
.pipe($.uncss({ html: glob.sync('dist/prod/**/*.html') }))
.pipe($.minifyCss())
.pipe($.cssbeautify())
.pipe($.diff.diff())
.pipe($.rename('main-after.css'))
.pipe(gulp.dest('dist/prod/_styles/_verify'))
.pipe($.diff.reporter({ fail: true, quiet: true }))
.on('error', function () {
gutil.beep();
var git = spawn('git', [
'diff',
'--color',
'--no-index',
'--patience',
'dist/prod/_styles/_verify/main-before.css',
'dist/prod/_styles/_verify/main-after.css'
]);
git.stdout.pipe(process.stdout);
git.stderr.pipe(process.stderr);
})
.pipe(prefixCss())
.pipe($.minifyCss())
.pipe($.rename('main.css'))
.pipe(gulp.dest('dist/prod/_styles'));
});
```

Example output:
```diff
[20:30:40] Starting 'prod.styles'...
[20:30:47] gulp-ruby-sass: directory
[20:30:48] gulp-ruby-sass: write main.css
diff --git a/dist/prod/_styles/_verify/main-before.css b/dist/prod/_styles/_verify/main-after.css
index 536e795..8d19957 100755
--- a/dist/prod/_styles/_verify/main-before.css
+++ b/dist/prod/_styles/_verify/main-after.css
@@ -1,6 +1,6 @@
@charset "UTF-8";

-a,abbr,address,article,aside,body,dd,div,dl,dt,figure,footer,h1,h2,h3,header,html,li,nav,p,section,ul {
+a,address,article,aside,body,dd,div,dl,dt,figure,footer,h1,h2,h3,header,html,li,nav,p,section,ul {
margin: 0;
padding: 0;
border: 0;
```