Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Dec 17, 2011
1 parent e5f9029 commit 8a0c05e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 20 deletions.
6 changes: 1 addition & 5 deletions lib/growl.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,9 @@ exports.notify = function(msg, options, fn) {
case 'Darwin':
args.push(cmd.msg);
args.push('"' + msg + '"');
// title
if (options.title) {
args.push(options.title);
}
if (options.title) args.push(options.title);
break;
case 'Linux':
// title
if (options.title) {
args.push("'" + options.title + "'");
args.push(cmd.msg);
Expand Down
27 changes: 12 additions & 15 deletions test.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@

var growl = require('./lib/growl')

growl.binVersion(function(err, version){
console.log(version);
})
growl.notify('You have mail!')
// growl.notify('5 new messages', { sticky: true })
// growl.notify('5 new emails', { title: 'Email Client', image: 'Safari', sticky: true })
// growl.notify('Message with title', { title: 'Title'})
// growl.notify('Set priority', { priority: 2 })
// growl.notify('Show Safari icon', { image: 'Safari' })
// growl.notify('Show icon', { image: 'path/to/icon.icns' })
// growl.notify('Show image', { image: 'path/to/my.image.png' })
// growl.notify('Show png filesystem icon', { image: 'png' })
// growl.notify('Show pdf filesystem icon', { image: 'article.pdf' })
// growl.notify('Show pdf filesystem icon', { image: 'article.pdf' }, function(){
// require('sys').p('callback')
// })
growl.notify('5 new messages', { sticky: true })
growl.notify('5 new emails', { title: 'Email Client', image: 'Safari', sticky: true })
growl.notify('Message with title', { title: 'Title'})
growl.notify('Set priority', { priority: 2 })
growl.notify('Show Safari icon', { image: 'Safari' })
growl.notify('Show icon', { image: 'path/to/icon.icns' })
growl.notify('Show image', { image: 'path/to/my.image.png' })
growl.notify('Show png filesystem icon', { image: 'png' })
growl.notify('Show pdf filesystem icon', { image: 'article.pdf' })
growl.notify('Show pdf filesystem icon', { image: 'article.pdf' }, function(){
console.log('callback');
})

0 comments on commit 8a0c05e

Please sign in to comment.