esvg 1.1.0 → 1.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 +5 -1
- data/lib/esvg.rb +1 -15
- data/lib/esvg/helpers.rb +1 -1
- data/lib/esvg/svg.rb +12 -0
- 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: bc49e968dc9968f8fe72bae00d4efcbb8e1e4e52
|
4
|
+
data.tar.gz: 428208a9c3c9426a199361c225e7e6625234ac40
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f59e82c496aeed8819c3e2a8e953d17b682d5f99ae578a9dd576fbc3c875ab76d0db3a0f7988c9a9112759a282f1c8912c3745769285332328a7fa7802e61e2
|
7
|
+
data.tar.gz: 26ba8e38c78eb82e7861a847bc31a5f0601dcf231ea7fb99cee4befc99062887e8d65167b5365eb1776b5fef45a43c10dfefc113cbe11f220c3ad07ddd45696b
|
data/CHANGELOG.md
CHANGED
@@ -1,8 +1,12 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
### 1.1.1 (2015-06-29)
|
4
|
+
|
5
|
+
- Fix: Moved methods from Esvg module to SVG class. Oops.
|
6
|
+
|
3
7
|
### 1.1.0 (2015-06-29)
|
4
8
|
|
5
|
-
-
|
9
|
+
- New `embed_svgs` accepts an array, allowing a subset of icons to be embedded per page.
|
6
10
|
|
7
11
|
## 1.0.0 (2015-06-29)
|
8
12
|
|
data/lib/esvg.rb
CHANGED
@@ -27,25 +27,11 @@ module Esvg
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def svg_icon(name, options={})
|
30
|
-
|
31
|
-
%Q{<svg class="icon #{name} #{options[:class] || ""}"><use xlink:href="##{name}"/>#{title(options)}#{desc(options)}</svg>}.html_safe
|
30
|
+
icons.svg_icon(name, options)
|
32
31
|
end
|
33
32
|
|
34
33
|
def rails?
|
35
34
|
defined?(Rails)
|
36
35
|
end
|
37
36
|
|
38
|
-
private
|
39
|
-
|
40
|
-
def title(options)
|
41
|
-
if options[:title]
|
42
|
-
"<title>#{options[:title]}</title>"
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
def desc(options)
|
47
|
-
if options[:desc]
|
48
|
-
"<desc>#{options[:desc]}</desc>"
|
49
|
-
end
|
50
|
-
end
|
51
37
|
end
|
data/lib/esvg/helpers.rb
CHANGED
data/lib/esvg/svg.rb
CHANGED
@@ -119,6 +119,18 @@ module Esvg
|
|
119
119
|
%Q{<svg class="#{config[:base_class]} #{name} #{options[:class] || ""}"><use xlink:href="##{name}"/>#{title(options)}#{desc(options)}</svg>}.html_safe
|
120
120
|
end
|
121
121
|
|
122
|
+
def title(options)
|
123
|
+
if options[:title]
|
124
|
+
"<title>#{options[:title]}</title>"
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
128
|
+
def desc(options)
|
129
|
+
if options[:desc]
|
130
|
+
"<desc>#{options[:desc]}</desc>"
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
122
134
|
def config(options={})
|
123
135
|
@config ||= begin
|
124
136
|
paths = [options[:config_file], 'config/esvg.yml', 'esvg.yml'].compact
|
data/lib/esvg/version.rb
CHANGED