web_font 0.1.1 → 0.1.2
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 +4 -4
- data/lib/web_font/downloader.rb +2 -2
- data/lib/web_font/finder.rb +1 -1
- data/lib/web_font/index.rb +1 -1
- data/lib/web_font/local_cache.rb +6 -1
- data/lib/web_font/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8e82c28cd61268d82e7d3925b5988649d6d102ac
|
4
|
+
data.tar.gz: e8767e9107e5b23510a13e66419254210ef7331f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b6fedf64c46588879edd0de43347a48c031ea8b22b212f0bf1f3026f6508848b6eab60f7a4e028cba1f7bff1a4336b71c47c8e71513405d1c27ec48182bdd644
|
7
|
+
data.tar.gz: db6837dd1172c41666544677078d637a36855c3a46f762280e8e4b81a811a096b5fd37a4295b30e96beaf62b31a68446039f3dac79a6cb79ba155c17c53bb977
|
data/lib/web_font/downloader.rb
CHANGED
@@ -4,7 +4,7 @@ module WebFont
|
|
4
4
|
attr_reader :finder
|
5
5
|
|
6
6
|
def initialize
|
7
|
-
@finder =
|
7
|
+
@finder = Finder.new
|
8
8
|
end
|
9
9
|
|
10
10
|
# Download font from Google and save it locally
|
@@ -23,7 +23,7 @@ module WebFont
|
|
23
23
|
FileUtils.copy(cache_path, destination_path)
|
24
24
|
else
|
25
25
|
unless File.exist?(font_path)
|
26
|
-
|
26
|
+
Command.wget(url, font_path)
|
27
27
|
LocalCache.save(font_path)
|
28
28
|
end
|
29
29
|
end
|
data/lib/web_font/finder.rb
CHANGED
data/lib/web_font/index.rb
CHANGED
data/lib/web_font/local_cache.rb
CHANGED
@@ -9,8 +9,13 @@ module WebFont
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def save(font)
|
12
|
+
return nil unless cache_path
|
13
|
+
|
12
14
|
filename = File.basename(font)
|
13
|
-
|
15
|
+
path = File.join(cache_path, filename)
|
16
|
+
FileUtils.copy(font, path)
|
17
|
+
|
18
|
+
path
|
14
19
|
end
|
15
20
|
|
16
21
|
def enable?
|
data/lib/web_font/version.rb
CHANGED