web_font 0.1.11 → 0.1.12

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: 2ae183fa487332dced1057571b3cc38f66dfbd8b
4
- data.tar.gz: 01dd9580374e4b9876be8f6e736a551afff975db
3
+ metadata.gz: 8220889934744728b0d93f18fb833c57a40be5f9
4
+ data.tar.gz: 335a4b44460e715803d284250d9db930f98fd3b4
5
5
  SHA512:
6
- metadata.gz: d4414f7ba24c86ec9f09a76292f9ba5875975b8bba70d4f4e58403181871462face98c662a71d640be93cf4aac81fe13caaa96d141eb0615fe20ad846172b485
7
- data.tar.gz: 072fa4b030642b596e148321d80c0758547f7a0288696c7cd50d7138f217a3fc8c80351defced18ff937836d8ed163e9cd77b35fd76223774c138d6892d3e2f5
6
+ metadata.gz: ab27f8a5b276480df711eead95e6a19b4b70b62eab416afb04162f5762e251240eca5fd648d49088adbaa8db1dca1052b07475b89d70ac2498a6d40afcff9ce4
7
+ data.tar.gz: f97aa97b25e739106c0ab4bb5c2001ab96af6c6b5e9eb33a7207a178cbce450d747e142938cb32827c20d8c76bed19291888a40538dd0637c1415709c5cb01a7
@@ -14,20 +14,25 @@ module WebFont
14
14
  item = finder.find(font_family)
15
15
  return if item.empty?
16
16
 
17
- font_family = item['family'].gsub(/\s/, '-')
17
+ downloaded_fonts = []
18
+ font_family = item['family'].gsub(/\s/, '-')
18
19
  item['files'].each do |variant, url|
19
20
  filename = "#{font_family}-#{variant}#{File.extname(url)}"
20
21
  font_path = File.join(destination_path, filename)
21
22
 
22
23
  if from_cache && LocalCache.enable? && cache_path = LocalCache.path(filename)
23
24
  FileUtils.copy(cache_path, destination_path)
25
+ downloaded_fonts << font_path
24
26
  else
25
27
  unless File.exist?(font_path)
26
28
  Command.wget(url, font_path)
27
29
  LocalCache.save(font_path)
30
+ downloaded_fonts << font_path
28
31
  end
29
32
  end
30
33
  end
34
+
35
+ downloaded_fonts
31
36
  end
32
37
  end
33
38
  end
@@ -1,3 +1,3 @@
1
1
  module WebFont
2
- VERSION = '0.1.11'
2
+ VERSION = '0.1.12'
3
3
  end