Permalink
Browse files

Merge branch 'dev'

  • Loading branch information...
2 parents cb0ec95 + 8a6b0bf commit bef75f8df31421e8903ce31fd92ffc892c588e54 @deepsweet deepsweet committed Jun 6, 2013
Showing with 30 additions and 16 deletions.
  1. +1 −2 .jshintrc
  2. +0 −2 .travis.yml
  3. +7 −0 CHANGELOG.md
  4. +12 −4 lib/svgo/coa.js
  5. +2 −3 package.json
  6. +7 −4 plugins/removeNonInheritableGroupAttrs.js
  7. +1 −1 test/plugins/removeNonInheritableGroupAttrs.01.svg
View
@@ -20,6 +20,5 @@
"undef": true,
"unused": true,
"loopfunc": true,
- "trailing": true,
- "es5": true
+ "trailing": true
}
View
@@ -13,5 +13,3 @@ matrix:
branches:
only:
- master
-
-script: make travis
View
@@ -1,3 +1,10 @@
+
+### [ [>](https://github.com/svg/svgo/tree/v0.3.6) ] 0.3.6 / 06.06.2013
+* plugins/removeNonInheritableGroupAttrs: more attrs groups to exclude (fix [#116](https://github.com/svg/svgo/issues/116) & [#118](https://github.com/svg/svgo/issues/118))
+* lib/coa: optimize folder file by file (temp fix #114](https://github.com/svg/svgo/issues/114))
+* `.jshintrc`: JSHint 2.0
+* temporarily disable node-coveralls
+
### [ [>](https://github.com/svg/svgo/tree/v0.3.5) ] 0.3.5 / 07.05.2013
* plugins/transformsWithOnePath: fix curves bounding box calculation
* plugins/transformsWithOnePath: fix possible c+t or q+s bug
View
@@ -364,10 +364,12 @@ function optimizeFolder(path, config) {
throw err;
}
- files.forEach(function(filename) {
+ var i = 0;
+
+ function optimizeFile(file) {
// absoluted file path
- var filepath = PATH.resolve(path, filename);
+ var filepath = PATH.resolve(path, file);
// check if file name matches *.svg
if (regSVGFile.test(filepath)) {
@@ -395,14 +397,18 @@ function optimizeFolder(path, config) {
FS.writeFile(filepath, result.data, 'utf8', function() {
- UTIL.puts(filename + ':');
+ UTIL.puts(file + ':');
// print time info
printTimeInfo(time);
// print optimization profit info
printProfitInfo(inBytes, outBytes);
+ if (++i < files.length) {
+ optimizeFile(files[i]);
+ }
+
});
});
@@ -411,7 +417,9 @@ function optimizeFolder(path, config) {
}
- });
+ }
+
+ optimizeFile(files[i]);
});
View
@@ -1,6 +1,6 @@
{
"name": "svgo",
- "version": "0.3.5",
+ "version": "0.3.6",
"description": "Nodejs-based tool for optimizing SVG vector graphics files",
"keywords": [ "svgo", "svg", "optimize", "minify" ],
"homepage": "http://svg.github.com/svgo/",
@@ -45,8 +45,7 @@
"mocha": "~1.9.0",
"should": "~1.2.0",
"istanbul": "~0.1.0",
- "mocha-istanbul": "",
- "coveralls": ""
+ "mocha-istanbul": ""
},
"engines": {
"node": ">=0.6.0"
@@ -5,7 +5,7 @@ exports.type = 'perItem';
exports.active = true;
var inheritableAttrs = require('./_collections').inheritableAttrs,
- presentationAttrs = require('./_collections').attrsGroups.presentation,
+ attrsGroups = require('./_collections').attrsGroups,
excludedAttrs = ['display', 'opacity'];
/**
@@ -22,9 +22,12 @@ exports.fn = function(item) {
item.eachAttr(function(attr) {
if (
- presentationAttrs.indexOf(attr.name) !== -1 &&
- excludedAttrs.indexOf(attr.name) === -1 &&
- inheritableAttrs.indexOf(attr.name) === -1
+ ~attrsGroups.presentation.indexOf(attr.name) &&
+ ~attrsGroups.graphicalEvent.indexOf(attr.name) &&
+ ~attrsGroups.core.indexOf(attr.name) &&
+ ~attrsGroups.conditionalProcessing.indexOf(attr.name) &&
+ !~excludedAttrs.indexOf(attr.name) &&
+ !~inheritableAttrs.indexOf(attr.name)
) {
item.removeAttr(attr.name);
}
@@ -7,7 +7,7 @@
@@@
<svg xmlns="http://www.w3.org/2000/svg">
- <g class="test" transform="rotate(45)" display="none" opacity="0.5" visibility="visible">
+ <g class="test" clip-path="url(#clip1)" transform="rotate(45)" display="none" opacity="0.5" visibility="visible">
<path d="M0 0 L 10 20"/>
</g>
</svg>

0 comments on commit bef75f8

Please sign in to comment.