From fc3d799a4c8037d15c9b1f6aefded65cf29862cb Mon Sep 17 00:00:00 2001 From: Denis Bardadym Date: Fri, 14 Aug 2015 00:07:10 +0300 Subject: [PATCH] Small repo goodies --- .eslintrc | 3 ++- gulpfile.js | 21 ++++++++++++--------- lib/ext/assert.js | 2 +- lib/ext/bool.js | 2 +- lib/ext/contain.js | 2 +- lib/ext/eql.js | 2 +- lib/ext/error.js | 2 +- lib/ext/match.js | 6 +++--- lib/ext/number.js | 2 +- lib/ext/property.js | 2 +- lib/ext/string.js | 2 +- lib/ext/type.js | 2 +- lib/should.js | 2 +- lib/util.js | 2 +- package.json | 6 +++--- 15 files changed, 31 insertions(+), 27 deletions(-) diff --git a/.eslintrc b/.eslintrc index 2f3bee6..5763e68 100644 --- a/.eslintrc +++ b/.eslintrc @@ -6,7 +6,8 @@ "eqeqeq": [2, "smart"], "curly": 0, "no-wrap-func": 0, - "no-underscore-dangle": 0 + "no-underscore-dangle": 0, + "yoda": 0 }, "env": { "node": true, diff --git a/gulpfile.js b/gulpfile.js index ffdab9e..94d7578 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,15 +1,18 @@ var gulp = require('gulp'); -var $ = require('gulp-load-plugins')({lazy: false}); -var source = require('vinyl-source-stream2'); -var browserify = require('browserify'); +var header = require('gulp-header'); +var uglify = require('gulp-uglify'); +var rename = require('gulp-rename'); + +var source = require('vinyl-source-stream'); +var buffer = require('vinyl-buffer'); -var path = require('path'); +var browserify = require('browserify'); var pkg = require('./package.json'); var banner = [ - '/*', + '/*!', ' * <%= pkg.name %> - <%= pkg.description %>', ' * @version v<%= pkg.version %>', ' * @author <%= pkg.author %>', @@ -31,10 +34,10 @@ gulp.task('script', function() { return bundleStream .pipe(source('should.js')) - .pipe($.header(banner, {pkg: pkg})) + .pipe(buffer()) + .pipe(header(banner, {pkg: pkg})) .pipe(gulp.dest('./')) - .pipe($.uglify()) - .pipe($.header(banner, {pkg: pkg})) - .pipe($.rename('should.min.js')) + .pipe(uglify({ preserveComments: 'some' })) + .pipe(rename('should.min.js')) .pipe(gulp.dest('./')); }); diff --git a/lib/ext/assert.js b/lib/ext/assert.js index 7ab15e4..29813c3 100644 --- a/lib/ext/assert.js +++ b/lib/ext/assert.js @@ -1,4 +1,4 @@ -/*! +/* * Should * Copyright(c) 2010-2014 TJ Holowaychuk * MIT Licensed diff --git a/lib/ext/bool.js b/lib/ext/bool.js index 8282a24..de41a73 100644 --- a/lib/ext/bool.js +++ b/lib/ext/bool.js @@ -1,4 +1,4 @@ -/*! +/* * Should * Copyright(c) 2010-2014 TJ Holowaychuk * MIT Licensed diff --git a/lib/ext/contain.js b/lib/ext/contain.js index b10f49b..de8818c 100644 --- a/lib/ext/contain.js +++ b/lib/ext/contain.js @@ -1,4 +1,4 @@ -/*! +/* * Should * Copyright(c) 2010-2014 TJ Holowaychuk * MIT Licensed diff --git a/lib/ext/eql.js b/lib/ext/eql.js index e8de0cc..c02df4b 100644 --- a/lib/ext/eql.js +++ b/lib/ext/eql.js @@ -1,4 +1,4 @@ -/*! +/* * Should * Copyright(c) 2010-2014 TJ Holowaychuk * MIT Licensed diff --git a/lib/ext/error.js b/lib/ext/error.js index 73d737c..30acb35 100644 --- a/lib/ext/error.js +++ b/lib/ext/error.js @@ -1,4 +1,4 @@ -/*! +/* * Should * Copyright(c) 2010-2014 TJ Holowaychuk * MIT Licensed diff --git a/lib/ext/match.js b/lib/ext/match.js index ec610dd..49fa36b 100644 --- a/lib/ext/match.js +++ b/lib/ext/match.js @@ -1,4 +1,4 @@ -/*! +/* * Should * Copyright(c) 2010-2014 TJ Holowaychuk * MIT Licensed @@ -75,7 +75,7 @@ module.exports = function(should, Assertion) { if(matchedProps.length) this.params.operator += '\n matched properties: ' + matchedProps.join(', '); - this.assert(notMatchedProps.length == 0); + this.assert(notMatchedProps.length === 0); } // should we try to convert to String and exec? } else if(typeof other == 'function') { var res; @@ -112,7 +112,7 @@ module.exports = function(should, Assertion) { if(matchedProps.length) this.params.operator += '\n matched properties: ' + matchedProps.join(', '); - this.assert(notMatchedProps.length == 0); + this.assert(notMatchedProps.length === 0); } else { this.assert(false); } diff --git a/lib/ext/number.js b/lib/ext/number.js index 010e93f..3d6a8e6 100644 --- a/lib/ext/number.js +++ b/lib/ext/number.js @@ -1,4 +1,4 @@ -/*! +/* * Should * Copyright(c) 2010-2014 TJ Holowaychuk * MIT Licensed diff --git a/lib/ext/property.js b/lib/ext/property.js index 269ec23..5a28950 100644 --- a/lib/ext/property.js +++ b/lib/ext/property.js @@ -1,4 +1,4 @@ -/*! +/* * Should * Copyright(c) 2010-2014 TJ Holowaychuk * MIT Licensed diff --git a/lib/ext/string.js b/lib/ext/string.js index 88a2011..9bbb8b7 100644 --- a/lib/ext/string.js +++ b/lib/ext/string.js @@ -1,4 +1,4 @@ -/*! +/* * Should * Copyright(c) 2010-2014 TJ Holowaychuk * MIT Licensed diff --git a/lib/ext/type.js b/lib/ext/type.js index de44cac..3e87ef3 100644 --- a/lib/ext/type.js +++ b/lib/ext/type.js @@ -1,4 +1,4 @@ -/*! +/* * Should * Copyright(c) 2010-2014 TJ Holowaychuk * MIT Licensed diff --git a/lib/should.js b/lib/should.js index 35d0a13..93337d0 100644 --- a/lib/should.js +++ b/lib/should.js @@ -1,4 +1,4 @@ -/*! +/* * Should * Copyright(c) 2010-2014 TJ Holowaychuk * MIT Licensed diff --git a/lib/util.js b/lib/util.js index 0ffbbbe..a15e9fa 100644 --- a/lib/util.js +++ b/lib/util.js @@ -1,4 +1,4 @@ -/*! +/* * Should * Copyright(c) 2010-2014 TJ Holowaychuk * MIT Licensed diff --git a/package.json b/package.json index 89b4470..6347970 100644 --- a/package.json +++ b/package.json @@ -15,15 +15,15 @@ }, "devDependencies": { "browserify": "latest", + "eslint": "latest", "gulp": "^3.8.10", "gulp-header": "^1.2.2", - "gulp-load-plugins": "^0.5.1", "gulp-rename": "^1.2.0", "gulp-uglify": "^1.0.1", - "gulp-util": "^2.2.14", "mocha": "latest", "mocha-better-spec-reporter": "latest", - "vinyl-source-stream2": "^0.1.1", + "vinyl-buffer": "^1.0.0", + "vinyl-source-stream": "^1.1.0", "zuul": "latest" }, "keywords": [