Skip to content

Commit 2ac2abf

Browse files
committed
Merge pull request #10 from zeppelin/master
Auto-assign names to initializers if not already set
2 parents 3a6dc87 + 0dcd480 commit 2ac2abf

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Diff for: ember-load-initializers.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,14 @@ define("ember/load-initializers",
1313
}).forEach(function(moduleName) {
1414
var module = require(moduleName, null, null, true);
1515
if (!module) { throw new Error(moduleName + ' must export an initializer.'); }
16-
app.initializer(module['default']);
16+
17+
var initializer = module['default'];
18+
if (!initializer.name) {
19+
var initializerName = moduleName.match(/[^\/]+\/?$/)[0];
20+
initializer.name = initializerName;
21+
}
22+
23+
app.initializer(initializer);
1724
});
1825
}
1926
}

0 commit comments

Comments
 (0)