<commit_before>import Ember from 'ember';

var proxyGenerator = function(name){
  return function(msg = '', title = '') {
    window.toastr[name](msg.toString(), title.toString());
  };
};

export function initialize(container, application, options) {
  var injectAs = options.injectAs;
  window.toastr.options = options.toastrOptions;

  var proxiedToastr = Ember.Object.extend(toastr).create({
    success: proxyGenerator('success'),
    info: proxyGenerator('info'),
    warning: proxyGenerator('warning'),
    error: proxyGenerator('error')
  });

  application.register('notify:main', proxiedToastr, { instantiate: false, singleton: true });
  application.inject('route', injectAs, 'notify:main');
  application.inject('controller', injectAs, 'notify:main');
  application.inject('component', injectAs, 'notify:main');
}<commit_msg>Fix initializer deprecation for 2.x<commit_after>import Ember from 'ember';

var proxyGenerator = function(name){
  return function(msg = '', title = '') {
    window.toastr[name](msg.toString(), title.toString());
  };
};

export function initialize() {
  // support 1.x and 2.x
  var application = arguments[1] || arguments[0];
  var injectAs = options.injectAs;

  window.toastr.options = options.toastrOptions;

  var proxiedToastr = Ember.Object.extend(toastr).create({
    success: proxyGenerator('success'),
    info: proxyGenerator('info'),
    warning: proxyGenerator('warning'),
    error: proxyGenerator('error')
  });

  application.register('notify:main', proxiedToastr, { instantiate: false, singleton: true });
  application.inject('route', injectAs, 'notify:main');
  application.inject('controller', injectAs, 'notify:main');
  application.inject('component', injectAs, 'notify:main');
}
{'fraction_non_alphanumeric': 0.15795519816197587, 'fraction_numerical': 0.002871912693854107, 'mean_word_length': 5.548872180451128, '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': '2239494', 'n_tokens_mistral': 509, 'n_tokens_neox': 502, 'n_words': 106}