This commit is contained in:
oitsjustjose 2017-02-26 17:06:42 -05:00
commit 6b60015c02
9588 changed files with 1149251 additions and 49 deletions

BIN
node_modules/gulp-notify/examples/gulp.png generated vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

150
node_modules/gulp-notify/examples/gulpfile.js generated vendored Normal file
View file

@ -0,0 +1,150 @@
var gulp = require('gulp');
var notify = require('../');
var through = require('through2');
var path = require('path');
var plumber = require('gulp-plumber');
var nn = require('node-notifier');
gulp.task("multiple", function () {
gulp.src("../test/fixtures/*")
.pipe(notify());
});
gulp.task("one", function () {
return gulp.src("../test/fixtures/1.txt")
.pipe(notify());
});
notify.on('click', function (options) {
console.log('I clicked something!', options);
});
gulp.task("click", function () {
// Click event only makes sense if wait is true...
return gulp.src("../test/fixtures/1.txt")
.pipe(notify({ message: 'Hello 1', wait: true }));
});
gulp.task("message", function () {
return gulp.src("../test/fixtures/1.txt")
.pipe(notify("This is a message."));
});
gulp.task("customReporter", function () {
var custom = notify.withReporter(function (options, callback) {
console.log("Title:", options.title);
console.log("Message:", options.message);
callback();
});
return gulp.src("../test/fixtures/1.txt")
.pipe(custom("This is a message."));
});
gulp.task("template", function () {
return gulp.src("../test/fixtures/1.txt")
.pipe(notify("Template: <%= file.relative %>"));
});
gulp.task("templateadv", function () {
return gulp.src("../test/fixtures/1.txt")
.pipe(notify({
message: "Template: <%= file.relative %>",
title: function (file) {
if(file.isNull()) {
return "Folder:";
}
return "File: <%= file.relative %> <%= options.extra %>";
},
templateOptions: {
extra: "foo"
}
}));
});
gulp.task("function", function () {
return gulp.src("../test/fixtures/1.txt")
.pipe(notify(function(file) {
return "Some file: " + file.relative;
}));
});
gulp.task("advanced", function () {
return gulp.src("../test/fixtures/*")
.pipe(notify({
"title": "Open Github",
"subtitle": "Project web site",
"message": "Click to open project site",
"sound": "Frog", // case sensitive
"icon": path.join(__dirname, "gulp.png"), // case sensitive
"onLast": true,
"wait": true
}));
});
gulp.task("onlast", function () {
return gulp.src("../test/fixtures/*")
.pipe(notify({
onLast: true,
message: function(file) {
return "Some file: " + file.relative;
}
}));
});
gulp.task("error", function () {
return gulp.src("../test/fixtures/*")
.pipe(through.obj(function (file, enc, callback) {
this.emit("error", new Error("Something happend: Error message!"));
callback();
}))
.on("error", notify.onError({
message: 'Error: <%= error.message %>',
sound: false // deactivate sound?
}))
.on("error", function (err) {
console.log("Error:", err);
})
});
gulp.task("forceGrowl", function () {
var custom = notify.withReporter(function (options, callback) {
new nn.Growl().notify(options, callback);
});
return gulp.src("../test/fixtures/*")
.pipe(through.obj(function (file, enc, callback) {
this.emit("error", new Error("Something happend: Error message!"));
callback();
}))
.on("error", custom.onError('Error: <%= error.message %>'));
});
gulp.task("customError", function () {
var custom = notify.withReporter(function (options, callback) {
console.log("Title:", options.title);
console.log("Message:", options.message);
callback();
});
custom.logLevel(1);
return gulp.src("../test/fixtures/*")
.pipe(custom('<%= file.relative %>'))
.pipe(through.obj(function (file, enc, callback) {
this.emit("error", new Error("Something happend: Error message!"));
callback();
}))
.on("error", custom.onError({
message: 'Error: <%= error.message %>',
emitError: true
}))
.on("error", function (err) {
console.log("Error:", err);
})
});

28
node_modules/gulp-notify/examples/jshint.js generated vendored Normal file
View file

@ -0,0 +1,28 @@
var jshint = require('gulp-jshint');
var notify = require('gulp-notify');
var gulp = require('gulp');
gulp.task('lint', function() {
gulp.src('/src/**/*.js')
.pipe(jshint())
// Use gulp-notify as jshint reporter
.pipe(notify(function (file) {
if (file.jshint.success) {
// Don't show something if success
return false;
}
var errors = file.jshint.results.map(function (data) {
if (data.error) {
return "(" + data.error.line + ':' + data.error.character + ') ' + data.error.reason;
}
}).join("\n");
return file.relative + " (" + file.jshint.results.length + " errors)\n" + errors;
}));
});
gulp.task('watch', ['lint'], function() {
gulp.watch('/src/**/*.js', ['lint']);
});
gulp.task('default', ['lint']);