fontist 1.15.0 → 1.15.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fontist/cache_cli.rb +17 -3
- data/lib/fontist/system_index.rb +1 -1
- data/lib/fontist/utils/cache.rb +5 -1
- data/lib/fontist/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b05f079e527eb6128f6525bd4923886e5181d266a4cf88151a4131551694de15
|
4
|
+
data.tar.gz: 1b8ab3e7b58c1c96aa9565d0b244475e047d48823ae9deec6fb194ed95201de0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5aa9bbfcf8b155bd876c5f9d28f37fcbe13d1cb6729ecf7056e298457834370973d0898e80af6515a96e904255fe1da027545a0f3c6d601dc41cc26cd211c060
|
7
|
+
data.tar.gz: 6bae05a6ee7445abb41ee724fb01f07ebf2d7a7222ffc09744bb8b5acd4e2119949b35860f7b21d6bbdc2f8e81545a8115ccd7f2846beab1397842c5ae6b3e76
|
data/lib/fontist/cache_cli.rb
CHANGED
@@ -2,13 +2,27 @@ module Fontist
|
|
2
2
|
class CacheCLI < Thor
|
3
3
|
include CLI::ClassOptions
|
4
4
|
|
5
|
-
desc "clear", "Clear fontist
|
5
|
+
desc "clear", "Clear fontist cache"
|
6
6
|
def clear
|
7
7
|
handle_class_options(options)
|
8
8
|
dir = Fontist.downloads_path
|
9
|
-
dir.each_child(&:
|
10
|
-
|
9
|
+
dir.each_child(&:rmtree) if dir.exist?
|
10
|
+
clear_indexes
|
11
|
+
Fontist.ui.success("Cache has been successfully removed.")
|
11
12
|
CLI::STATUS_SUCCESS
|
12
13
|
end
|
14
|
+
|
15
|
+
private
|
16
|
+
|
17
|
+
def clear_indexes
|
18
|
+
delete_file_with_lock(Fontist.system_index_path)
|
19
|
+
delete_file_with_lock(Fontist.system_preferred_family_index_path)
|
20
|
+
end
|
21
|
+
|
22
|
+
def delete_file_with_lock(path)
|
23
|
+
path.delete if path.exist?
|
24
|
+
lock_path = Pathname.new Fontist::Utils::Cache.lock_path(path)
|
25
|
+
lock_path.delete if lock_path.exist?
|
26
|
+
end
|
13
27
|
end
|
14
28
|
end
|
data/lib/fontist/system_index.rb
CHANGED
data/lib/fontist/utils/cache.rb
CHANGED
@@ -3,6 +3,10 @@ module Fontist
|
|
3
3
|
class Cache
|
4
4
|
include Locking
|
5
5
|
|
6
|
+
def self.lock_path(path)
|
7
|
+
"#{path}.lock"
|
8
|
+
end
|
9
|
+
|
6
10
|
def fetch(key)
|
7
11
|
map = load_cache
|
8
12
|
if cache_exist?(map[key])
|
@@ -79,7 +83,7 @@ module Fontist
|
|
79
83
|
end
|
80
84
|
|
81
85
|
def lock_path
|
82
|
-
cache_map_path
|
86
|
+
Cache.lock_path(cache_map_path)
|
83
87
|
end
|
84
88
|
|
85
89
|
def move_to_downloads(source)
|
data/lib/fontist/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fontist
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.15.
|
4
|
+
version: 1.15.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-03-
|
11
|
+
date: 2023-03-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: down
|