File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11var path = require ( 'path' ) ;
2- var inflection = require ( 'inflection' ) ;
32var CoreObject = require ( 'core-object' ) ;
43var fse = require ( 'fs-extra' ) ;
54var existsSync = require ( 'exists-sync' ) ;
@@ -156,12 +155,10 @@ var FileInfo = CoreObject.extend({
156155 return true ;
157156 }
158157
159- var singularizedCollection = inflection . singularize ( this . collection ) ;
160- var isDefaultTypeForCollection = singularizedCollection === this . type ;
161- var hasNamespace = ! ! this . namespace ;
158+ var isDefaultTypeForCollection = defaultTypeForCollection ( this . collection ) === this . type ;
162159
163160 // use <name>.<ext> in the root of a collection if it is the default type
164- return isDefaultTypeForCollection && ! hasNamespace ;
161+ return isDefaultTypeForCollection ;
165162 }
166163} ) ;
167164
Original file line number Diff line number Diff line change 1- module . exports = function ( collection ) {
2- switch ( collection ) {
3- case 'models' :
4- return 'model' ;
5-
6- case 'components' :
7- return 'component' ;
8-
9- case 'initializers' :
10- return 'initializer' ;
11-
12- case 'instance-initializers' :
13- return 'instance-initializer' ;
14-
15- //case 'partials':
16- // return 'partial';
1+ var inflection = require ( 'inflection' ) ;
172
18- case 'routes' :
19- return 'route' ;
20-
21- case 'services' :
22- return 'service' ;
23-
24- case 'transforms' :
25- return 'transform' ;
26-
27- case 'utils' :
28- return 'util' ;
29-
30- default :
31- return null ;
32- }
3+ module . exports = function ( collection ) {
4+ return inflection . singularize ( collection ) ;
335} ;
Original file line number Diff line number Diff line change @@ -71,9 +71,9 @@ describe('classic engine', function() {
7171 'app/components/qux-derp/component.js' : 'src/ui/components/qux-derp/component.js' ,
7272 'app/templates/components/foo-bar.hbs' : 'src/ui/components/foo-bar/template.hbs' ,
7373 'app/components/qux-derp/template.hbs' : 'src/ui/components/qux-derp/template.hbs' ,
74- 'app/routes/post/index.js' : 'src/ui/routes/post/index/route .js' ,
74+ 'app/routes/post/index.js' : 'src/ui/routes/post/index.js' ,
7575 'app/templates/post/index.hbs' : 'src/ui/routes/post/index/template.hbs' ,
76- 'app/routes/foo/bar/baz.js' : 'src/ui/routes/foo/bar/baz/route .js' ,
76+ 'app/routes/foo/bar/baz.js' : 'src/ui/routes/foo/bar/baz.js' ,
7777 'app/templates/foo/bar/baz.hbs' : 'src/ui/routes/foo/bar/baz/template.hbs' ,
7878 'app/adapters/post.js' : 'src/data/models/post/adapter.js' ,
7979 'app/serializers/post.js' : 'src/data/models/post/serializer.js' ,
You can’t perform that action at this time.
0 commit comments