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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 98d1c59b1af38ab4024912d8cf4f3494602f735e
4
- data.tar.gz: 1aff4ce984beec1383a7db0ce903af66323985e2
3
+ metadata.gz: fdb2482690b9d278c1fa5f61ff7c8b70cbc61d4f
4
+ data.tar.gz: 095f0c74017bf40f7ad70f3dc4c67eecbceacba0
5
5
  SHA512:
6
- metadata.gz: 03545cceaeb29d22e2c2ff525d69aefd0e1e5b207189100d9fa7d3ff01dbd00acffd0b2edcb754c5e401f62fbecf6d09f9ee2eba09410ca2ee4ab880f10411d7
7
- data.tar.gz: 784305c4893813395c187e37f55d0a5e9c0be379978b2b301aa12d5173227bdc42105c50b8587f1b7f73a884981d364ea6725393cab13dd7a5175cc32b3e90b7
6
+ metadata.gz: 20336856fc2b3527de5b44df326a97d56ec1d30d21b30f75520fbe86d9492473535ea40ab52bac376c1a6f1bdfad411b5ceb59f3af5f1c0fc1dfa98e858aa9a4
7
+ data.tar.gz: 39114a17e12df8bdc19602a5426b8570857e646382b30dbcbd991a5c57dcb6dafec5a62434b771b9e2d244c36f70bf8be5549a2564cb1df8dede3bec431ad688
@@ -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.
@@ -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
- @mtime = File.mtime(found.last)
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
@@ -1,3 +1,3 @@
1
1
  module Esvg
2
- VERSION = "2.2.0"
2
+ VERSION = "2.2.1"
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.0
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-09-30 00:00:00.000000000 Z
11
+ date: 2015-10-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler