<commit_before>var loadEmberApp = function() {

  function resolve(prefix) {
    return function(parsedName) {
      var moduleName = prefix + parsedName.fullNameWithoutType;

      if (define.registry[moduleName]) {
        console.log('Module hit:', moduleName);
        return requireModule(moduleName);
      } else {
        console.log('Module miss:', moduleName);
        return this._super(parsedName);
      }
    };
  }

  function resolver(prefix) {
    return Ember.DefaultResolver.extend({
      resolveController: resolve(prefix + '/controllers/'),
      resolveView:       resolve(prefix + '/views/')
    });
  }

  var App = Ember.Application.create({
    rootElement: '#card',
    resolver: resolver('app')
  });

  App.deferReadiness();
  requireModule('templates');
  return App;
};

export loadEmberApp;<commit_msg>use the same resolver in the issues card<commit_after>var loadEmberApp = function() {

  var typeMap = {
    view: 'views',
    util: 'utils',
    route: 'routes',
    service: 'services',
    controller: 'controllers'
  };

  function classFactory(klass) {
    return {
      create: function (injections) {
        return klass.extend(injections);
      }
    };
  }

  function resolve(prefix) {
    return function(parsedName){
      var pluralizedType = typeMap[parsedName.type] || parsedName.type;
      var name = Ember.String.underscore(parsedName.fullNameWithoutType);

      var moduleName = prefix + '/' +  pluralizedType + '/' + name;
      var module;

      if (define.registry[moduleName]) {
        module = requireModule(moduleName);

        if (typeof module.create !== 'function') {
          module = classFactory(module);
        }

        if (Ember.ENV.LOG_MODULE_RESOLVER){
          console.log('hit', moduleName);
        }

        return module;
      } else  {
        if (Ember.ENV.LOG_MODULE_RESOLVER){
          console.log('miss', moduleName);
        }

        return this._super(parsedName);
      }
    };
  }

  function resolver(prefix) {
    return  Ember.DefaultResolver.extend({
      resolveOther: resolve(prefix)
    });
  }

  var App = Ember.Application.create({
    rootElement: '#card',
    resolver: resolver('app')
  });

  App.deferReadiness();
  requireModule('templates');
  return App;
};

export loadEmberApp;
{'fraction_non_alphanumeric': 0.1291304347826087, 'fraction_numerical': 0.0, 'mean_word_length': 2.717285945072698, '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': '1771962', 'n_tokens_mistral': 692, 'n_tokens_neox': 682, 'n_words': 136}