@@ -7,109 +7,111 @@ module.exports = (grunt)->
7
7
pkg : grunt .file .readJSON ' package.json'
8
8
9
9
meta :
10
- banner : " /* ===========================================================\n " +
11
- " # <%= pkg.title || pkg.name %> - v<%= pkg.version %>\n " +
12
- " # ==============================================================\n " +
13
- " # Copyright (c) <%= grunt.template.today(\" yyyy\" ) %> <%= pkg.author.name %>\n " +
14
- " # Licensed <%= _.pluck(pkg.licenses, \" type\" ).join(\" , \" ) %>.\n " +
15
- " */\n "
10
+ banner : ' /* ===========================================================\n ' +
11
+ ' # <%= pkg.title || pkg.name %> - v<%= pkg.version %>\n ' +
12
+ ' # ==============================================================\n ' +
13
+ ' # Copyright (c) <%= grunt.template.today(\" yyyy\" ) %> <%= pkg.author.name %>\n ' +
14
+ ' # Licensed <%= _.pluck(pkg.licenses, \" type\" ).join(\" , \" ) %>.\n ' +
15
+ ' */\n '
16
16
17
17
coffeelint :
18
18
options :
19
19
indentation :
20
20
value : 2
21
- level : " error"
21
+ level : ' error'
22
22
no_trailing_semicolons :
23
- level : " error"
23
+ level : ' error'
24
24
no_trailing_whitespace :
25
- level : " error"
25
+ level : ' error'
26
26
max_line_length :
27
- level : " ignore"
28
- default : [" Gruntfile.coffee" , " src/**/*.coffee" ]
27
+ level : ' ignore'
28
+ default : [' Gruntfile.coffee' , ' src/**/*.coffee' ]
29
29
30
30
clean :
31
- default : " lib"
32
- test : " test"
31
+ default : ' lib'
32
+ test : ' test'
33
33
34
34
coffee :
35
35
options :
36
36
bare : true
37
37
default :
38
- expand : true
39
- flatten : true
40
- cwd : " src/coffee"
41
- src : [" *.coffee" ]
42
- dest : " lib"
43
- ext : " .js"
38
+ files : grunt .file .expandMapping ([' **/*.coffee' ], ' lib/' ,
39
+ flatten : false
40
+ cwd : ' src/coffee'
41
+ ext : ' .js'
42
+ rename : (dest , matchedSrcPath )->
43
+ dest + matchedSrcPath
44
+ )
44
45
test :
45
- expand : true
46
- flatten : true
47
- cwd : " src/spec"
48
- src : [" *.spec.coffee" ]
49
- dest : " test"
50
- ext : " .spec.js"
46
+ files : grunt .file .expandMapping ([' **/*.spec.coffee' ], ' test/' ,
47
+ flatten : false
48
+ cwd : ' src/spec'
49
+ ext : ' .spec.js'
50
+ rename : (dest , matchedSrcPath )->
51
+ dest + matchedSrcPath
52
+ )
51
53
52
54
concat :
53
55
options :
54
- banner : " <%= meta.banner %>"
56
+ banner : ' <%= meta.banner %>'
55
57
stripBanners : true
56
58
default :
57
59
expand : true
58
60
flatten : true
59
- cwd : " lib"
60
- src : [" *.js" ]
61
- dest : " lib"
62
- ext : " .js"
61
+ cwd : ' lib'
62
+ src : [' *.js' ]
63
+ dest : ' lib'
64
+ ext : ' .js'
63
65
64
66
# watching for changes
65
67
watch :
66
68
default :
67
- files : [" src/coffee/*.coffee" ]
68
- tasks : [" build" ]
69
+ files : [' src/coffee/*.coffee' ]
70
+ tasks : [' build' ]
69
71
test :
70
- files : [" src/**/*.coffee" ]
71
- tasks : [" test" ]
72
+ files : [' src/**/*.coffee' ]
73
+ tasks : [' test' ]
72
74
73
75
shell :
74
76
options :
75
77
stdout : true
76
78
stderr : true
77
79
failOnError : true
78
80
coverage :
79
- command : " istanbul cover jasmine-node --captureExceptions test && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage"
81
+ command : ' istanbul cover jasmine-node --captureExceptions test && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage'
80
82
jasmine :
81
- command : " jasmine-node --captureExceptions test"
83
+ command : ' jasmine-node --captureExceptions test'
82
84
publish :
83
- command : " npm publish"
85
+ command : ' npm publish'
84
86
85
87
bump :
86
88
options :
87
- files : [" package.json" ]
88
- updateConfigs : [" pkg" ]
89
+ files : [' package.json' ]
90
+ updateConfigs : [' pkg' ]
89
91
commit : true
90
- commitMessage : " Bump version to %VERSION%"
91
- commitFiles : [" -a " ]
92
+ commitMessage : ' Bump version to %VERSION%'
93
+ commitFiles : [' -a ' ]
92
94
createTag : true
93
- tagName : " v%VERSION%"
94
- tagMessage : " Version %VERSION%"
95
+ tagName : ' v%VERSION%'
96
+ tagMessage : ' Version %VERSION%'
95
97
push : true
96
- pushTo : " origin"
97
- gitDescribeOptions : " --tags --always --abbrev=1 --dirty=-d"
98
+ pushTo : ' origin'
99
+ gitDescribeOptions : ' --tags --always --abbrev=1 --dirty=-d'
98
100
99
101
# load plugins that provide the tasks defined in the config
100
- grunt .loadNpmTasks " grunt-bump"
101
- grunt .loadNpmTasks " grunt-coffeelint"
102
- grunt .loadNpmTasks " grunt-contrib-clean"
103
- grunt .loadNpmTasks " grunt-contrib-coffee"
104
- grunt .loadNpmTasks " grunt-contrib-concat"
105
- grunt .loadNpmTasks " grunt-contrib-watch"
106
- grunt .loadNpmTasks " grunt-shell"
102
+ grunt .loadNpmTasks ' grunt-bump'
103
+ grunt .loadNpmTasks ' grunt-coffeelint'
104
+ grunt .loadNpmTasks ' grunt-contrib-clean'
105
+ grunt .loadNpmTasks ' grunt-contrib-coffee'
106
+ grunt .loadNpmTasks ' grunt-contrib-concat'
107
+ grunt .loadNpmTasks ' grunt-contrib-watch'
108
+ grunt .loadNpmTasks ' grunt-shell'
107
109
108
110
# register tasks
109
- grunt .registerTask " default" , [" build" ]
110
- grunt .registerTask " build" , [" clean" , " coffeelint" , " coffee" , " concat" ]
111
- grunt .registerTask " test" , [" build" , " shell:jasmine" ]
112
- grunt .registerTask " coverage" , [" build" , " shell:coverage" ]
113
- grunt .registerTask " release" , " Release a new version, push it and publish it" , (target )->
114
- target = " patch" unless target
115
- grunt .task .run " bump-only:#{ target} " , " test" , " bump-commit" , " shell:publish"
111
+ grunt .registerTask ' default' , [' build' ]
112
+ grunt .registerTask ' build' , [' clean' , ' coffeelint' , ' coffee' , ' concat' ]
113
+ grunt .registerTask ' test' , [' build' , ' shell:jasmine' ]
114
+ grunt .registerTask ' coverage' , [' build' , ' shell:coverage' ]
115
+ grunt .registerTask ' release' , ' Release a new version, push it and publish it' , (target )->
116
+ target = ' patch' unless target
117
+ grunt .task .run ' bump-only:#{target}' , ' test' , ' bump-commit' , ' shell:publish'
0 commit comments