gulp.spritesmith
Advanced tools
Comparing version 1.4.1 to 1.5.0
# gulp.spritesmith changelog | ||
1.5.0 - Added `twolfson-style` and fixed up lint errors | ||
1.4.1 - Updated `gittip` to `gratipay` | ||
@@ -3,0 +5,0 @@ |
@@ -17,13 +17,13 @@ // Load our dependencies | ||
ExtFormat.prototype = { | ||
'add': function (name, val) { | ||
add: function (name, val) { | ||
this.formatObj[name] = val; | ||
}, | ||
'get': function (filepath) { | ||
get: function (filepath) { | ||
// Grab the extension from the filepath | ||
var ext = path.extname(filepath), | ||
lowerExt = ext.toLowerCase(); | ||
var ext = path.extname(filepath); | ||
var lowerExt = ext.toLowerCase(); | ||
// Look up the file extenion from our format object | ||
var formatObj = this.formatObj, | ||
format = formatObj[lowerExt]; | ||
var formatObj = this.formatObj; | ||
var format = formatObj[lowerExt]; | ||
return format; | ||
@@ -94,13 +94,13 @@ } | ||
// Set up the defautls for imgOpts | ||
imgOpts = _.defaults({}, imgOpts, {'format': imgFormat}); | ||
imgOpts = _.defaults({}, imgOpts, {format: imgFormat}); | ||
// Run through spritesmith | ||
var spritesmithParams = { | ||
'src': images, | ||
'engine': params.engine || 'auto', | ||
'algorithm': params.algorithm || 'top-down', | ||
'padding': params.padding || 0, | ||
'algorithmOpts': params.algorithmOpts || {}, | ||
'engineOpts': params.engineOpts || {}, | ||
'exportOpts': imgOpts | ||
src: images, | ||
engine: params.engine || 'auto', | ||
algorithm: params.algorithm || 'top-down', | ||
padding: params.padding || 0, | ||
algorithmOpts: params.algorithmOpts || {}, | ||
engineOpts: params.engineOpts || {}, | ||
exportOpts: imgOpts | ||
}; | ||
@@ -174,3 +174,3 @@ var that = this; | ||
var cssStr = json2css(cleanCoords, {'format': cssFormat, 'formatOpts': params.cssOpts || {}}); | ||
var cssStr = json2css(cleanCoords, {format: cssFormat, formatOpts: params.cssOpts || {}}); | ||
// END OF BARELY MODIFIED SECTION FROM grunt-spritesmith@1.22.0 | ||
@@ -177,0 +177,0 @@ |
{ | ||
"name": "gulp.spritesmith", | ||
"description": "Convert a set of images into a spritesheet and CSS variables via gulp", | ||
"version": "1.4.1", | ||
"version": "1.5.0", | ||
"homepage": "https://github.com/twolfson/gulp.spritesmith", | ||
@@ -29,3 +29,6 @@ "author": { | ||
"scripts": { | ||
"test": "cd test && mocha . --timeout 60000" | ||
"precheck": "twolfson-style precheck docs/ lib/ test/", | ||
"lint": "twolfson-style lint docs/ lib/ test/", | ||
"pretest": "twolfson-style install", | ||
"test": "npm run precheck && cd test && mocha . --timeout 60000 && cd .. && npm run lint" | ||
}, | ||
@@ -44,6 +47,8 @@ "dependencies": { | ||
"gulp-imagemin": "~1.0.1", | ||
"gulp-jshint": "~1.4.0", | ||
"jscs": "~1.8.1", | ||
"jshint": "~2.5.10", | ||
"mocha": "~1.11.0", | ||
"pngparse": "~2.0.1", | ||
"rimraf": "~2.2.6" | ||
"rimraf": "~2.2.6", | ||
"twolfson-style": "~1.6.0" | ||
}, | ||
@@ -50,0 +55,0 @@ "keywords": [ |
@@ -363,3 +363,3 @@ # gulp.spritesmith [![Build status](https://travis-ci.org/twolfson/gulp.spritesmith.png?branch=master)](https://travis-ci.org/twolfson/gulp.spritesmith) | ||
## Contributing | ||
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint via `gulp` and test via `npm test`. | ||
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint via `npm run lint` and test via `npm test`. | ||
@@ -366,0 +366,0 @@ ## Attribution |
@@ -21,3 +21,3 @@ // Load in dependencies | ||
gulp.task('sprite-two-streams', function () { | ||
data = gulp.src(images).pipe(spritesmith({ | ||
var data = gulp.src(images).pipe(spritesmith({ | ||
imgName: 'sprite.png', | ||
@@ -74,5 +74,5 @@ cssName: 'sprite.css' | ||
imgName: 'sprite.png', | ||
cssName: 'sprite.scss', | ||
cssName: 'sprite.scss' | ||
})) | ||
.pipe(gulp.dest('actual-files/empty/')); | ||
}); |
@@ -0,5 +1,7 @@ | ||
// Load in dependencies | ||
var exec = require('child_process').exec; | ||
// Define our execution helper | ||
exports.run = function (cmd) { | ||
before(function (done) { | ||
before(function runFn (done) { | ||
exec(cmd, function (err, stdout, stderr) { | ||
@@ -12,2 +14,2 @@ if (!err && stderr) { | ||
}); | ||
}; | ||
}; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
249726
42
9
518