esvg 4.1.6 → 4.2.0

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: 4cdf73f761408b10ec69e4e92b90ad3ca5d8e455
4
- data.tar.gz: a5e7b7841d4761066d146e834ad4a13e8c3c5ee6
3
+ metadata.gz: e72d63ad2c2cfef588743462ff62a67dafa89223
4
+ data.tar.gz: 17be6a677e527aa9f510b70814e7917856ebfc19
5
5
  SHA512:
6
- metadata.gz: 1928c26c95e17f3c2e370e024b4556e7ef8d45aeb282ace3f74aca6c052727351e0ec0a9ac542b29c83c5feac7f0cbc7d59eb8d8471a93bc40060c19cc35e353
7
- data.tar.gz: a87add93e18ecc8a439802726aa57836665f58200584de74c6932be4a98f958894721e62767d2ec899bd8550f1abda0df510116e68e82983c9c33c5d55da48bd
6
+ metadata.gz: 25445968d27bf910caa4931d703536a11cf059925bdb6ec134b8a7685d06fc80de19d36a475888cc4d0863d99b7f61edacfb4842e38cc8bb43eca225e05202b4
7
+ data.tar.gz: 8a35b1ab01151de2de062bd20847cf5f4f58974d9f51a44274fe286f2781afa8477553a75918057df96d82add97fa3ac703402c397ab4018eb9be39cd46a8953
data/exe/esvg CHANGED
@@ -58,5 +58,5 @@ else
58
58
  end
59
59
 
60
60
  options[:print] = true
61
- esvg = Esvg::SVG.new(options).build
61
+ esvg = Esvg::Svgs.new(options).build
62
62
  end
data/lib/esvg/helpers.rb CHANGED
@@ -1,36 +1,12 @@
1
1
  module Esvg::Helpers
2
2
 
3
- def esvg
4
- svgs = Esvg.svgs || Esvg.new()
5
-
6
- svgs.read_files if Rails.env.development?
7
-
8
- svgs
9
- end
10
-
11
-
12
3
  def embed_svgs(*keys)
13
- if Rails.env.production?
14
- esvg.build_paths(keys).map do |path|
15
- javascript_include_tag(path)
16
- end.join("\n").html_safe
17
- else
18
- esvg.embed_script(keys).html_safe
19
- end
4
+ Esvg.embed(keys)
20
5
  end
21
6
 
22
7
  def use_svg(name, options={}, &block)
23
- use_svg_with_files(esvg, name, options, &block)
24
- end
25
-
26
- private
27
-
28
- def use_svg_with_files(files, name, options, &block)
29
-
30
- if block_given?
31
- options[:content] = capture(&block)
32
- end
8
+ options[:content] = capture(&block).html_safe if block_given?
33
9
 
34
- files.use(name, options).html_safe
10
+ Esvg.use(name, options)
35
11
  end
36
12
  end