svgo 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.MD +20 -17
- data/bin/svgo-ruby +2 -3
- data/lib/svgo.rb +0 -2
- data/lib/version.rb +1 -1
- data/svgo-js/svgo-built.js +160 -33
- data/svgo-js/svgo-wrapper.js +4 -3
- data/svgo.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e4b4f58ca387e882c969739c3a7eb34033e3a437
|
|
4
|
+
data.tar.gz: 845dc991d02d9c670d0cf1e193553d85e87d2e9d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a9e701c7e89508e1a111785bbccadb62c2580955aeef958154dffed7a19c5ccd4a77b93fe9aed3afe472d18284b42af87d5cbbaa254efacc031882cc8fdb8825
|
|
7
|
+
data.tar.gz: 1d5ba9c255b78e6eceed95281b95dd2f6bb7c08df9301ce3301e8dba5febb268a1439e6d631898b4b087bccffb81831780117e43aa9f858e38298985c0129a23
|
data/README.MD
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
[](https://badge.fury.io/rb/svgo)
|
|
2
|
+
[](https://github.com/greenhost/svgo-ruby/blob/master/LICENSE.txt)
|
|
3
|
+
|
|
1
4
|
# A Ruby wrapper for Node SVGO
|
|
2
5
|
|
|
3
6
|
Removes metadata and editor data elements and attributes that are redundant
|
|
4
|
-
from SVG files. Can strip files so they are optimised for web use. Go to
|
|
7
|
+
from SVG files. Can strip files so they are optimised for web use. Go to
|
|
5
8
|
[SVGO](https://github.com/svg/svgo) for more documentation on features.
|
|
6
9
|
|
|
7
10
|
## How to use?
|
|
@@ -29,7 +32,7 @@ svgo.optimize(File.read(svg_file))
|
|
|
29
32
|
|
|
30
33
|
#### Method 2
|
|
31
34
|
|
|
32
|
-
You can manually pass options to the class that correspond to
|
|
35
|
+
You can manually pass options to the class that correspond to
|
|
33
36
|
[SVGO](https://github.com/svg/svgo)'s documentation.
|
|
34
37
|
|
|
35
38
|
```ruby
|
|
@@ -52,7 +55,7 @@ svgo.optimize_file(svg_file)
|
|
|
52
55
|
# => <svg xmlns="http://www.w3.org/2000/svg" ...
|
|
53
56
|
```
|
|
54
57
|
|
|
55
|
-
You can also choose the plugins to use, you can either pass the exact plugins
|
|
58
|
+
You can also choose the plugins to use, you can either pass the exact plugins
|
|
56
59
|
you want with their configuration, or you can modify the default plugin list.
|
|
57
60
|
|
|
58
61
|
```ruby
|
|
@@ -76,7 +79,7 @@ svgo = SvgOptimizer.new(options)
|
|
|
76
79
|
|
|
77
80
|
### As a CLI tool
|
|
78
81
|
|
|
79
|
-
Strictly speaking this mode is for testing only. But if you can't install
|
|
82
|
+
Strictly speaking this mode is for testing only. But if you can't install
|
|
80
83
|
NodeJS, and you do have a Ruby environment and you really need a CLI tool, you
|
|
81
84
|
might be able to squeeze out some optimised files from this utility.
|
|
82
85
|
|
|
@@ -106,39 +109,39 @@ docker run -i svgo < test/fixtures/ruby.svg > test/fixtures/ruby.optim.svg
|
|
|
106
109
|
|
|
107
110
|
## How this works
|
|
108
111
|
|
|
109
|
-
[`execjs`](https://github.com/rails/execjs) is used to run the Node SVGO as a
|
|
112
|
+
[`execjs`](https://github.com/rails/execjs) is used to run the Node SVGO as a
|
|
110
113
|
library. The SVGO library returns a JavaScript Promise, which is currently not
|
|
111
114
|
supported by `execjs` and probably never will be. `setTimeout` and sleep-like
|
|
112
115
|
functions are also disabled in `execjs` so we can't wait for the Promise to get
|
|
113
|
-
fulfilled. Therefore there is a small wrapper JavaScript in this repository
|
|
114
|
-
that calls all the components that SVGO is made up of, but without the
|
|
116
|
+
fulfilled. Therefore there is a small wrapper JavaScript in this repository
|
|
117
|
+
that calls all the components that SVGO is made up of, but without the
|
|
115
118
|
`Promise`. It also wraps up the configuration of plugins the way it is expected
|
|
116
|
-
by SVGO's components. Lastly `require` is not supported by `execjs` so all of
|
|
117
|
-
this is transpiled to one monolithic JavaScript file - that is completely
|
|
119
|
+
by SVGO's components. Lastly `require` is not supported by `execjs` so all of
|
|
120
|
+
this is transpiled to one monolithic JavaScript file - that is completely
|
|
118
121
|
self-contained, using [browserify](http://browserify.org/).
|
|
119
122
|
|
|
120
|
-
__NOTE:__ `execjs` supports a variety of JavaSript runtimes, notably
|
|
123
|
+
__NOTE:__ `execjs` supports a variety of JavaSript runtimes, notably
|
|
121
124
|
[`therubyracer`](https://github.com/cowboyd/therubyracer), but `therubyracer`
|
|
122
|
-
depends on an ancient [`libv8`](https://github.com/cowboyd/libv8), which
|
|
125
|
+
depends on an ancient [`libv8`](https://github.com/cowboyd/libv8), which
|
|
123
126
|
doesn't support some of the modern syntax used in SVGO. Therefore `mini_racer`
|
|
124
127
|
(a drop in replacement for `therubyracer`) is a dependency, which uses a much
|
|
125
128
|
more recent `libv8`.
|
|
126
129
|
|
|
127
|
-
If you have [Node](https://nodejs.org/) installed you could also use that as a
|
|
128
|
-
runtime.
|
|
130
|
+
If you have [Node](https://nodejs.org/) installed you could also use that as a
|
|
131
|
+
runtime.
|
|
129
132
|
|
|
130
|
-
### Transpiling Node SVGO
|
|
133
|
+
### Transpiling Node SVGO
|
|
131
134
|
|
|
132
135
|
__TL;DR:__ A transpiled version of SVGO is included in the repository, so you
|
|
133
136
|
don't need to transpile anything.
|
|
134
137
|
|
|
135
|
-
Because `execjs` supports only self-contained modules, and does not allow
|
|
138
|
+
Because `execjs` supports only self-contained modules, and does not allow
|
|
136
139
|
`require()`, `Promise` etc.. The SGVO library is wrapped in a JavaScript that
|
|
137
|
-
requires all the main parts of SVGO and makes an SVGO function without
|
|
140
|
+
requires all the main parts of SVGO and makes an SVGO function without
|
|
138
141
|
JavaScript Promises. The wrapper is then transpiled to a self-contained module
|
|
139
142
|
using [browserify](http://browserify.org/).
|
|
140
143
|
|
|
141
|
-
The transpile command can be found in the `Rakefile`. Assuming you have
|
|
144
|
+
The transpile command can be found in the `Rakefile`. Assuming you have
|
|
142
145
|
[Node](https://nodejs.org/) and [yarn](https://yarnpkg.com/en/) installed on
|
|
143
146
|
your system, you can then run:
|
|
144
147
|
|
data/bin/svgo-ruby
CHANGED
|
@@ -152,7 +152,7 @@ parser = OptionParser.new do |opts|
|
|
|
152
152
|
options.plugins[p.to_sym] = state
|
|
153
153
|
end
|
|
154
154
|
end
|
|
155
|
-
opts.on("--removeAttrs", String, %q(
|
|
155
|
+
opts.on("--removeAttrs [attrs]", String, %q(
|
|
156
156
|
A comma separated list of Javascript compatible regular expressions.
|
|
157
157
|
The format described in the plugin:
|
|
158
158
|
|
|
@@ -182,12 +182,11 @@ parser = OptionParser.new do |opts|
|
|
|
182
182
|
https://github.com/svg/svgo/blob/master/plugins/removeAttrs.js
|
|
183
183
|
).sub(/^\n\s+/,'').gsub(/ {4}/, " " * 12)) do |plugin_args|
|
|
184
184
|
patterns = plugin_args.sub(/\s*,\s*/, ",").split(",")
|
|
185
|
-
options.plugins
|
|
185
|
+
options.plugins[:removeAttrs] = {attrs: patterns}
|
|
186
186
|
end
|
|
187
187
|
end
|
|
188
188
|
|
|
189
189
|
parser.parse!
|
|
190
|
-
|
|
191
190
|
svgo = SvgOptimizer.new(options)
|
|
192
191
|
|
|
193
192
|
# Read from stdin..
|
data/lib/svgo.rb
CHANGED
|
@@ -123,8 +123,6 @@ class SvgOptimizer
|
|
|
123
123
|
# therubyracer is a first choice for execjs but its libv8 is too
|
|
124
124
|
# old for the svgo library and its dependencies.
|
|
125
125
|
runtimes = [
|
|
126
|
-
# MacOS only system component
|
|
127
|
-
ExecJS::Runtimes::JavaScriptCore,
|
|
128
126
|
ExecJS::Runtimes::MiniRacer,
|
|
129
127
|
ExecJS::Runtimes::Node
|
|
130
128
|
]
|
data/lib/version.rb
CHANGED
data/svgo-js/svgo-built.js
CHANGED
|
@@ -28934,7 +28934,7 @@ Writable.prototype._destroy = function (err, cb) {
|
|
|
28934
28934
|
cb(err);
|
|
28935
28935
|
};
|
|
28936
28936
|
}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("timers").setImmediate)
|
|
28937
|
-
},{"./_stream_duplex":359,"./internal/streams/destroy":365,"./internal/streams/stream":366,"_process":357,"core-util-is":6,"inherits":309,"process-nextick-args":356,"safe-buffer":372,"timers":
|
|
28937
|
+
},{"./_stream_duplex":359,"./internal/streams/destroy":365,"./internal/streams/stream":366,"_process":357,"core-util-is":6,"inherits":309,"process-nextick-args":356,"safe-buffer":372,"timers":445,"util-deprecate":447}],364:[function(require,module,exports){
|
|
28938
28938
|
'use strict';
|
|
28939
28939
|
|
|
28940
28940
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
@@ -43669,7 +43669,133 @@ exports.fn = function(node, opts, extra) {
|
|
|
43669
43669
|
return node;
|
|
43670
43670
|
};
|
|
43671
43671
|
|
|
43672
|
-
},{"./_collections.js":398,"css-tree":19,"css-url-regex":119,"path":355,"unquote":
|
|
43672
|
+
},{"./_collections.js":398,"css-tree":19,"css-url-regex":119,"path":355,"unquote":446}],420:[function(require,module,exports){
|
|
43673
|
+
'use strict';
|
|
43674
|
+
|
|
43675
|
+
var DEFAULT_SEPARATOR = ':';
|
|
43676
|
+
|
|
43677
|
+
exports.type = 'perItem';
|
|
43678
|
+
|
|
43679
|
+
exports.active = false;
|
|
43680
|
+
|
|
43681
|
+
exports.description = 'removes specified attributes';
|
|
43682
|
+
|
|
43683
|
+
exports.params = {
|
|
43684
|
+
elemSeparator: DEFAULT_SEPARATOR,
|
|
43685
|
+
attrs: []
|
|
43686
|
+
};
|
|
43687
|
+
|
|
43688
|
+
/**
|
|
43689
|
+
* Remove attributes
|
|
43690
|
+
*
|
|
43691
|
+
* @param elemSeparator
|
|
43692
|
+
* format: string
|
|
43693
|
+
*
|
|
43694
|
+
* @param attrs:
|
|
43695
|
+
*
|
|
43696
|
+
* format: [ element* : attribute* ]
|
|
43697
|
+
*
|
|
43698
|
+
* element : regexp (wrapped into ^...$), single * or omitted > all elements
|
|
43699
|
+
* attribute : regexp (wrapped into ^...$)
|
|
43700
|
+
*
|
|
43701
|
+
* examples:
|
|
43702
|
+
*
|
|
43703
|
+
* > basic: remove fill attribute
|
|
43704
|
+
* ---
|
|
43705
|
+
* removeAttrs:
|
|
43706
|
+
* attrs: 'fill'
|
|
43707
|
+
*
|
|
43708
|
+
* > remove fill attribute on path element
|
|
43709
|
+
* ---
|
|
43710
|
+
* attrs: 'path:fill'
|
|
43711
|
+
*
|
|
43712
|
+
*
|
|
43713
|
+
* > remove all fill and stroke attribute
|
|
43714
|
+
* ---
|
|
43715
|
+
* attrs:
|
|
43716
|
+
* - 'fill'
|
|
43717
|
+
* - 'stroke'
|
|
43718
|
+
*
|
|
43719
|
+
* [is same as]
|
|
43720
|
+
*
|
|
43721
|
+
* attrs: '(fill|stroke)'
|
|
43722
|
+
*
|
|
43723
|
+
* [is same as]
|
|
43724
|
+
*
|
|
43725
|
+
* attrs: '*:(fill|stroke)'
|
|
43726
|
+
*
|
|
43727
|
+
* [is same as]
|
|
43728
|
+
*
|
|
43729
|
+
* attrs: '.*:(fill|stroke)'
|
|
43730
|
+
*
|
|
43731
|
+
*
|
|
43732
|
+
* > remove all stroke related attributes
|
|
43733
|
+
* ----
|
|
43734
|
+
* attrs: 'stroke.*'
|
|
43735
|
+
*
|
|
43736
|
+
*
|
|
43737
|
+
* @param {Object} item current iteration item
|
|
43738
|
+
* @param {Object} params plugin params
|
|
43739
|
+
* @return {Boolean} if false, item will be filtered out
|
|
43740
|
+
*
|
|
43741
|
+
* @author Benny Schudel
|
|
43742
|
+
*/
|
|
43743
|
+
exports.fn = function(item, params) {
|
|
43744
|
+
|
|
43745
|
+
// wrap into an array if params is not
|
|
43746
|
+
if (!Array.isArray(params.attrs)) {
|
|
43747
|
+
params.attrs = [params.attrs];
|
|
43748
|
+
}
|
|
43749
|
+
|
|
43750
|
+
if (item.isElem()) {
|
|
43751
|
+
var elemSeparator = typeof params.elemSeparator == 'string' ? params.elemSeparator : DEFAULT_SEPARATOR;
|
|
43752
|
+
|
|
43753
|
+
// prepare patterns
|
|
43754
|
+
var patterns = params.attrs.map(function(pattern) {
|
|
43755
|
+
|
|
43756
|
+
// apply to all elements if specifc element is omitted
|
|
43757
|
+
if (pattern.indexOf(elemSeparator) === -1) {
|
|
43758
|
+
pattern = ['.*', elemSeparator, pattern].join('');
|
|
43759
|
+
}
|
|
43760
|
+
|
|
43761
|
+
// create regexps for element and attribute name
|
|
43762
|
+
return pattern.split(elemSeparator)
|
|
43763
|
+
.map(function(value) {
|
|
43764
|
+
|
|
43765
|
+
// adjust single * to match anything
|
|
43766
|
+
if (value === '*') { value = '.*'; }
|
|
43767
|
+
|
|
43768
|
+
return new RegExp(['^', value, '$'].join(''), 'i');
|
|
43769
|
+
});
|
|
43770
|
+
|
|
43771
|
+
});
|
|
43772
|
+
|
|
43773
|
+
// loop patterns
|
|
43774
|
+
patterns.forEach(function(pattern) {
|
|
43775
|
+
|
|
43776
|
+
// matches element
|
|
43777
|
+
if (pattern[0].test(item.elem)) {
|
|
43778
|
+
|
|
43779
|
+
// loop attributes
|
|
43780
|
+
item.eachAttr(function(attr) {
|
|
43781
|
+
var name = attr.name;
|
|
43782
|
+
|
|
43783
|
+
// matches attribute name
|
|
43784
|
+
if (pattern[1].test(name)) {
|
|
43785
|
+
item.removeAttr(name);
|
|
43786
|
+
}
|
|
43787
|
+
|
|
43788
|
+
});
|
|
43789
|
+
|
|
43790
|
+
}
|
|
43791
|
+
|
|
43792
|
+
});
|
|
43793
|
+
|
|
43794
|
+
}
|
|
43795
|
+
|
|
43796
|
+
};
|
|
43797
|
+
|
|
43798
|
+
},{}],421:[function(require,module,exports){
|
|
43673
43799
|
'use strict';
|
|
43674
43800
|
|
|
43675
43801
|
exports.type = 'perItem';
|
|
@@ -43698,7 +43824,7 @@ exports.fn = function(item) {
|
|
|
43698
43824
|
|
|
43699
43825
|
};
|
|
43700
43826
|
|
|
43701
|
-
},{}],
|
|
43827
|
+
},{}],422:[function(require,module,exports){
|
|
43702
43828
|
'use strict';
|
|
43703
43829
|
|
|
43704
43830
|
exports.type = 'perItem';
|
|
@@ -43732,7 +43858,7 @@ exports.fn = function(item, params) {
|
|
|
43732
43858
|
|
|
43733
43859
|
};
|
|
43734
43860
|
|
|
43735
|
-
},{}],
|
|
43861
|
+
},{}],423:[function(require,module,exports){
|
|
43736
43862
|
'use strict';
|
|
43737
43863
|
|
|
43738
43864
|
exports.type = 'perItem';
|
|
@@ -43766,7 +43892,7 @@ exports.fn = function(item) {
|
|
|
43766
43892
|
|
|
43767
43893
|
};
|
|
43768
43894
|
|
|
43769
|
-
},{}],
|
|
43895
|
+
},{}],424:[function(require,module,exports){
|
|
43770
43896
|
'use strict';
|
|
43771
43897
|
|
|
43772
43898
|
exports.type = 'perItem';
|
|
@@ -43808,7 +43934,7 @@ exports.fn = function(item) {
|
|
|
43808
43934
|
|
|
43809
43935
|
};
|
|
43810
43936
|
|
|
43811
|
-
},{}],
|
|
43937
|
+
},{}],425:[function(require,module,exports){
|
|
43812
43938
|
'use strict';
|
|
43813
43939
|
|
|
43814
43940
|
exports.type = 'perItem';
|
|
@@ -43875,7 +44001,7 @@ exports.fn = function(item, params) {
|
|
|
43875
44001
|
|
|
43876
44002
|
};
|
|
43877
44003
|
|
|
43878
|
-
},{"./_collections":398}],
|
|
44004
|
+
},{"./_collections":398}],426:[function(require,module,exports){
|
|
43879
44005
|
'use strict';
|
|
43880
44006
|
|
|
43881
44007
|
exports.type = 'perItem';
|
|
@@ -43957,7 +44083,7 @@ exports.fn = function(item, params) {
|
|
|
43957
44083
|
}
|
|
43958
44084
|
};
|
|
43959
44085
|
|
|
43960
|
-
},{}],
|
|
44086
|
+
},{}],427:[function(require,module,exports){
|
|
43961
44087
|
'use strict';
|
|
43962
44088
|
|
|
43963
44089
|
exports.type = 'perItem';
|
|
@@ -43988,7 +44114,7 @@ exports.fn = function(item) {
|
|
|
43988
44114
|
|
|
43989
44115
|
};
|
|
43990
44116
|
|
|
43991
|
-
},{}],
|
|
44117
|
+
},{}],428:[function(require,module,exports){
|
|
43992
44118
|
'use strict';
|
|
43993
44119
|
|
|
43994
44120
|
exports.type = 'perItemReverse';
|
|
@@ -44022,7 +44148,7 @@ exports.fn = function(item) {
|
|
|
44022
44148
|
|
|
44023
44149
|
};
|
|
44024
44150
|
|
|
44025
|
-
},{"./_collections":398}],
|
|
44151
|
+
},{"./_collections":398}],429:[function(require,module,exports){
|
|
44026
44152
|
'use strict';
|
|
44027
44153
|
|
|
44028
44154
|
exports.type = 'perItem';
|
|
@@ -44083,7 +44209,7 @@ exports.fn = function(item, params) {
|
|
|
44083
44209
|
|
|
44084
44210
|
};
|
|
44085
44211
|
|
|
44086
|
-
},{}],
|
|
44212
|
+
},{}],430:[function(require,module,exports){
|
|
44087
44213
|
'use strict';
|
|
44088
44214
|
|
|
44089
44215
|
exports.type = 'perItem';
|
|
@@ -44310,7 +44436,7 @@ exports.fn = function (item, params) {
|
|
|
44310
44436
|
|
|
44311
44437
|
};
|
|
44312
44438
|
|
|
44313
|
-
},{}],
|
|
44439
|
+
},{}],431:[function(require,module,exports){
|
|
44314
44440
|
'use strict';
|
|
44315
44441
|
|
|
44316
44442
|
exports.type = 'perItem';
|
|
@@ -44335,7 +44461,7 @@ exports.fn = function(item) {
|
|
|
44335
44461
|
|
|
44336
44462
|
};
|
|
44337
44463
|
|
|
44338
|
-
},{}],
|
|
44464
|
+
},{}],432:[function(require,module,exports){
|
|
44339
44465
|
'use strict';
|
|
44340
44466
|
|
|
44341
44467
|
exports.type = 'perItem';
|
|
@@ -44374,7 +44500,7 @@ exports.fn = function(item) {
|
|
|
44374
44500
|
|
|
44375
44501
|
};
|
|
44376
44502
|
|
|
44377
|
-
},{"./_collections":398}],
|
|
44503
|
+
},{"./_collections":398}],433:[function(require,module,exports){
|
|
44378
44504
|
'use strict';
|
|
44379
44505
|
|
|
44380
44506
|
exports.type = 'perItem';
|
|
@@ -44404,7 +44530,7 @@ exports.fn = function(item) {
|
|
|
44404
44530
|
|
|
44405
44531
|
};
|
|
44406
44532
|
|
|
44407
|
-
},{}],
|
|
44533
|
+
},{}],434:[function(require,module,exports){
|
|
44408
44534
|
'use strict';
|
|
44409
44535
|
|
|
44410
44536
|
exports.type = 'perItem';
|
|
@@ -44429,7 +44555,7 @@ exports.fn = function(item) {
|
|
|
44429
44555
|
|
|
44430
44556
|
};
|
|
44431
44557
|
|
|
44432
|
-
},{}],
|
|
44558
|
+
},{}],435:[function(require,module,exports){
|
|
44433
44559
|
'use strict';
|
|
44434
44560
|
|
|
44435
44561
|
exports.type = 'perItem';
|
|
@@ -44454,7 +44580,7 @@ exports.fn = function(item) {
|
|
|
44454
44580
|
|
|
44455
44581
|
};
|
|
44456
44582
|
|
|
44457
|
-
},{}],
|
|
44583
|
+
},{}],436:[function(require,module,exports){
|
|
44458
44584
|
'use strict';
|
|
44459
44585
|
|
|
44460
44586
|
exports.type = 'perItem';
|
|
@@ -44479,7 +44605,7 @@ exports.fn = function(item) {
|
|
|
44479
44605
|
|
|
44480
44606
|
};
|
|
44481
44607
|
|
|
44482
|
-
},{}],
|
|
44608
|
+
},{}],437:[function(require,module,exports){
|
|
44483
44609
|
'use strict';
|
|
44484
44610
|
|
|
44485
44611
|
exports.type = 'perItem';
|
|
@@ -44631,7 +44757,7 @@ exports.fn = function(item, params) {
|
|
|
44631
44757
|
|
|
44632
44758
|
};
|
|
44633
44759
|
|
|
44634
|
-
},{"./_collections":398}],
|
|
44760
|
+
},{"./_collections":398}],438:[function(require,module,exports){
|
|
44635
44761
|
'use strict';
|
|
44636
44762
|
|
|
44637
44763
|
exports.type = 'full';
|
|
@@ -44740,7 +44866,7 @@ exports.fn = function(data) {
|
|
|
44740
44866
|
|
|
44741
44867
|
};
|
|
44742
44868
|
|
|
44743
|
-
},{}],
|
|
44869
|
+
},{}],439:[function(require,module,exports){
|
|
44744
44870
|
'use strict';
|
|
44745
44871
|
|
|
44746
44872
|
exports.type = 'perItem';
|
|
@@ -44795,7 +44921,7 @@ function getUsefulItems(item, usefulItems) {
|
|
|
44795
44921
|
return usefulItems;
|
|
44796
44922
|
}
|
|
44797
44923
|
|
|
44798
|
-
},{"./_collections":398}],
|
|
44924
|
+
},{"./_collections":398}],440:[function(require,module,exports){
|
|
44799
44925
|
'use strict';
|
|
44800
44926
|
|
|
44801
44927
|
exports.type = 'perItem';
|
|
@@ -44897,7 +45023,7 @@ exports.fn = function(item, params) {
|
|
|
44897
45023
|
|
|
44898
45024
|
};
|
|
44899
45025
|
|
|
44900
|
-
},{"./_collections":398}],
|
|
45026
|
+
},{"./_collections":398}],441:[function(require,module,exports){
|
|
44901
45027
|
'use strict';
|
|
44902
45028
|
|
|
44903
45029
|
exports.type = 'perItem';
|
|
@@ -44947,7 +45073,7 @@ exports.fn = function(item) {
|
|
|
44947
45073
|
|
|
44948
45074
|
};
|
|
44949
45075
|
|
|
44950
|
-
},{}],
|
|
45076
|
+
},{}],442:[function(require,module,exports){
|
|
44951
45077
|
'use strict';
|
|
44952
45078
|
|
|
44953
45079
|
exports.type = 'perItem';
|
|
@@ -44976,7 +45102,7 @@ exports.fn = function(item) {
|
|
|
44976
45102
|
}
|
|
44977
45103
|
|
|
44978
45104
|
};
|
|
44979
|
-
},{}],
|
|
45105
|
+
},{}],443:[function(require,module,exports){
|
|
44980
45106
|
'use strict';
|
|
44981
45107
|
|
|
44982
45108
|
exports.type = 'perItem';
|
|
@@ -45002,7 +45128,7 @@ exports.fn = function(item) {
|
|
|
45002
45128
|
|
|
45003
45129
|
};
|
|
45004
45130
|
|
|
45005
|
-
},{}],
|
|
45131
|
+
},{}],444:[function(require,module,exports){
|
|
45006
45132
|
'use strict';
|
|
45007
45133
|
|
|
45008
45134
|
exports.type = 'perItem';
|
|
@@ -45088,7 +45214,7 @@ exports.fn = function(item, params) {
|
|
|
45088
45214
|
|
|
45089
45215
|
};
|
|
45090
45216
|
|
|
45091
|
-
},{}],
|
|
45217
|
+
},{}],445:[function(require,module,exports){
|
|
45092
45218
|
(function (setImmediate,clearImmediate){
|
|
45093
45219
|
var nextTick = require('process/browser.js').nextTick;
|
|
45094
45220
|
var apply = Function.prototype.apply;
|
|
@@ -45167,7 +45293,7 @@ exports.clearImmediate = typeof clearImmediate === "function" ? clearImmediate :
|
|
|
45167
45293
|
delete immediateIds[id];
|
|
45168
45294
|
};
|
|
45169
45295
|
}).call(this,require("timers").setImmediate,require("timers").clearImmediate)
|
|
45170
|
-
},{"process/browser.js":357,"timers":
|
|
45296
|
+
},{"process/browser.js":357,"timers":445}],446:[function(require,module,exports){
|
|
45171
45297
|
var reg = /[\'\"]/
|
|
45172
45298
|
|
|
45173
45299
|
module.exports = function unquote(str) {
|
|
@@ -45183,7 +45309,7 @@ module.exports = function unquote(str) {
|
|
|
45183
45309
|
return str
|
|
45184
45310
|
}
|
|
45185
45311
|
|
|
45186
|
-
},{}],
|
|
45312
|
+
},{}],447:[function(require,module,exports){
|
|
45187
45313
|
(function (global){
|
|
45188
45314
|
|
|
45189
45315
|
/**
|
|
@@ -45254,7 +45380,7 @@ function config (name) {
|
|
|
45254
45380
|
}
|
|
45255
45381
|
|
|
45256
45382
|
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
|
45257
|
-
},{}],
|
|
45383
|
+
},{}],448:[function(require,module,exports){
|
|
45258
45384
|
"use strict";
|
|
45259
45385
|
var CONFIG = require("../node_modules/svgo/lib/svgo/config.js");
|
|
45260
45386
|
var SVG2JS = require("../node_modules/svgo/lib/svgo/svg2js.js");
|
|
@@ -45303,7 +45429,8 @@ var pluginModules = {
|
|
|
45303
45429
|
removeViewBox: require("../node_modules/svgo/plugins/removeViewBox"),
|
|
45304
45430
|
removeXMLNS: require("../node_modules/svgo/plugins/removeXMLNS"),
|
|
45305
45431
|
removeXMLProcInst: require("../node_modules/svgo/plugins/removeXMLProcInst"),
|
|
45306
|
-
sortAttrs: require("../node_modules/svgo/plugins/sortAttrs")
|
|
45432
|
+
sortAttrs: require("../node_modules/svgo/plugins/sortAttrs"),
|
|
45433
|
+
removeAttrs: require("../node_modules/svgo/plugins/removeAttrs")
|
|
45307
45434
|
};
|
|
45308
45435
|
|
|
45309
45436
|
function SVGO(options) {
|
|
@@ -45320,8 +45447,8 @@ function SVGO(options) {
|
|
|
45320
45447
|
if (value)
|
|
45321
45448
|
options.plugins.push(plugin);
|
|
45322
45449
|
break;
|
|
45323
|
-
|
|
45324
|
-
plugin.
|
|
45450
|
+
default:
|
|
45451
|
+
plugin.params = value;
|
|
45325
45452
|
options.plugins.push(plugin);
|
|
45326
45453
|
break;
|
|
45327
45454
|
}
|
|
@@ -45393,5 +45520,5 @@ module.exports = function(options, data) {
|
|
|
45393
45520
|
return svgoContext.optimize(data);
|
|
45394
45521
|
};
|
|
45395
45522
|
|
|
45396
|
-
},{"../node_modules/svgo/lib/svgo/config.js":389,"../node_modules/svgo/lib/svgo/js2svg.js":393,"../node_modules/svgo/lib/svgo/plugins.js":395,"../node_modules/svgo/lib/svgo/svg2js.js":396,"../node_modules/svgo/plugins/addAttributesToSVGElement":401,"../node_modules/svgo/plugins/addClassesToSVGElement":402,"../node_modules/svgo/plugins/cleanupAttrs":403,"../node_modules/svgo/plugins/cleanupEnableBackground":404,"../node_modules/svgo/plugins/cleanupIDs":405,"../node_modules/svgo/plugins/cleanupListOfValues":406,"../node_modules/svgo/plugins/cleanupNumericValues":407,"../node_modules/svgo/plugins/collapseGroups":408,"../node_modules/svgo/plugins/convertColors":409,"../node_modules/svgo/plugins/convertPathData":410,"../node_modules/svgo/plugins/convertShapeToPath":411,"../node_modules/svgo/plugins/convertStyleToAttrs":412,"../node_modules/svgo/plugins/convertTransform":413,"../node_modules/svgo/plugins/inlineStyles":414,"../node_modules/svgo/plugins/mergePaths":415,"../node_modules/svgo/plugins/minifyStyles":416,"../node_modules/svgo/plugins/moveElemsAttrsToGroup":417,"../node_modules/svgo/plugins/moveGroupAttrsToElems":418,"../node_modules/svgo/plugins/prefixIds":419,"../node_modules/svgo/plugins/
|
|
45523
|
+
},{"../node_modules/svgo/lib/svgo/config.js":389,"../node_modules/svgo/lib/svgo/js2svg.js":393,"../node_modules/svgo/lib/svgo/plugins.js":395,"../node_modules/svgo/lib/svgo/svg2js.js":396,"../node_modules/svgo/plugins/addAttributesToSVGElement":401,"../node_modules/svgo/plugins/addClassesToSVGElement":402,"../node_modules/svgo/plugins/cleanupAttrs":403,"../node_modules/svgo/plugins/cleanupEnableBackground":404,"../node_modules/svgo/plugins/cleanupIDs":405,"../node_modules/svgo/plugins/cleanupListOfValues":406,"../node_modules/svgo/plugins/cleanupNumericValues":407,"../node_modules/svgo/plugins/collapseGroups":408,"../node_modules/svgo/plugins/convertColors":409,"../node_modules/svgo/plugins/convertPathData":410,"../node_modules/svgo/plugins/convertShapeToPath":411,"../node_modules/svgo/plugins/convertStyleToAttrs":412,"../node_modules/svgo/plugins/convertTransform":413,"../node_modules/svgo/plugins/inlineStyles":414,"../node_modules/svgo/plugins/mergePaths":415,"../node_modules/svgo/plugins/minifyStyles":416,"../node_modules/svgo/plugins/moveElemsAttrsToGroup":417,"../node_modules/svgo/plugins/moveGroupAttrsToElems":418,"../node_modules/svgo/plugins/prefixIds":419,"../node_modules/svgo/plugins/removeAttrs":420,"../node_modules/svgo/plugins/removeComments":421,"../node_modules/svgo/plugins/removeDesc":422,"../node_modules/svgo/plugins/removeDimensions":423,"../node_modules/svgo/plugins/removeDoctype":424,"../node_modules/svgo/plugins/removeEditorsNSData":425,"../node_modules/svgo/plugins/removeElementsByAttr":426,"../node_modules/svgo/plugins/removeEmptyAttrs":427,"../node_modules/svgo/plugins/removeEmptyContainers":428,"../node_modules/svgo/plugins/removeEmptyText":429,"../node_modules/svgo/plugins/removeHiddenElems":430,"../node_modules/svgo/plugins/removeMetadata":431,"../node_modules/svgo/plugins/removeNonInheritableGroupAttrs":432,"../node_modules/svgo/plugins/removeRasterImages":433,"../node_modules/svgo/plugins/removeScriptElement":434,"../node_modules/svgo/plugins/removeStyleElement":435,"../node_modules/svgo/plugins/removeTitle":436,"../node_modules/svgo/plugins/removeUnknownsAndDefaults":437,"../node_modules/svgo/plugins/removeUnusedNS":438,"../node_modules/svgo/plugins/removeUselessDefs":439,"../node_modules/svgo/plugins/removeUselessStrokeAndFill":440,"../node_modules/svgo/plugins/removeViewBox":441,"../node_modules/svgo/plugins/removeXMLNS":442,"../node_modules/svgo/plugins/removeXMLProcInst":443,"../node_modules/svgo/plugins/sortAttrs":444}]},{},[448])(448)
|
|
45397
45524
|
});
|
data/svgo-js/svgo-wrapper.js
CHANGED
|
@@ -46,7 +46,8 @@ var pluginModules = {
|
|
|
46
46
|
removeViewBox: require("../node_modules/svgo/plugins/removeViewBox"),
|
|
47
47
|
removeXMLNS: require("../node_modules/svgo/plugins/removeXMLNS"),
|
|
48
48
|
removeXMLProcInst: require("../node_modules/svgo/plugins/removeXMLProcInst"),
|
|
49
|
-
sortAttrs: require("../node_modules/svgo/plugins/sortAttrs")
|
|
49
|
+
sortAttrs: require("../node_modules/svgo/plugins/sortAttrs"),
|
|
50
|
+
removeAttrs: require("../node_modules/svgo/plugins/removeAttrs")
|
|
50
51
|
};
|
|
51
52
|
|
|
52
53
|
function SVGO(options) {
|
|
@@ -63,8 +64,8 @@ function SVGO(options) {
|
|
|
63
64
|
if (value)
|
|
64
65
|
options.plugins.push(plugin);
|
|
65
66
|
break;
|
|
66
|
-
|
|
67
|
-
plugin.
|
|
67
|
+
default:
|
|
68
|
+
plugin.params = value;
|
|
68
69
|
options.plugins.push(plugin);
|
|
69
70
|
break;
|
|
70
71
|
}
|
data/svgo.gemspec
CHANGED
|
@@ -9,7 +9,7 @@ Gem::Specification.new do |s|
|
|
|
9
9
|
s.authors = ["Chris Snijder"]
|
|
10
10
|
s.email = "chris@greenhost.nl"
|
|
11
11
|
s.files = ["lib/svgo.rb"]
|
|
12
|
-
s.homepage = "
|
|
12
|
+
s.homepage = "https://github.com/greenhost/svgo-ruby"
|
|
13
13
|
s.license = "Apache 2.0"
|
|
14
14
|
s.files = `git ls-files`.split("\n") - [
|
|
15
15
|
".gitignore",
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: svgo
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Chris Snijder
|
|
@@ -9,7 +9,7 @@ autorequire:
|
|
|
9
9
|
bindir:
|
|
10
10
|
- bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2018-
|
|
12
|
+
date: 2018-12-06 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: execjs
|
|
@@ -91,7 +91,7 @@ files:
|
|
|
91
91
|
- svgo.gemspec
|
|
92
92
|
- test/fixtures/ruby.svg
|
|
93
93
|
- yarn.lock
|
|
94
|
-
homepage:
|
|
94
|
+
homepage: https://github.com/greenhost/svgo-ruby
|
|
95
95
|
licenses:
|
|
96
96
|
- Apache 2.0
|
|
97
97
|
metadata: {}
|