From f53b7e13b6adb8063b9912523b0dc06380f300f6 Mon Sep 17 00:00:00 2001 From: Andrew Date: Fri, 27 Mar 2015 13:31:32 -0600 Subject: [PATCH] gulp e2e: remove unneeded abstraction --- gulpfile.js | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 3f1a9cfa5e..a076ee3ef1 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -84,15 +84,6 @@ gulp.task('e2e', ['build'], function() { }) var testTemplate = _.template( fs.readFileSync('scripts/e2e/e2e.template.js') ) - function wrapContents(file, template, data) { - var contents = file.contents.toString(); - contents = template(_.defaults(data || {}, { - contents: contents, - buildConfig: buildConfig, - })) - file.contents = new Buffer(contents); - } - return gulp.src(buildConfig.src.e2e) .pipe(rename(function(file) { file.dirname = file.dirname.replace('/test/', '/') @@ -108,9 +99,13 @@ gulp.task('e2e', ['build'], function() { .pipe(gulpif(/.e2e.js$/, through2.obj(function(file, enc, next) { var basename = path.basename(file); var relativePath = path.dirname(file.path.replace(/^.*?src.components/, '')) - wrapContents(file, testTemplate, { - relativePath: relativePath, - }); + var contents = file.contents.toString(); + contents = template(_.defaults(data || {}, { + contents: contents, + buildConfig: buildConfig, + relativePath: relativePath + })) + file.contents = new Buffer(contents); next(null, file); }))) .pipe(gulpif({ isFile: true }, gulp.dest(buildConfig.dist + '/e2e')))