gulp-notify
Advanced tools
Comparing version 2.1.0 to 2.2.0
Changelog | ||
=== | ||
#### `v2.2.0` | ||
1. Adds support for changing host, port and appName for Growl. | ||
2. Adds support for templating on subtitle and open (for Notification Center). | ||
3. Adds support for returning options in function argument style. | ||
#### `v2.1.0` | ||
@@ -5,0 +10,0 @@ 1. Adds `click` and `timeout` events to `notify` object. |
@@ -18,2 +18,9 @@ "use strict"; | ||
} else { | ||
if (options.host || options.appName || options.port) { | ||
notifier = new notifier.Notification({ | ||
host: options.host, | ||
appName: options.appName, | ||
port: options.port | ||
}); | ||
} | ||
reporter = notifier.notify.bind(notifier); | ||
@@ -20,0 +27,0 @@ } |
@@ -41,6 +41,8 @@ var template = require("lodash.template"); | ||
function generate (outputData, object, title, message, templateOptions) { | ||
function generate (outputData, object, title, message, subtitle, open, templateOptions) { | ||
if (object instanceof Error) { | ||
var titleTemplate = template(title); | ||
var messageTemplate = template(message); | ||
var openTemplate = template(open); | ||
var subtitleTemplate = template(subtitle); | ||
@@ -55,2 +57,10 @@ return extend(defaults.error, outputData, { | ||
options: templateOptions | ||
}), | ||
open: openTemplate({ | ||
error: object, | ||
options: templateOptions | ||
}), | ||
subtitle: subtitleTemplate({ | ||
error: object, | ||
options: templateOptions | ||
}) | ||
@@ -75,2 +85,4 @@ }); | ||
title = !(object instanceof Error) ? "Gulp notification" : "Error running Gulp", | ||
open = "", | ||
subtitle = "", | ||
outputData = {}; | ||
@@ -80,2 +92,5 @@ | ||
message = options(object); | ||
if (typeof message === "object") { | ||
options = message; | ||
} | ||
if (!message) { | ||
@@ -97,3 +112,15 @@ return false; | ||
} | ||
if (typeof outputData.subtitle === "function") { | ||
subtitle = outputData.subtitle(object); | ||
} else { | ||
subtitle = outputData.subtitle || subtitle; | ||
} | ||
if (typeof outputData.open === "function") { | ||
open = outputData.open(object); | ||
} else { | ||
open = outputData.open || open; | ||
} | ||
if (typeof outputData.message === "function") { | ||
@@ -108,3 +135,3 @@ message = outputData.message(object); | ||
} | ||
return generate(outputData, object, title, message, templateOptions); | ||
return generate(outputData, object, title, message, subtitle, open, templateOptions); | ||
} |
{ | ||
"name": "gulp-notify", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"description": "gulp plugin to send messages based on Vinyl Files or Errors to Mac OS X, Linux or Windows using the node-notifier module. Fallbacks to Growl or simply logging", | ||
@@ -33,13 +33,13 @@ "keywords": [ | ||
"dependencies": { | ||
"gulp-util": "~2.2.12", | ||
"lodash.template": "~2.4.1", | ||
"node-notifier": "^4.0.3", | ||
"node.extend": "^1.0.9", | ||
"through2": "^1.0.0" | ||
"gulp-util": "^3.0.2", | ||
"lodash.template": "^3.0.0", | ||
"node-notifier": "^4.1.0", | ||
"node.extend": "^1.1.3", | ||
"through2": "^0.6.3" | ||
}, | ||
"devDependencies": { | ||
"gulp": "^3.6.2", | ||
"gulp-plumber": "^0.6.2", | ||
"mocha": "^2.0.1", | ||
"should": "^4.3.0" | ||
"gulp": "^3.8.10", | ||
"gulp-plumber": "^0.6.6", | ||
"mocha": "^2.1.0", | ||
"should": "^4.6.1" | ||
}, | ||
@@ -46,0 +46,0 @@ "engines": { |
@@ -108,6 +108,6 @@ # gulp-notify [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][depstat-image]][depstat-url] | ||
The result of the function is used as message. | ||
Vinyl File from gulp stream passed in as argument. | ||
The returned string can be a lodash template as | ||
The result of the function can be a string used as the message or an options object (see below). | ||
If the returned value is a string, it can be a lodash template as | ||
it is passed through [gulp-util.template](https://github.com/gulpjs/gulp-util#templatestring-data). | ||
@@ -114,0 +114,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
94430
1099
+ Addedansi-gray@0.1.1(transitive)
+ Addedansi-regex@2.1.1(transitive)
+ Addedansi-styles@2.2.1(transitive)
+ Addedansi-wrap@0.1.0(transitive)
+ Addedarray-differ@1.0.0(transitive)
+ Addedarray-uniq@1.0.3(transitive)
+ Addedbeeper@1.1.1(transitive)
+ Addedchalk@1.1.3(transitive)
+ Addedclone@1.0.4(transitive)
+ Addedcolor-support@1.1.3(transitive)
+ Addeddateformat@2.2.0(transitive)
+ Addedfancy-log@1.3.3(transitive)
+ Addedglogg@1.0.2(transitive)
+ Addedgulp-util@3.0.8(transitive)
+ Addedgulplog@1.0.0(transitive)
+ Addedhas-ansi@2.0.0(transitive)
+ Addedhas-gulplog@0.1.0(transitive)
+ Addedisarray@1.0.0(transitive)
+ Addedlodash._basetostring@3.0.1(transitive)
+ Addedlodash._basevalues@3.0.0(transitive)
+ Addedlodash._isiterateecall@3.0.9(transitive)
+ Addedlodash._reescape@3.0.0(transitive)
+ Addedlodash._reevaluate@3.0.0(transitive)
+ Addedlodash._reinterpolate@3.0.0(transitive)
+ Addedlodash._root@3.0.1(transitive)
+ Addedlodash.escape@3.2.0(transitive)
+ Addedlodash.restparam@3.6.1(transitive)
+ Addedlodash.template@3.6.2(transitive)
+ Addedlodash.templatesettings@3.1.1(transitive)
+ Addedobject-assign@3.0.0(transitive)
+ Addedparse-node-version@1.0.1(transitive)
+ Addedprocess-nextick-args@2.0.1(transitive)
+ Addedreadable-stream@2.3.8(transitive)
+ Addedreplace-ext@0.0.1(transitive)
+ Addedsafe-buffer@5.1.2(transitive)
+ Addedsparkles@1.0.1(transitive)
+ Addedstring_decoder@1.1.1(transitive)
+ Addedstrip-ansi@3.0.1(transitive)
+ Addedsupports-color@2.0.0(transitive)
+ Addedthrough2@0.6.52.0.5(transitive)
+ Addedtime-stamp@1.1.0(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
+ Addedvinyl@0.5.3(transitive)
- Removedansi-regex@0.2.1(transitive)
- Removedansi-styles@1.1.0(transitive)
- Removedarray-find-index@1.0.2(transitive)
- Removedcamelcase@2.1.1(transitive)
- Removedcamelcase-keys@2.1.0(transitive)
- Removedchalk@0.5.1(transitive)
- Removedcurrently-unhandled@0.4.1(transitive)
- Removeddateformat@1.0.12(transitive)
- Removeddecamelize@1.2.0(transitive)
- Removederror-ex@1.3.2(transitive)
- Removedfind-up@1.1.2(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedget-stdin@4.0.1(transitive)
- Removedgraceful-fs@4.2.11(transitive)
- Removedgulp-util@2.2.20(transitive)
- Removedhas-ansi@0.1.0(transitive)
- Removedhasown@2.0.2(transitive)
- Removedhosted-git-info@2.8.9(transitive)
- Removedindent-string@2.1.0(transitive)
- Removedis-arrayish@0.2.1(transitive)
- Removedis-core-module@2.15.1(transitive)
- Removedis-finite@1.1.0(transitive)
- Removedis-utf8@0.2.1(transitive)
- Removedload-json-file@1.1.0(transitive)
- Removedlodash._escapehtmlchar@2.4.1(transitive)
- Removedlodash._escapestringchar@2.4.1(transitive)
- Removedlodash._htmlescapes@2.4.1(transitive)
- Removedlodash._isnative@2.4.1(transitive)
- Removedlodash._objecttypes@2.4.1(transitive)
- Removedlodash._reinterpolate@2.4.1(transitive)
- Removedlodash._reunescapedhtml@2.4.1(transitive)
- Removedlodash._shimkeys@2.4.1(transitive)
- Removedlodash.defaults@2.4.1(transitive)
- Removedlodash.escape@2.4.1(transitive)
- Removedlodash.isobject@2.4.1(transitive)
- Removedlodash.keys@2.4.1(transitive)
- Removedlodash.template@2.4.1(transitive)
- Removedlodash.templatesettings@2.4.1(transitive)
- Removedlodash.values@2.4.1(transitive)
- Removedloud-rejection@1.6.0(transitive)
- Removedmap-obj@1.0.1(transitive)
- Removedmeow@3.7.0(transitive)
- Removedminimist@0.2.4(transitive)
- Removednormalize-package-data@2.5.0(transitive)
- Removedobject-assign@4.1.1(transitive)
- Removedparse-json@2.2.0(transitive)
- Removedpath-exists@2.1.0(transitive)
- Removedpath-parse@1.0.7(transitive)
- Removedpath-type@1.1.0(transitive)
- Removedpify@2.3.0(transitive)
- Removedpinkie@2.0.4(transitive)
- Removedpinkie-promise@2.0.1(transitive)
- Removedread-pkg@1.1.0(transitive)
- Removedread-pkg-up@1.0.1(transitive)
- Removedredent@1.0.0(transitive)
- Removedrepeating@2.0.1(transitive)
- Removedresolve@1.22.8(transitive)
- Removedsignal-exit@3.0.7(transitive)
- Removedspdx-correct@3.2.0(transitive)
- Removedspdx-exceptions@2.5.0(transitive)
- Removedspdx-expression-parse@3.0.1(transitive)
- Removedspdx-license-ids@3.0.20(transitive)
- Removedstrip-ansi@0.3.0(transitive)
- Removedstrip-bom@2.0.0(transitive)
- Removedstrip-indent@1.0.1(transitive)
- Removedsupports-color@0.2.0(transitive)
- Removedsupports-preserve-symlinks-flag@1.0.0(transitive)
- Removedthrough2@0.5.11.1.1(transitive)
- Removedtrim-newlines@1.0.0(transitive)
- Removedvalidate-npm-package-license@3.0.4(transitive)
- Removedvinyl@0.2.3(transitive)
- Removedxtend@3.0.0(transitive)
Updatedgulp-util@^3.0.2
Updatedlodash.template@^3.0.0
Updatednode-notifier@^4.1.0
Updatednode.extend@^1.1.3
Updatedthrough2@^0.6.3