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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 76c3e6b7749d4d679b9113f46adedf53c398c223
4
- data.tar.gz: 743a219c711382a0c91c01c8ecbf29376a1920cb
3
+ metadata.gz: fea759497650db657fa20420de39480d432d1fe4
4
+ data.tar.gz: f20b05434ce1e948d64106143b9e0a7f96a85eff
5
5
  SHA512:
6
- metadata.gz: cecca171d39ff8c481179ef3a6327a8f4e501cf524dcc9575eed18d2079c39991a5cc53748fa145eaab287f09c75faf5a81da28abff3ac9f4c889fe5b0731320
7
- data.tar.gz: 103420e56918b92da4a27554ad8fc850c3b760e91fd986e53ce645e36ef4f79facee924acd0af9e01cd9af4b35e28a17b1add8a75ad7343003b152be220d5d38
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 + options.flatten.join('-')
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
@@ -1,3 +1,3 @@
1
1
  module Esvg
2
- VERSION = "2.1.0"
2
+ VERSION = "2.1.1"
3
3
  end
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.0
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-23 00:00:00.000000000 Z
11
+ date: 2015-09-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler