esvg 4.2.2 → 4.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/esvg/svgs.rb +5 -4
- 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: 9717bfddeee730f66c16efd62793f1dfcab055db
|
4
|
+
data.tar.gz: 3f439fb2791e95e3e0b7e1c3d52e255ecdd4db53
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ea0a0fd2a096b162d3082fdb7c126ac4a13c9c3882edecaa3713d0e1773ca3d742139655728abf6670fda56300feb9296f17a1bfadf7ed30e8832297217adabc
|
7
|
+
data.tar.gz: 66f4b16120aca9d1dac4e452a2d2e9cc896469edd71331f6939aea1ea176426bbd6644263e9da080fe9203c23a514450f0142c6981543c2f843f29dbfcc9a300
|
data/lib/esvg/svgs.rb
CHANGED
@@ -34,7 +34,7 @@ module Esvg
|
|
34
34
|
config(options)
|
35
35
|
@symbols = []
|
36
36
|
@svgs = []
|
37
|
-
@last_read =
|
37
|
+
@last_read = 0
|
38
38
|
read_cache
|
39
39
|
|
40
40
|
load_files
|
@@ -74,9 +74,7 @@ module Esvg
|
|
74
74
|
end
|
75
75
|
|
76
76
|
def load_files
|
77
|
-
if
|
78
|
-
return
|
79
|
-
end
|
77
|
+
return if (Time.now.to_i - @last_read) < config[:throttle_read]
|
80
78
|
|
81
79
|
files = Dir[File.join(config[:source], '**/*.svg')].uniq.sort
|
82
80
|
|
@@ -156,6 +154,9 @@ module Esvg
|
|
156
154
|
end
|
157
155
|
|
158
156
|
def find_symbol(name, fallback=nil)
|
157
|
+
# Ensure that file changes are picked up in development
|
158
|
+
load_files unless Esvg.rails? && Rails.env.production?
|
159
|
+
|
159
160
|
name = get_alias dasherize(name)
|
160
161
|
|
161
162
|
if svg = @symbols.find { |s| s.name == name }
|
data/lib/esvg/version.rb
CHANGED