web_font 0.1.5 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2d108bd77059dc95c5ff4646c0773126e053142e
4
- data.tar.gz: e7c9b177fbd6d2f0d00afd6e1a118692ee1adb82
3
+ metadata.gz: 6a14c89cc8bc851fa5819f9c93cb3c51ba7ce9f5
4
+ data.tar.gz: 811c1938d0005d68984e0ae5976f75f82099e3b4
5
5
  SHA512:
6
- metadata.gz: 64a49c44d1084d7b9335847cf9e0532f8384a6977562792fbbd46e485cced4547311fa0ef3d71748ed21ee25ba3908db8d6937b71febc5afab6d28353f0fd74f
7
- data.tar.gz: 03b5ac9c474fdda0cdec1944cc9ac240438d536ebdb923ca8153b85432b01124ef2108f068b1f7ea1af9038634a6269794d14ff3610128dc2a059dd312d94320
6
+ metadata.gz: f9b868ff35700fe2848d5d624609780a74f5ac990365194a58ba9c9b8be257024bd9c64f5541a9b1e47cbc2456ac14740cbc7acc5f7471e432228cd09eece82b
7
+ data.tar.gz: bfe435429e5f7e61681506c5bb59c23543f89f80e646be8f08b679994dd426d40edb17f4fd9bd7a393734ee68f69bddeef617933bdb593c76a861ca6a595fde0
@@ -22,11 +22,12 @@ module WebFont
22
22
  task :cache_fonts do
23
23
  WebFont::Index.download
24
24
 
25
- unless Dir.exist?(WebFont::LocalCache.cache_path)
26
- FileUtils.mkdir_p(WebFont::LocalCache.cache_path)
27
- end
28
-
29
25
  downloader = WebFont::Downloader.new
26
+ cache_path = WebFont::LocalCache.cache_path
27
+
28
+ if cache_path && !Dir.exist?(cache_path)
29
+ FileUtils.mkdir_p(cache_path)
30
+ end
30
31
 
31
32
  file_path = "#{WebFont::Index.path}/fonts.json"
32
33
  hash = JSON.parse(File.open(file_path).read)
@@ -36,7 +37,7 @@ module WebFont
36
37
 
37
38
  puts family
38
39
 
39
- downloader.download(family, WebFont::LocalCache.cache_path, false)
40
+ downloader.download(family, cache_path, false)
40
41
  end
41
42
 
42
43
  puts "\n"
@@ -1,3 +1,3 @@
1
1
  module WebFont
2
- VERSION = '0.1.5'
2
+ VERSION = '0.1.6'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: web_font
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sophy Eung