esvg 2.4.0 → 2.4.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0929542e9c469ca502b8d6beb9f5bbf779a23d41
4
- data.tar.gz: 2dc3070f381f16fa28c993277fdf19d6632c35ed
3
+ metadata.gz: 18967aa14b9ff1be12be160f27011f0d27f52c76
4
+ data.tar.gz: d302417c96f774c13fbe8f9f11ba05b11b3efe96
5
5
  SHA512:
6
- metadata.gz: 5126999322552fa4ba22ccf16b459004e6851eb6b2f321992cc20ce93d720a0f3684dbdf34d2d84cd0431e6442cad7c2c5b072a63fcebaaef1ab39f3cf62ad77
7
- data.tar.gz: 061e2c49fc7e2d537a5947048651da403c2b12fd78050d08756125b5dcd31d81397ff874bb7988b83e5b66ae346af700f85e3b0c4fa057303c9a6e4e7a3220d4
6
+ metadata.gz: b645873370e95a13572a900a08c70782904c8010cd2437c66fe74da38a24e5d2f8c910907fb7d9c948f3a739e3cf915a2c8f8590ab71efc19b95c54f9af31211
7
+ data.tar.gz: 41fed94f9feee7e3f45caf23fc520a9f05d06fa146a65796a41eb2ba6c398d0d24fb01f85b994b999c8ffc283a5b5cecd9e0a0145f08e3ed689daec9f2abd1ae
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
 
3
+ ### 2.4.1 (2015-10-17)
4
+ - Fix: Icon embedding (with ruby/rails) uses proper key for lookup.
5
+
3
6
  ### 2.4.0 (2015-10-17)
4
7
  - New: Caching is now based on file modification times. It's much faster and more efficient.
5
8
  - New: Optimization is much faster now too, as it happens after symbol concatenation, so it only runs once per build.
data/lib/esvg/svg.rb CHANGED
@@ -127,8 +127,7 @@ module Esvg
127
127
  end
128
128
 
129
129
  def svg_icon(file, options={})
130
- file = icon_name(file.to_s)
131
- embed = svgs[file][:use]
130
+ embed = use_icon(file)
132
131
  embed = embed.sub(/class="(.+?)"/, 'class="\1 '+options[:class]+'"') if options[:class]
133
132
  embed = embed.sub(/><\/svg/, ">#{title(options)}#{desc(options)}</svg")
134
133
  embed
@@ -144,11 +143,12 @@ module Esvg
144
143
  %Q{#{viewbox} width="#{width}" height="#{height}"}
145
144
  end
146
145
 
147
- def icon_name(name)
146
+ def use_icon(name)
148
147
  if svgs[name].nil?
149
148
  raise "No svg named '#{name}' exists at #{config[:path]}"
149
+ else
150
+ svgs[name][:use]
150
151
  end
151
- classname(name)
152
152
  end
153
153
 
154
154
  def classname(name)
data/lib/esvg/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Esvg
2
- VERSION = "2.4.0"
2
+ VERSION = "2.4.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.4.0
4
+ version: 2.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Mathis