Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bef75f8

Browse files
author
deepsweet
committed
Merge branch 'dev'
2 parents cb0ec95 + 8a6b0bf commit bef75f8

File tree

7 files changed

+30
-16
lines changed

7 files changed

+30
-16
lines changed

.jshintrc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,5 @@
2020
"undef": true,
2121
"unused": true,
2222
"loopfunc": true,
23-
"trailing": true,
24-
"es5": true
23+
"trailing": true
2524
}

.travis.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,3 @@ matrix:
1313
branches:
1414
only:
1515
- master
16-
17-
script: make travis

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
2+
### [ [>](https://github.com/svg/svgo/tree/v0.3.6) ] 0.3.6 / 06.06.2013
3+
* plugins/removeNonInheritableGroupAttrs: more attrs groups to exclude (fix [#116](https://github.com/svg/svgo/issues/116) & [#118](https://github.com/svg/svgo/issues/118))
4+
* lib/coa: optimize folder file by file (temp fix #114](https://github.com/svg/svgo/issues/114))
5+
* `.jshintrc`: JSHint 2.0
6+
* temporarily disable node-coveralls
7+
18
### [ [>](https://github.com/svg/svgo/tree/v0.3.5) ] 0.3.5 / 07.05.2013
29
* plugins/transformsWithOnePath: fix curves bounding box calculation
310
* plugins/transformsWithOnePath: fix possible c+t or q+s bug

lib/svgo/coa.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -364,10 +364,12 @@ function optimizeFolder(path, config) {
364364
throw err;
365365
}
366366

367-
files.forEach(function(filename) {
367+
var i = 0;
368+
369+
function optimizeFile(file) {
368370

369371
// absoluted file path
370-
var filepath = PATH.resolve(path, filename);
372+
var filepath = PATH.resolve(path, file);
371373

372374
// check if file name matches *.svg
373375
if (regSVGFile.test(filepath)) {
@@ -395,14 +397,18 @@ function optimizeFolder(path, config) {
395397

396398
FS.writeFile(filepath, result.data, 'utf8', function() {
397399

398-
UTIL.puts(filename + ':');
400+
UTIL.puts(file + ':');
399401

400402
// print time info
401403
printTimeInfo(time);
402404

403405
// print optimization profit info
404406
printProfitInfo(inBytes, outBytes);
405407

408+
if (++i < files.length) {
409+
optimizeFile(files[i]);
410+
}
411+
406412
});
407413

408414
});
@@ -411,7 +417,9 @@ function optimizeFolder(path, config) {
411417

412418
}
413419

414-
});
420+
}
421+
422+
optimizeFile(files[i]);
415423

416424
});
417425

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "svgo",
3-
"version": "0.3.5",
3+
"version": "0.3.6",
44
"description": "Nodejs-based tool for optimizing SVG vector graphics files",
55
"keywords": [ "svgo", "svg", "optimize", "minify" ],
66
"homepage": "http://svg.github.com/svgo/",
@@ -45,8 +45,7 @@
4545
"mocha": "~1.9.0",
4646
"should": "~1.2.0",
4747
"istanbul": "~0.1.0",
48-
"mocha-istanbul": "",
49-
"coveralls": ""
48+
"mocha-istanbul": ""
5049
},
5150
"engines": {
5251
"node": ">=0.6.0"

plugins/removeNonInheritableGroupAttrs.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ exports.type = 'perItem';
55
exports.active = true;
66

77
var inheritableAttrs = require('./_collections').inheritableAttrs,
8-
presentationAttrs = require('./_collections').attrsGroups.presentation,
8+
attrsGroups = require('./_collections').attrsGroups,
99
excludedAttrs = ['display', 'opacity'];
1010

1111
/**
@@ -22,9 +22,12 @@ exports.fn = function(item) {
2222

2323
item.eachAttr(function(attr) {
2424
if (
25-
presentationAttrs.indexOf(attr.name) !== -1 &&
26-
excludedAttrs.indexOf(attr.name) === -1 &&
27-
inheritableAttrs.indexOf(attr.name) === -1
25+
~attrsGroups.presentation.indexOf(attr.name) &&
26+
~attrsGroups.graphicalEvent.indexOf(attr.name) &&
27+
~attrsGroups.core.indexOf(attr.name) &&
28+
~attrsGroups.conditionalProcessing.indexOf(attr.name) &&
29+
!~excludedAttrs.indexOf(attr.name) &&
30+
!~inheritableAttrs.indexOf(attr.name)
2831
) {
2932
item.removeAttr(attr.name);
3033
}

test/plugins/removeNonInheritableGroupAttrs.01.svg

Lines changed: 1 addition & 1 deletion
Loading

0 commit comments

Comments
 (0)