<commit_before>'use strict';

var
  fs      = require('fs'),
  util    = require('util'),
  growler = require('growler')
;

module.exports = function(applicationOptions) {

  applicationOptions = util._extend({
    icon: fs.readFileSync(__dirname + '/gulp.png')
  }, applicationOptions || {});

  var growl = new growler.GrowlApplication('Gulp', applicationOptions);

  growl.setNotifications({
    Gulp: {}
  });

  function notify(notificationOptions, callback) {

    growl.register(function(success, err) {
      if (!success) {
        throw callback(err);
      }

      // Rename 'message' property to 'text'
      notificationOptions.text = notificationOptions.message;
      delete notificationOptions.message;

      growl.sendNotification('Gulp', notificationOptions, function(success, err) {
        return callback(err, success);
      });

    });

  }

  return notify;

};<commit_msg>Expose GrowlApplication instance (useful for testing)<commit_after>'use strict';

var
  fs      = require('fs'),
  util    = require('util'),
  growler = require('growler')
;

module.exports = function(applicationOptions) {

  applicationOptions = util._extend({
    icon: fs.readFileSync(__dirname + '/gulp.png')
  }, applicationOptions || {});

  var app = new growler.GrowlApplication('Gulp', applicationOptions);

  app.setNotifications({
    Gulp: {}
  });

  function notify(notificationOptions, callback) {

    app.register(function(success, err) {
      if (!success) {
        throw callback(err);
      }

      // Rename 'message' property to 'text'
      notificationOptions.text = notificationOptions.message;
      delete notificationOptions.message;

      app.sendNotification('Gulp', notificationOptions, function(success, err) {
        return callback(err, success);
      });

    });

  }

  notify.app = app;

  return notify;

};
{'fraction_non_alphanumeric': 0.1332973556395035, 'fraction_numerical': 0.0, 'mean_word_length': 3.3623529411764705, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1171666', 'n_tokens_mistral': 541, 'n_tokens_neox': 518, 'n_words': 109}