esvg 2.2.5 → 2.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/esvg/svg.rb +7 -5
- data/lib/esvg/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4203297d1baa968efa916d3efacaa3b62faea259
|
4
|
+
data.tar.gz: 6f94000f4b5c4087b08396b2fec368b0fbf13746
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c80284abcae923930e8beb6cef752ce9114ebbced458f0853a01801ec3bf421119d7f9ab2a5779f146c70627c96463969c4aef9787a7fe3f4453f95f3aa3322c
|
7
|
+
data.tar.gz: e2f092bca43e6e24831733db7ed40b29e378bd29a49e04b10fd6a67ed1a1d6c4f0fef17bf3fa48b1fbdb75abe97b3c6ddc07ac7678b010132e5d8815f3f8b845
|
data/CHANGELOG.md
CHANGED
data/lib/esvg/svg.rb
CHANGED
@@ -286,11 +286,13 @@ if(typeof(module) != 'undefined') { module.exports = esvg }
|
|
286
286
|
end
|
287
287
|
|
288
288
|
def dimensions(input)
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
289
|
+
dimension = input.scan(/<svg.+(viewBox=["'](.+?)["'])/).flatten
|
290
|
+
viewbox = dimension.first
|
291
|
+
coords = dimension.last.split(' ')
|
292
|
+
|
293
|
+
width = coords[2].to_i - coords[0].to_i
|
294
|
+
height = coords[3].to_i - coords[1].to_i
|
295
|
+
%Q{#{viewbox} width="#{width}" height="#{height}"}
|
294
296
|
end
|
295
297
|
|
296
298
|
def icon_name(name)
|
data/lib/esvg/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: esvg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Mathis
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-10-
|
11
|
+
date: 2015-10-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|