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 +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/esvg/svg.rb +4 -4
- data/lib/esvg/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 18967aa14b9ff1be12be160f27011f0d27f52c76
|
4
|
+
data.tar.gz: d302417c96f774c13fbe8f9f11ba05b11b3efe96
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
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