esvg 2.8.0 → 2.8.1

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: 63077454777a28a3ddee5f9aca2f4ea000a3f131
4
- data.tar.gz: 3d9343e86d77843bcfb4806c4bcd8e2c8aa2c7fd
3
+ metadata.gz: bd6726e520f6f5f2a893e95bf449bef8bdd95f02
4
+ data.tar.gz: c70c6ae44e857f5d06ebeecfcee14b641a959069
5
5
  SHA512:
6
- metadata.gz: 4c43ee0a52b09ddf416392e6d5098b6039b99ddeca46f9d81c1d1593834f58f29a866a41272a0aeef647b2c6b99d843eb6f0137dfca528cd0d16c46a05d32d23
7
- data.tar.gz: 1c3e29da770342ea03243064a1da60ab3256ae2e2251b84f04f546e3e2ea06e08bfab9e56a03cf6b4ceaa39eebc08fc23e518dc21e22ce1765935a977b6dbe86
6
+ metadata.gz: 50dcc95fd77a8fea828c6f28b8850ae8d87d80f0d00a77cfc15f743acf2122b4aa930e5e270596f4986c10fa4af53dff354390597a8f51171de3e7677cf093f2
7
+ data.tar.gz: 4906f1e08b0f91904f685512fdb11bb04a3d3b16102da1564b17cfebc95ea0c075f0b244c244242e2811b4bde7f30ac5f8e28312191df20ab6b4c9b4042ebd26
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
 
3
+ ### 2.8.1 (2015-12-16)
4
+ - Fix: Repeat icons no longer retain previous icon's options.
5
+
3
6
  ### 2.8.0 (2015-12-16)
4
7
  - New: Added exist? method to ask if an icon exists.
5
8
  - New: `fallback` option allows svgs to provide a fallback icon if one is not found.
data/README.md CHANGED
@@ -65,6 +65,12 @@ To place an SVG icon, use the `svg_icon` helper. This helper will embed an SVG `
65
65
  # Output:
66
66
  # <svg class="icon kitten-icon adorbs"><use xlink:href="#kitten-icon"/></svg>
67
67
 
68
+ # Provide fallback icon if an icon is missing
69
+ <%= svg_icon 'missing', fallback: 'kitten' %>
70
+
71
+ # Output:
72
+ # <svg class="icon kitten-icon"><use xlink:href="#kitten-icon"/></svg>
73
+
68
74
  # Add custom styles
69
75
  <%= svg_icon 'kitten', style: 'color: #c0ffee' %>
70
76
 
@@ -156,14 +156,13 @@ module Esvg
156
156
  else
157
157
 
158
158
  embed = use_icon(file)
159
-
160
- embed.sub!(/class="(.+?)"/, 'class="\1 '+options[:class]+'"') if options[:class]
159
+ embed = embed.sub(/class="(.+?)"/, 'class="\1 '+options[:class]+'"') if options[:class]
161
160
 
162
161
  if options[:style]
163
162
  if embed.match(/style/)
164
- embed.sub!(/style="(.+?)"/, 'style="\1; '+options[:style]+'"')
163
+ embed = embed.sub(/style="(.+?)"/, 'style="\1; '+options[:style]+'"')
165
164
  else
166
- embed.sub!(/><use/, %Q{ style="#{options[:style]}"><use})
165
+ embed = embed.sub(/><use/, %Q{ style="#{options[:style]}"><use})
167
166
  end
168
167
  end
169
168
 
@@ -1,3 +1,3 @@
1
1
  module Esvg
2
- VERSION = "2.8.0"
2
+ VERSION = "2.8.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: esvg
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.0
4
+ version: 2.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Mathis