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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 45b02c0483d1b0b5cd6e4316187f888a24646244
4
- data.tar.gz: 99767ee243fa39ba1ca04543ee906dde2332efb4
3
+ metadata.gz: 9717bfddeee730f66c16efd62793f1dfcab055db
4
+ data.tar.gz: 3f439fb2791e95e3e0b7e1c3d52e255ecdd4db53
5
5
  SHA512:
6
- metadata.gz: 5500ee2bbf28c003186523461f1a5f9020703ebfdb3ab5f67aa2afcfccd75f5ec50b38a416dbb1e2f3f5446767afbec6038403b05defea49a32e87ef4c506553
7
- data.tar.gz: dde6e824a2a0878e5969dc4d8b1f62de4d4323cc6913c830005324711d37dae55f3cfe20c7ae814a2cb66b54e5e0358902a5eedabab561db75dc4b5a608d6041
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 = nil
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 !@last_read.nil? && (Time.now.to_i - @last_read) < config[:throttle_read]
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
@@ -1,3 +1,3 @@
1
1
  module Esvg
2
- VERSION = "4.2.2"
2
+ VERSION = "4.2.3"
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: 4.2.2
4
+ version: 4.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Mathis