<commit_before>import Ember from 'ember';
import FactoryGuy from 'ember-data-factory-guy/factory-guy';
import FactoryGuyTestHelper from 'ember-data-factory-guy/factory-guy-test-helper';
import config from '../config/environment';

export default {
  name: 'ember-data-factory-guy',
  after: 'ember-data',

  initialize: function(application) {
    var container = application.__container__;
    FactoryGuy.setStore(container.lookup('service:store'));
    FactoryGuyTestHelper.set('container', container);
    FactoryGuy.resetDefinitions();

    var prefix = config.modulePrefix;
    var factoryFileRegExp = new RegExp('^' + prefix + '/tests/factories');

    Object.keys(requirejs._eak_seen).filter(function(key) {
      return factoryFileRegExp.test(key);
    }).forEach(function(moduleName) {
      if (moduleName.match('.jshint')) { // ignore autogenerated .jshint files
        return;
      }
      if (moduleName.match('.jscs')) { // ignore autogenerated .jscs files
        return;
      }
      require(moduleName, null, null, true);
    });
  }
};<commit_msg>fixed initializer for ember 2.1 and below<commit_after>import Ember from 'ember';
import FactoryGuy from 'ember-data-factory-guy/factory-guy';
import FactoryGuyTestHelper from 'ember-data-factory-guy/factory-guy-test-helper';
import config from '../config/environment';

export default {
  name: 'ember-data-factory-guy',
  after: 'ember-data',

  initialize: function (application) {
    if (arguments.length > 1) {
      application = arguments[1];
    }
    var container = application.__container__;
    FactoryGuy.setStore(container.lookup('service:store'));
    FactoryGuyTestHelper.set('container', container);
    FactoryGuy.resetDefinitions();

    var prefix = config.modulePrefix;
    var factoryFileRegExp = new RegExp('^' + prefix + '/tests/factories');

    Object.keys(requirejs._eak_seen).filter(function (key) {
      return factoryFileRegExp.test(key);
    }).forEach(function (moduleName) {
      if (moduleName.match('.jshint')) { // ignore autogenerated .jshint files
        return;
      }
      if (moduleName.match('.jscs')) { // ignore autogenerated .jscs files
        return;
      }
      require(moduleName, null, null, true);
    });
  }
};
{'fraction_non_alphanumeric': 0.13711478338543992, 'fraction_numerical': 0.001786511835640911, 'mean_word_length': 3.6764091858037578, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '7047370', 'n_tokens_mistral': 685, 'n_tokens_neox': 650, 'n_words': 138}