Skip to content

Commit

Permalink
spritesmith オプションを反映するように修正
Browse files Browse the repository at this point in the history
  • Loading branch information
syuji higa authored and syuji higa committed Oct 16, 2015
1 parent dc7a217 commit a8a5e3f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/gulp-stylus-sprites.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ module.exports = function(opts) {
if (!isChanged) {
return;
}
return spritesmith({
return spritesmith(merge({
src: srcImageFilenames
}, (function(_this) {
}, spritesmithOpts), (function(_this) {
return function(err, result) {
var fileRootPath, imageFile;
if (err != null) {
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gulp-stylus-sprites",
"version": "0.0.26",
"version": "0.0.27",
"description": "gulp stylus sprite",
"keywords": [
"gulpplugin",
Expand Down Expand Up @@ -34,6 +34,7 @@
"gulp-mocha": "^1.1.1",
"gulp-replace": "^0.4.0",
"mocha": "^1.21.4",
"should": "^4.0.4"
"should": "^4.0.4",
"spritesmith": "^0.20.1"
}
}
3 changes: 2 additions & 1 deletion src/gulp-stylus-sprites.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ module.exports = (opts = {}) ->

return unless isChanged

spritesmith { src: srcImageFilenames }, (err, result) =>
spritesmith merge({ src: srcImageFilenames }, spritesmithOpts), (err, result) =>

throw new PluginError PLUGIN_NAME, err if err?

fileRootPath = relative imgSrcBase, "#{dirGroup}.png"
Expand Down
Binary file modified test/fixtures/htdocs/images/circle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions test/test.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ describe 'gulp-stylus-sprite', ->
isGetAllData = false
stream = stylusSprites
imgSrcBase: resolve __dirname, 'fixtures/sprite'
spritesmithOpts:
engine: 'pngsmith'
stream.on 'data', (file) ->
switch extname file.path
when '.png'
Expand All @@ -41,6 +43,8 @@ describe 'gulp-stylus-sprite', ->
stream = stylusSprites
imgSrcBase: resolve __dirname, 'fixtures/sprite'
stylusFileName: 'test'
spritesmithOpts:
engine: 'pngsmith'
stream.on 'data', (file) ->
switch extname file.path
when '.png'
Expand Down

0 comments on commit a8a5e3f

Please sign in to comment.