Skip to content

Commit 87c5100

Browse files
committed
Merge branch 'dev' into code-cleanup
Conflicts: Gruntfile.js builder/parameter_hunter.js
2 parents c638157 + 25d3b7f commit 87c5100

File tree

6 files changed

+21
-21
lines changed

6 files changed

+21
-21
lines changed

.eslintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"no-multi-spaces": 1,
5050
"no-native-reassign": 2,
5151
"no-new": 2,
52-
"no-param-reassign": 2,
52+
"no-param-reassign": 1,
5353
"no-proto": 2,
5454
"no-redeclare": 0,
5555
"no-script-url": 2,

Gruntfile.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module.exports = function (grunt) {
1212
concat: {
1313
options: {
1414
stripBanners: true,
15-
banner: '/* \n * <%= pkg.name %> - v<%= pkg.version %> - <%= grunt.template.today("yyyy") %> \n * \n * <%= pkg.author %>, and the web community.\n * Licensed under the <%= pkg.license %> license. \n * \n * Many thanks to Brad Frost and Dave Olsen for inspiration, encouragement, and advice. \n *\n */\n\n'
15+
banner: '/* \n * <%= pkg.name %> - v<%= pkg.version %> - <%= grunt.template.today("yyyy") %> \n * \n * <%= pkg.author %>, and the web community.\n * Licensed under the <%= pkg.license %> license. \n * \n * Many thanks to Brad Frost and Dave Olsen for inspiration, encouragement, and advice. \n *\n */\n\n',
1616
},
1717
patternlab: {
1818
src: './builder/patternlab.js',
@@ -107,7 +107,7 @@ module.exports = function (grunt) {
107107
},
108108
snippetOptions: {
109109
// Ignore all HTML files within the templates folder
110-
blacklist: ['/index.html', '/']
110+
blacklist: ['/index.html', '/', '/?*']
111111
},
112112
plugins: [
113113
{

builder/parameter_hunter.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,5 +90,3 @@ var parameter_hunter = function () {
9090
};
9191

9292
module.exports = parameter_hunter;
93-
94-

builder/pattern_assembler.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ var pattern_assembler = function () {
7979

8080
//http://stackoverflow.com/questions/6274339/how-can-i-shuffle-an-array-in-javascript
8181
function shuffle(o) {
82-
for (var j, x, i = o.length; i; j = Math.floor(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x);
82+
for (var j, x, i = o.length; i; j = Math.floor(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x); //eslint-disable-line curly
8383
return o;
8484
}
8585

@@ -302,10 +302,12 @@ var pattern_assembler = function () {
302302
}
303303

304304
function mergeData(obj1, obj2) {
305-
if (typeof obj2 === 'undefined') {
305+
if (typeof obj2 === 'undefined') {
306+
//noinspection Eslint
306307
obj2 = {};
307308
}
308-
for (var p in obj1) {
309+
310+
for (var p in obj1) { //eslint-disable-line guard-for-in
309311
try {
310312
// Only recurse if obj1[p] is an object.
311313
if (obj1[p].constructor === Object) {

gulpfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ gulp.task('connect', ['lab'], function () {
112112
},
113113
snippetOptions: {
114114
// Ignore all HTML files within the templates folder
115-
blacklist: ['/index.html', '/']
115+
blacklist: ['/index.html', '/', '/?*']
116116
},
117117
notify: {
118118
styles: [

test/parameter_hunter_tests.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -158,32 +158,32 @@
158158
test.done();
159159
},
160160

161-
'parameter hunter parses parameters with single-quoted keys and single-quoted values' : function(test){
161+
'parameter hunter parses parameters with single-quoted keys and single-quoted values wrapping internal escaped single-quotes' : function(test){
162162
var currentPattern = currentPatternClosure();
163163
var patternlab = patternlabClosure();
164164
var parameter_hunter = new ph();
165165

166-
currentPattern.template = "{{> molecules-single-comment('description': 'true') }}";
166+
currentPattern.template = "{{> molecules-single-comment('description': 'true not,\\'true\\'') }}";
167167
currentPattern.extendedTemplate = currentPattern.template;
168168
currentPattern.parameteredPartials[0] = currentPattern.template;
169169

170170
parameter_hunter.find_parameters(currentPattern, patternlab);
171-
test.equals(currentPattern.extendedTemplate, '<p>true</p>');
171+
test.equals(currentPattern.extendedTemplate, '<p>true not,&#39;true&#39;</p>');
172172

173173
test.done();
174174
},
175175

176-
'parameter hunter parses parameters with single-quoted keys and double-quoted values' : function(test){
176+
'parameter hunter parses parameters with single-quoted keys and double-quoted values wrapping internal single-quotes' : function(test){
177177
var currentPattern = currentPatternClosure();
178178
var patternlab = patternlabClosure();
179179
var parameter_hunter = new ph();
180180

181-
currentPattern.template = "{{> molecules-single-comment('description': \"true\") }}";
181+
currentPattern.template = "{{> molecules-single-comment('description': \"true not:'true'\") }}";
182182
currentPattern.extendedTemplate = currentPattern.template;
183183
currentPattern.parameteredPartials[0] = currentPattern.template;
184184

185185
parameter_hunter.find_parameters(currentPattern, patternlab);
186-
test.equals(currentPattern.extendedTemplate, '<p>true</p>');
186+
test.equals(currentPattern.extendedTemplate, '<p>true not:&#39;true&#39;</p>');
187187

188188
test.done();
189189
},
@@ -203,32 +203,32 @@
203203
test.done();
204204
},
205205

206-
'parameter hunter parses parameters with double-quoted keys and single-quoted values' : function(test){
206+
'parameter hunter parses parameters with double-quoted keys and single-quoted values wrapping internal double-quotes' : function(test){
207207
var currentPattern = currentPatternClosure();
208208
var patternlab = patternlabClosure();
209209
var parameter_hunter = new ph();
210210

211-
currentPattern.template = "{{> molecules-single-comment(\"description\": 'true') }}";
211+
currentPattern.template = "{{> molecules-single-comment(\"description\": 'true not{\"true\"') }}";
212212
currentPattern.extendedTemplate = currentPattern.template;
213213
currentPattern.parameteredPartials[0] = currentPattern.template;
214214

215215
parameter_hunter.find_parameters(currentPattern, patternlab);
216-
test.equals(currentPattern.extendedTemplate, '<p>true</p>');
216+
test.equals(currentPattern.extendedTemplate, '<p>true not{&quot;true&quot;</p>');
217217

218218
test.done();
219219
},
220220

221-
'parameter hunter parses parameters with double-quoted keys and double-quoted values' : function(test){
221+
'parameter hunter parses parameters with double-quoted keys and double-quoted values wrapping internal escaped double-quotes' : function(test){
222222
var currentPattern = currentPatternClosure();
223223
var patternlab = patternlabClosure();
224224
var parameter_hunter = new ph();
225225

226-
currentPattern.template = "{{> molecules-single-comment(\"description\": \"true\") }}";
226+
currentPattern.template = "{{> molecules-single-comment(\"description\": \"true not}\\\"true\\\"\") }}";
227227
currentPattern.extendedTemplate = currentPattern.template;
228228
currentPattern.parameteredPartials[0] = currentPattern.template;
229229

230230
parameter_hunter.find_parameters(currentPattern, patternlab);
231-
test.equals(currentPattern.extendedTemplate, '<p>true</p>');
231+
test.equals(currentPattern.extendedTemplate, '<p>true not}&quot;true&quot;</p>');
232232

233233
test.done();
234234
}

0 commit comments

Comments
 (0)