svg_sprite 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 105df3fa506295f180592c6efcd0acc6a0fec3bf
4
- data.tar.gz: ea7f6133c31cfdd5f37db0580c7add9fe6cf4295
3
+ metadata.gz: 211515d3e3988cbb9ae4e8046b49e922fed1f16f
4
+ data.tar.gz: 997cc7fd62d49555fd30265d4d579a434e2815b8
5
5
  SHA512:
6
- metadata.gz: 330400d26da9ecb056faafed689022ab1846d0f9ccaf4702ff68fbf6728a6271475fdcf6a41bf36108265c90a8ce2e5acfc24393fdfb52ad87e899455c475cf1
7
- data.tar.gz: a238d2ab26462370010e2c3838768d7bee0096691669d15cfdc085aa7126ca9c86ae768585fd8a0a62d1ffcfc52e2c805fc7f44f46040c62fce00c7f7b0a3f39
6
+ metadata.gz: a994a3e1fc66dbdd450b78e3b9b696b1f29f3a202a5771405d84437b4bd75c8287fe586d1e77f1f57ab9e0d722d33eb810300be777c60693cc82b98ccf50ae75
7
+ data.tar.gz: 932c235f1862caedfc0002e566c66acc4058ae60569cbb34f0c9a35f1aa849e5bb7e21651408620c9166dac3b31f2350b16d08cde5a4832fb2782a041c6f6b01
@@ -23,12 +23,12 @@ module SvgSprite
23
23
 
24
24
  # Return the <svg>'s width.
25
25
  def width
26
- svg["width"]
26
+ "#{svg["width"]}#{ensure_unit(svg["width"])}"
27
27
  end
28
28
 
29
29
  # Return the <svg>'s height.
30
30
  def height
31
- svg["height"]
31
+ "#{svg["height"]}#{ensure_unit(svg["height"])}"
32
32
  end
33
33
 
34
34
  # Return the raw content. This content is not optimized by svg_optimizer.
@@ -70,5 +70,9 @@ module SvgSprite
70
70
  def encoding
71
71
  Encoding.default_external.name
72
72
  end
73
+
74
+ private def ensure_unit(number)
75
+ return "px" if number =~ /\A\d+\z/
76
+ end
73
77
  end
74
78
  end
@@ -1,3 +1,3 @@
1
1
  module SvgSprite
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: svg_sprite
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nando Vieira
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-09-30 00:00:00.000000000 Z
11
+ date: 2017-10-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: svg_optimizer