esvg 2.1.0 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/esvg/svg.rb +7 -3
- 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: fea759497650db657fa20420de39480d432d1fe4
|
4
|
+
data.tar.gz: f20b05434ce1e948d64106143b9e0a7f96a85eff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9baf646388301fe9882c8a3a5e5f1e8f8747c364c8c49c6ec4478a5793469168b547db956aee56c58c13cf554849bfd67a33d994ff46ced58aba6a533592ca8a
|
7
|
+
data.tar.gz: 3090a729733675bc6e1b7b33f8755c12110a0ed4f166d510ad430faab82217788bc9a54bbd1591531b064dd75504f810d36dfd78689c23b58af8ddb120147ad3
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,10 @@
|
|
3
3
|
### 2.1.0 (2015-09-23)
|
4
4
|
- Minor: `Esvg.icons.svgs` will now return the hash of svgs.
|
5
5
|
|
6
|
+
### 2.1.0 (2015-09-28)
|
7
|
+
- Fix: Ensure that symbols are converted to strings.
|
8
|
+
- Fix: Expand pahts for better error messages.
|
9
|
+
|
6
10
|
### 2.0.3 (2015-09-23)
|
7
11
|
- Fix: Fixed configuration merge order
|
8
12
|
|
data/lib/esvg/svg.rb
CHANGED
@@ -49,7 +49,7 @@ module Esvg
|
|
49
49
|
end
|
50
50
|
|
51
51
|
def cache_name(input, options)
|
52
|
-
input
|
52
|
+
"#{input}#{options.flatten.join('-')}"
|
53
53
|
end
|
54
54
|
|
55
55
|
def read_icons
|
@@ -191,6 +191,7 @@ document.addEventListener("DOMContentLoaded", function(event) { esvg.embed() })
|
|
191
191
|
end
|
192
192
|
|
193
193
|
def svg_icon(file, options={})
|
194
|
+
file = file.to_s
|
194
195
|
@cache[cache_name(file, options)] ||= begin
|
195
196
|
name = icon_name(file)
|
196
197
|
%Q{<svg class="#{config[:base_class]} #{name} #{options[:class] || ""}" #{dimensions(@files[file])}><use xlink:href="##{name}"/>#{title(options)}#{desc(options)}</svg>}
|
@@ -222,6 +223,9 @@ document.addEventListener("DOMContentLoaded", function(event) { esvg.embed() })
|
|
222
223
|
|
223
224
|
config.merge!(options)
|
224
225
|
|
226
|
+
config[:path] = File.expand_path(config[:path])
|
227
|
+
config[:output_path] = File.expand_path(config[:output_path])
|
228
|
+
|
225
229
|
config[:js_path] ||= File.join(config[:output_path], 'esvg.js')
|
226
230
|
config[:css_path] ||= File.join(config[:output_path], 'esvg.css')
|
227
231
|
config[:html_path] ||= File.join(config[:output_path], 'esvg.html')
|
@@ -247,7 +251,7 @@ document.addEventListener("DOMContentLoaded", function(event) { esvg.embed() })
|
|
247
251
|
|
248
252
|
def icon_name(name)
|
249
253
|
if @files[name].nil?
|
250
|
-
raise "No icon named #{name} exists at #{config[:path]}"
|
254
|
+
raise "No icon named '#{name}' exists at #{config[:path]}"
|
251
255
|
end
|
252
256
|
classname(name)
|
253
257
|
end
|
@@ -266,7 +270,7 @@ document.addEventListener("DOMContentLoaded", function(event) { esvg.embed() })
|
|
266
270
|
end
|
267
271
|
|
268
272
|
def find_files
|
269
|
-
path = File.join(config[:path], '*.svg')
|
273
|
+
path = File.expand_path(File.join(config[:path], '*.svg'))
|
270
274
|
|
271
275
|
Dir[path].uniq.sort_by{ |f| File.mtime(f) }
|
272
276
|
end
|
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.1.
|
4
|
+
version: 2.1.1
|
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-09-
|
11
|
+
date: 2015-09-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|