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 +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/esvg/svg.rb +11 -6
- 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: 4e374a737c4b033c612705eb0b8c8e628a83b0a3
|
4
|
+
data.tar.gz: 04e8337a412464567a16bd202e55ee0561da86c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a305f622033ffe748433efc2d6044f0fe3a5681ff28a522d3b6feaf89e4c02dab340ad91b1182f89ee7c5a92a1622dae100dc261d2378e8e998f12792f343c7f
|
7
|
+
data.tar.gz: 887a7287d5f100813b667805a6f8ae2beb1c8e604c7957bb71067488527918ef81c576f143684f12e798d2e09082578d508d4db43f7f74e2e447f8014d880f5f
|
data/CHANGELOG.md
CHANGED
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
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.
|
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-
|
11
|
+
date: 2015-10-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|