@@ -10,14 +10,14 @@ var ModuleGenerator = module.exports = function ModuleGenerator() {
10
10
11
11
util . inherits ( ModuleGenerator , yeoman . generators . NamedBase ) ;
12
12
13
- ModuleGenerator . prototype . getAuthor = function getAuthor ( ) {
13
+ ModuleGenerator . prototype . getAuthor = function getAuthor ( ) {
14
14
this . author = this . readFileAsString ( 'AUTHORS' ) ;
15
15
} ;
16
16
17
- ModuleGenerator . prototype . date = function date ( ) {
17
+ ModuleGenerator . prototype . date = function date ( ) {
18
18
var d = new Date ( ) ;
19
19
this . date = d . getFullYear ( ) + '-' + ( d . getMonth ( ) + 1 ) + '-' + d . getDate ( ) ;
20
- }
20
+ } ;
21
21
22
22
ModuleGenerator . prototype . module = function module ( ) {
23
23
this . copy ( 'module.js' , 'js/modules/' + this . name + '.js' ) ;
@@ -28,7 +28,6 @@ ModuleGenerator.prototype.test = function test() {
28
28
} ;
29
29
30
30
ModuleGenerator . prototype . loadSpecs = function loadSpecs ( ) {
31
- var specsToLoad , specFileContent , specTpl ;
32
31
var specs = [ ] ;
33
32
var specsPath = path . join ( process . cwd ( ) , 'test/specs' ) ;
34
33
@@ -37,11 +36,7 @@ ModuleGenerator.prototype.loadSpecs = function loadSpecs() {
37
36
specs = specs . map ( function cutFileending ( specFile ) {
38
37
return specFile . replace ( '.js' , '' ) ;
39
38
} ) ;
40
- specsToLoad = '"' + specs . join ( '", "' ) + '"' ;
41
- specTpl = path . join ( this . sourceRoot ( ) , 'spec.js' ) ;
42
- specFileContent = this . readFileAsString ( specTpl ) ;
43
- specFileContent = specFileContent . replace ( '<%= specs %>' , specsToLoad ) ;
44
-
45
- this . write ( path . join ( process . cwd ( ) , 'test/spec.js' ) , specFileContent ) ;
39
+ this . specs = '"' + specs . join ( '", "' ) + '"' ;
40
+ this . template ( path . join ( this . sourceRoot ( ) , 'spec.js' ) , 'test/spec.js' ) ;
46
41
}
47
42
} ;
0 commit comments