esvg 2.2.1 → 2.2.2

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: fdb2482690b9d278c1fa5f61ff7c8b70cbc61d4f
4
- data.tar.gz: 095f0c74017bf40f7ad70f3dc4c67eecbceacba0
3
+ metadata.gz: 4e374a737c4b033c612705eb0b8c8e628a83b0a3
4
+ data.tar.gz: 04e8337a412464567a16bd202e55ee0561da86c1
5
5
  SHA512:
6
- metadata.gz: 20336856fc2b3527de5b44df326a97d56ec1d30d21b30f75520fbe86d9492473535ea40ab52bac376c1a6f1bdfad411b5ceb59f3af5f1c0fc1dfa98e858aa9a4
7
- data.tar.gz: 39114a17e12df8bdc19602a5426b8570857e646382b30dbcbd991a5c57dcb6dafec5a62434b771b9e2d244c36f70bf8be5549a2564cb1df8dede3bec431ad688
6
+ metadata.gz: a305f622033ffe748433efc2d6044f0fe3a5681ff28a522d3b6feaf89e4c02dab340ad91b1182f89ee7c5a92a1622dae100dc261d2378e8e998f12792f343c7f
7
+ data.tar.gz: 887a7287d5f100813b667805a6f8ae2beb1c8e604c7957bb71067488527918ef81c576f143684f12e798d2e09082578d508d4db43f7f74e2e447f8014d880f5f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
 
3
+ ### 2.2.2 (2015-10-02)
4
+ - Fix: Improved lookup of last-modified file.
5
+
3
6
  ### 2.2.1 (2015-10-01)
4
7
  - Fix: If no icons are found, it's cool, don't freak out.
5
8
 
data/lib/esvg/svg.rb CHANGED
@@ -26,6 +26,10 @@ module Esvg
26
26
  @cache = {}
27
27
  end
28
28
 
29
+ def modified?
30
+ @mtime != last_modified(find_files)
31
+ end
32
+
29
33
  def embed
30
34
  return if @files.empty?
31
35
  case config[:format]
@@ -50,15 +54,10 @@ module Esvg
50
54
 
51
55
  def read_icons
52
56
  @files = {}
53
- @mtime = {}
54
57
  @svgs = {}
55
58
 
56
59
  found = find_files
57
-
58
- if found.size > 0
59
- last = found.sort_by{ |f| File.mtime(f) }.last
60
- @mtime = File.mtime(last)
61
- end
60
+ @mtime = last_modified(found)
62
61
 
63
62
  found.each do |f|
64
63
  @files[File.basename(f, ".*")] = read(f)
@@ -69,6 +68,12 @@ module Esvg
69
68
  end
70
69
  end
71
70
 
71
+ def last_modified(files)
72
+ if files.size > 0
73
+ File.mtime(files.sort_by{ |f| File.mtime(f) }.last)
74
+ end
75
+ end
76
+
72
77
  def read(file)
73
78
  if config[:optimize] && svgo?
74
79
  # Compress files outputting to $STDOUT
data/lib/esvg/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Esvg
2
- VERSION = "2.2.1"
2
+ VERSION = "2.2.2"
3
3
  end
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: 2.2.1
4
+ version: 2.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Mathis
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-10-01 00:00:00.000000000 Z
11
+ date: 2015-10-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler