web_font 0.1.6 → 0.1.7

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: 6a14c89cc8bc851fa5819f9c93cb3c51ba7ce9f5
4
- data.tar.gz: 811c1938d0005d68984e0ae5976f75f82099e3b4
3
+ metadata.gz: 2360cdd2557cba87009c058e99e702f67330cd24
4
+ data.tar.gz: cf0a404127d90afb109929ddf5a0323247ce6cc6
5
5
  SHA512:
6
- metadata.gz: f9b868ff35700fe2848d5d624609780a74f5ac990365194a58ba9c9b8be257024bd9c64f5541a9b1e47cbc2456ac14740cbc7acc5f7471e432228cd09eece82b
7
- data.tar.gz: bfe435429e5f7e61681506c5bb59c23543f89f80e646be8f08b679994dd426d40edb17f4fd9bd7a393734ee68f69bddeef617933bdb593c76a861ca6a595fde0
6
+ metadata.gz: 046ece7009cb087bcc67018476a94e613a6d6b1136d888175fdfd91c2be66c8f08a34679df5cf47912181f927ea3e1af9a4a2b4bb056b9e1358b653ba62b5307
7
+ data.tar.gz: d4cbe132286800094fa7af36e833a7e5e9feced1cf5fb85592601fb2f2fc2349ac5dfbb76bfcad698fb6c77d90eb581b344529d3ef7e0e1391bd521e7333c42f
@@ -25,8 +25,11 @@ module WebFont
25
25
  downloader = WebFont::Downloader.new
26
26
  cache_path = WebFont::LocalCache.cache_path
27
27
 
28
- if cache_path && !Dir.exist?(cache_path)
28
+ if WebFont::LocalCache.enable?
29
29
  FileUtils.mkdir_p(cache_path)
30
+ else
31
+ raise 'WebFont::LocalCache.cache_path is empty or ' +
32
+ 'WebFont::LocalCache.cache is false.'
30
33
  end
31
34
 
32
35
  file_path = "#{WebFont::Index.path}/fonts.json"
@@ -35,8 +35,8 @@ module WebFont
35
35
  #
36
36
  # Returns nothing
37
37
  def self.download
38
- raise ArgumentError, 'path is empty' unless path
39
- raise ArgumentError, "ENV['GOOGLE_API_KEY'] is nil" unless ENV['GOOGLE_API_KEY']
38
+ raise 'WebFont::Index.path is empty' unless path
39
+ raise "ENV['GOOGLE_API_KEY'] is empty" unless ENV['GOOGLE_API_KEY']
40
40
 
41
41
  FileUtils.mkdir_p(path) unless Dir.exist?(path)
42
42
 
@@ -1,3 +1,3 @@
1
1
  module WebFont
2
- VERSION = '0.1.6'
2
+ VERSION = '0.1.7'
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.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sophy Eung