esvg 2.2.0 → 2.2.1
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 +10 -8
- 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: fdb2482690b9d278c1fa5f61ff7c8b70cbc61d4f
|
4
|
+
data.tar.gz: 095f0c74017bf40f7ad70f3dc4c67eecbceacba0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 20336856fc2b3527de5b44df326a97d56ec1d30d21b30f75520fbe86d9492473535ea40ab52bac376c1a6f1bdfad411b5ceb59f3af5f1c0fc1dfa98e858aa9a4
|
7
|
+
data.tar.gz: 39114a17e12df8bdc19602a5426b8570857e646382b30dbcbd991a5c57dcb6dafec5a62434b771b9e2d244c36f70bf8be5549a2564cb1df8dede3bec431ad688
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
### 2.2.1 (2015-10-01)
|
4
|
+
- Fix: If no icons are found, it's cool, don't freak out.
|
5
|
+
|
3
6
|
### 2.2.0 (2015-09-30)
|
4
7
|
- New: New javascript helpers make it easier to inject SVG icons into javascript templates.
|
5
8
|
- New: Javascript works with module.exports if you're building Javascripts with a module requiring system.
|
data/lib/esvg/svg.rb
CHANGED
@@ -38,11 +38,6 @@ module Esvg
|
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
41
|
-
def modified?
|
42
|
-
mtime = File.mtime(find_files.last)
|
43
|
-
@mtime != mtime
|
44
|
-
end
|
45
|
-
|
46
41
|
def svgo?
|
47
42
|
@svgo ||= begin
|
48
43
|
!(`npm ls -g svgo`.match(/empty/) && `npm ls svgo`.match(/emtpy/))
|
@@ -59,11 +54,19 @@ module Esvg
|
|
59
54
|
@svgs = {}
|
60
55
|
|
61
56
|
found = find_files
|
62
|
-
|
57
|
+
|
58
|
+
if found.size > 0
|
59
|
+
last = found.sort_by{ |f| File.mtime(f) }.last
|
60
|
+
@mtime = File.mtime(last)
|
61
|
+
end
|
63
62
|
|
64
63
|
found.each do |f|
|
65
64
|
@files[File.basename(f, ".*")] = read(f)
|
66
65
|
end
|
66
|
+
|
67
|
+
if @files.empty? && config[:verbose]
|
68
|
+
puts "No icons found at #{config[:path]}"
|
69
|
+
end
|
67
70
|
end
|
68
71
|
|
69
72
|
def read(file)
|
@@ -304,8 +307,7 @@ if(typeof(module) != 'undefined') { module.exports = esvg }
|
|
304
307
|
|
305
308
|
def find_files
|
306
309
|
path = File.expand_path(File.join(config[:path], '*.svg'))
|
307
|
-
|
308
|
-
Dir[path].uniq.sort_by{ |f| File.mtime(f) }
|
310
|
+
Dir[path].uniq
|
309
311
|
end
|
310
312
|
|
311
313
|
end
|
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.1
|
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-
|
11
|
+
date: 2015-10-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|