esvg 4.2.4 → 4.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/esvg.rb +1 -7
- data/lib/esvg/helpers.rb +5 -1
- 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: 090e8ae35b7794a277519a8430f4bc713f570e03
|
4
|
+
data.tar.gz: acc98374a8c3a8c3f67e97158a59e3d5e532bde4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a7d301d33ccb35f27b5167b3b85d2c6538f85bde71e5cbe7b8a0f1d0d1597e8e44d65f1ee634434b52cf1767c4694b8353e0514a6c1120281e4febe9e0a4ab84
|
7
|
+
data.tar.gz: 08c58866f0f855ca1244815f17389c0cf82dd8cdf8db4113a4aedd90c9a2174acd9deefb97b46af57a31d22040af9474b36699d40112a597c17d00f151290275
|
data/lib/esvg.rb
CHANGED
@@ -36,13 +36,7 @@ module Esvg
|
|
36
36
|
end
|
37
37
|
|
38
38
|
def embed(names=nil)
|
39
|
-
|
40
|
-
html_safe build_paths(names).each do |path|
|
41
|
-
javascript_include_tag(path, async: true)
|
42
|
-
end.join("\n")
|
43
|
-
else
|
44
|
-
html_safe find_svgs(names).map{|s| s.embed_script(names) }.join
|
45
|
-
end
|
39
|
+
html_safe find_svgs(names).map{|s| s.embed_script(names) }.join
|
46
40
|
end
|
47
41
|
|
48
42
|
def build_paths(names=nil)
|
data/lib/esvg/helpers.rb
CHANGED
@@ -1,7 +1,11 @@
|
|
1
1
|
module Esvg::Helpers
|
2
2
|
|
3
3
|
def embed_svgs(*keys)
|
4
|
-
|
4
|
+
if Rails.env.production?
|
5
|
+
Esvg.build_paths(keys).map { |path| javascript_include_tag(path, async: true) }.join("\n").html_safe
|
6
|
+
else
|
7
|
+
Esvg.embed(keys)
|
8
|
+
end
|
5
9
|
end
|
6
10
|
|
7
11
|
def use_svg(name, options={}, &block)
|
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: 4.2.
|
4
|
+
version: 4.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Mathis
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-06-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|