Skip to content

Commit

Permalink
Fixed logger access bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jkphl committed Dec 29, 2014
1 parent d401480 commit 12f6ba7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
8 changes: 4 additions & 4 deletions lib/svg-sprite/mode/css.js
Expand Up @@ -384,20 +384,20 @@ SVGSpriteCss.prototype._buildCSSResources = function(files, cb) {
var tasks = [];

for (var extension in this.config.render) {
tasks.push(function(renderConfig, data, base, ext){
tasks.push(function(renderConfig, data, spriter, ext){
return function(_cb) {
var out = mustache.render(fs.readFileSync(renderConfig.template, 'utf-8'), data);
if (out.length) {
files[ext] = new File({
base : base,
base : spriter.config.dest,
path : renderConfig.dest,
contents : new Buffer(out)
});
this._spriter.verbose("Created «%s» stylesheet resource", ext);
spriter.verbose("Created «%s» stylesheet resource", ext);
}
_cb(null);
}
}(this.config.render[extension], this.data, this._spriter.config.dest, extension));
}(this.config.render[extension], this.data, this._spriter, extension));
}

async.parallelLimit(tasks, os.cpus().length * 2, cb);
Expand Down
13 changes: 6 additions & 7 deletions test/svg-sprite.js
Expand Up @@ -149,18 +149,17 @@ describe('svg-sprite', function() {
});

describe('with minimum configuration and ' + files.length + ' SVG files', function() {
var spriter = null,
data = null,
svg = {},
previewTemplate = fs.readFileSync(path.join(__dirname, 'tmpl', 'css.html'), 'utf-8');
var spriter = null,
data = null,
svg = {},
previewTemplate = fs.readFileSync(path.join(__dirname, 'tmpl', 'css.html'), 'utf-8');

describe('in «css» mode and all render types enabled', function() {

it('creates 5 files for vertical layout', function(done) {
this.timeout(20000);
spriter = new SVGSpriter({
dest : dest,
verbose : 0
spriter = new SVGSpriter({
dest : dest
});
addFixtureFiles(spriter, files);
spriter.compile({
Expand Down

0 comments on commit 12f6ba7

Please sign in to comment.