web_font 0.0.6 → 0.0.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: 184ff8a59aa7e27841c201f7c93f93a6f0eb97c3
4
- data.tar.gz: 48911740783864c288235ef96f946537fb441f54
3
+ metadata.gz: 1a65e98054069cb5a64f371a802a508112c17848
4
+ data.tar.gz: df8c26b928c9c3cbf043d08d6476cb9ae4bb2836
5
5
  SHA512:
6
- metadata.gz: 1a330371700105c9818a37457e735aa32021f9bea2a4a2a7882adaca587d8c61b5dbcaeb1cc68546ee0f5028c5bb1a13c8dccf4458cfb12daf37df47dbb3ad5a
7
- data.tar.gz: 8c98d1c58047a4429ff5359297b45a419f25ab6632935468855465f279a69f2b83c10ca747d63f4b2f56bd1e5ee7caf787214c4ed3825c5628f6c50097995189
6
+ metadata.gz: bb6f2f62b2f78c74b3a1ccdb8f086d56622caa495f780c522ef9d71b057211d8d0b4b9149d8f894195d1dbdba42f5639445b3c85ce26b2de36f4296116e40885
7
+ data.tar.gz: cdef8e8049135364074b9d3d51baa488e6dc1f48ee0a3b9de1208f81f71e67f986c7027e1217f516149ee4e8bd0d311c49cc0447430f94521bef5ea98931e067
@@ -0,0 +1,7 @@
1
+ module WebFont
2
+ module Command
3
+ def self.wget(url, output_path)
4
+ system("wget -q -O #{output_path} #{url}")
5
+ end
6
+ end
7
+ end
data/lib/web_font/data.rb CHANGED
@@ -43,8 +43,9 @@ module WebFont
43
43
 
44
44
  FileUtils.mkdir_p(path) unless Dir.exist?(path)
45
45
 
46
- url = "https://www.googleapis.com/webfonts/v1/webfonts?key=#{ENV['GOOGLE_API_KEY']}"
47
- system("wget -q -O #{path}/fonts.json #{url}")
46
+ url = "https://www.googleapis.com/webfonts/v1/webfonts?key=#{ENV['GOOGLE_API_KEY']}"
47
+ output_path = "#{path}/fonts.json"
48
+ WebFont::Command.wget(url, output_path)
48
49
 
49
50
  index
50
51
  end
@@ -20,8 +20,9 @@ module WebFont
20
20
  item['files'].each do |variant, url|
21
21
  filename = File.join(destination_path, "#{font_family}-#{variant}")
22
22
  extname = File.extname(url)
23
+ font = "#{filename}#{extname}"
23
24
 
24
- system("wget -q -O #{filename}#{extname} #{url}") unless File.exist?("#{filename}#{extname}")
25
+ WebFont::Command.wget(url, font) unless File.exist?(font)
25
26
  end
26
27
  end
27
28
  end
@@ -1,3 +1,3 @@
1
1
  module WebFont
2
- VERSION = '0.0.6'
2
+ VERSION = '0.0.7'
3
3
  end
data/lib/web_font.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require 'web_font/version'
2
+ require 'web_font/command'
2
3
  require 'web_font/downloader'
3
4
  require 'web_font/data'
4
5
  require 'web_font/finder'