esvg 2.9.0 → 2.9.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: 24c44ea3e068939c63866e73847817b2ae0b775e
4
- data.tar.gz: cbd0c934f3cb92170dee3d4d2fff774e206610bf
3
+ metadata.gz: 8043d7996452e9835cccff0963b343c979b3ba38
4
+ data.tar.gz: 74c546775101bf3c91769f5f32a9d33b089803c3
5
5
  SHA512:
6
- metadata.gz: 131ca0178d2497c234e1af04a8e1e4d95f27e5138bba9ca3bc874c325ca341a47dbb99c77a99fbae7c339881375802e393a6b5c1ddc0eac48e04abde6aeee53a
7
- data.tar.gz: 269d4b855617971d605e68db2d43c77037d4ed1ac6e865b204b28c5388e30e5ecaa56043fb74152fa389bf854b7453cfb50d7a3006e4b590464a8b0e43b21b9a
6
+ metadata.gz: 7ceefb55b295f44f8e884896a3b1930e9ef3db4b346c32deffceb8106ed77c45a9b2bffe0b9996b2d5fecdedd20e0a6df8751d31edd4359b433275a5fa9b6942
7
+ data.tar.gz: 98d15fa8f95672e5b0e4db06a869418b8bdc8c77f35d47b8118464ae863cec3908653251708779f912ec58fa27fc7c0c2ac6e3a68b70e5d70a749a2e07100e70
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ### 2.9.1 (2016-07-18)
4
+ - New: `use` method is an alias for svg_icon
5
+ - Fix: Esvg.new caches instances to be used by Rails helper methods
6
+
3
7
  ### 2.9.0 (2016-07-18)
4
8
  - New: `icon` method accepts fill, color, height, and width
5
9
 
data/lib/esvg.rb CHANGED
@@ -12,7 +12,11 @@ module Esvg
12
12
  extend self
13
13
 
14
14
  def new(options={})
15
- SVG.new(options)
15
+ @svgs = SVG.new(options)
16
+ end
17
+
18
+ def svgs
19
+ @svgs
16
20
  end
17
21
 
18
22
  def embed
data/lib/esvg/helpers.rb CHANGED
@@ -1,11 +1,17 @@
1
1
  module Esvg::Helpers
2
2
  def svg_icons(options={})
3
- @@svg_icons ||= Esvg.new(options)
4
- @@svg_icons.read_files if Rails.env.development?
5
- @@svg_icons
3
+ svgs = Esvg.svgs
4
+
5
+ if svgs.nil? || !options.empty?
6
+ svgs = Esvg.new(options)
7
+ end
8
+
9
+ svgs.read_files if Rails.env.development?
10
+
11
+ svgs
6
12
  end
7
13
 
8
14
  def svg_icon(name, options={})
9
- svg_icons.svg_icon(name, options).html_safe
15
+ svg_icons.use(name, options).html_safe
10
16
  end
11
17
  end
data/lib/esvg/svg.rb CHANGED
@@ -200,6 +200,8 @@ module Esvg
200
200
  end
201
201
  end
202
202
 
203
+ alias :use :svg_icon
204
+
203
205
  def add_attribute(tag, attr, content=nil, append=false)
204
206
  return tag if content.nil?
205
207
  if tag.match(/#{attr}/)
data/lib/esvg/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Esvg
2
- VERSION = "2.9.0"
2
+ VERSION = "2.9.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.9.0
4
+ version: 2.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Mathis