Skip to content

Commit bba9bb2

Browse files
committed
Fix travis test checks for #160
1 parent d9e2aa9 commit bba9bb2

File tree

2 files changed

+19
-23
lines changed

2 files changed

+19
-23
lines changed

README.md

+4-10
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ options: {
5757
var names = filename.replace(/modules\/(.*)(\/\w+\.hbs)/, '$1');
5858
return names.split('/').join('.');
5959
},
60-
},
61-
files: {
62-
'ns_nested_tmpls.js' : [ 'modules/**/*.hbs']
60+
files: {
61+
'ns_nested_tmpls.js' : [ 'modules/**/*.hbs']
62+
}
6363
}
6464
```
6565

@@ -102,12 +102,6 @@ define(['handlebars'], function(Handlebars) {
102102
});
103103
```
104104

105-
#### amdDefinitionName
106-
Type: `String`
107-
Default: `false`
108-
109-
This option gives a name to the AMD module. It is necessary to have amd true.
110-
111105
#### commonjs
112106
Type: `Boolean`
113107
Default: `false`
@@ -293,4 +287,4 @@ handlebars: {
293287

294288
Task submitted by [Tim Branyen](http://tbranyen.com)
295289

296-
*This file was generated on Fri Oct 16 2015 18:59:59.*
290+
*This file was generated on Mon Jan 11 2016 00:04:35.*

tasks/handlebars.js

+15-13
Original file line numberDiff line numberDiff line change
@@ -187,24 +187,27 @@ module.exports = function(grunt) {
187187
}
188188

189189
// Start to wrap file with AMD
190-
if (options.amd) {
191-
// addd AMD name string from options.amdDefinitionName
192-
var amdNameString = "";
190+
if (options.amd) {
191+
192+
// add AMD name string from options.amdDefinitionName
193+
var amdNameString = '';
193194

194195
// Verify if it was set a name to define method and its a string
195-
if(options.amdDefinitionName && typeof options.amdDefinitionName === 'string'){
196-
amdNameString = '\''+options.amdDefinitionName+'\',';
197-
}else{
198-
amdNameString = '';
199-
}
196+
if (options.amdDefinitionName && typeof options.amdDefinitionName === 'string') {
197+
amdNameString = '\'' + options.amdDefinitionName + '\',';
198+
} else {
199+
amdNameString = '';
200+
}
200201

201202
// Wrap the file in an AMD define fn.
202203
if (typeof options.amd === 'boolean') {
203-
output.unshift('define('+amdNameString+'[\'handlebars\'], function(Handlebars) {');
204+
output.unshift('define(' + amdNameString + '[\'handlebars\'], function(Handlebars) {');
204205
} else if (typeof options.amd === 'string') {
205-
output.unshift('define('+amdNameString+'[\'' + options.amd + '\'], function(Handlebars) {');
206+
output.unshift('define(' + amdNameString + '[\'' + options.amd + '\'], function(Handlebars) {');
206207
} else if (typeof options.amd === 'function') {
207-
output.unshift('define('+amdNameString+'[\'' + options.amd(filename, ast, compiled) + '\'], function(Handlebars) {');
208+
//jscs:disable maximumLineLength
209+
output.unshift('define(' + amdNameString + '[\'' + options.amd(filename, ast, compiled) + '\'], function(Handlebars) {');
210+
//jscs:enable maximumLineLength
208211
} else if (Array.isArray(options.amd)) {
209212
// convert options.amd to a string of dependencies for require([...])
210213
var amdString = '';
@@ -217,7 +220,7 @@ module.exports = function(grunt) {
217220
}
218221

219222
// Wrap the file in an AMD define fn.
220-
output.unshift('define('+amdNameString+'[' + amdString + '], function(Handlebars) {');
223+
output.unshift('define(' + amdNameString + '[' + amdString + '], function(Handlebars) {');
221224
}
222225

223226
if (useNamespace) {
@@ -227,7 +230,6 @@ module.exports = function(grunt) {
227230
}
228231
output.push('});');
229232
}
230-
// End of AMD
231233

232234
if (options.commonjs) {
233235
if (useNamespace) {

0 commit comments

Comments
 (0)