fontist 3.0.6 → 3.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 +4 -4
- data/lib/fontist/indexes/base_font_collection_index.rb +9 -2
- data/lib/fontist/system_index.rb +1 -5
- 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: 473f97386abfc5612b2386ef09c7166f57577346e1fa1576f10b89cde776a82a
|
|
4
|
+
data.tar.gz: 496fe338410ab4a2fca8d03f51de0030ed831e365e3dd310f9a26f92bb441d16
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3df014b751d95d4e5c9b1ca536e51b8209a0edc85d35fa5e5f277016ef8b1a4a605b2592057afd74b466537446cd3594ea294f3c820530b393c078ce785e1e86
|
|
7
|
+
data.tar.gz: cedd3d33a01cd1ceba826848c09ffb40dda37080bd5a1a4aa4db68dfd95a25869b9080ea4b8b1ba82eb01ebfae45602e35439fe6861730cba4ce5f16a9b8913d
|
|
@@ -41,14 +41,21 @@ module Fontist
|
|
|
41
41
|
# Get the collection, initializing it lazily if nil
|
|
42
42
|
#
|
|
43
43
|
# Uses lazy initialization so that the collection is created with fresh
|
|
44
|
-
# font_paths each time it's accessed after reset_cache
|
|
44
|
+
# font_paths each time it's accessed after reset_cache.
|
|
45
|
+
#
|
|
46
|
+
# On cold start (no on-disk index file), eagerly build the index once
|
|
47
|
+
# so that `fonts` reflects an authoritative scan. This lets callers in
|
|
48
|
+
# read-only mode trust the cached `fonts` without re-running `build` on
|
|
49
|
+
# every lookup.
|
|
45
50
|
#
|
|
46
51
|
# @return [SystemIndexFontCollection] The collection object
|
|
47
52
|
def collection
|
|
48
53
|
@collection ||= SystemIndexFontCollection.from_file(
|
|
49
54
|
path: index_path,
|
|
50
55
|
paths_loader: -> { font_paths },
|
|
51
|
-
)
|
|
56
|
+
).tap do |coll|
|
|
57
|
+
coll.build unless File.exist?(index_path)
|
|
58
|
+
end
|
|
52
59
|
end
|
|
53
60
|
|
|
54
61
|
# Enable read-only mode for operations that don't need index rebuilding
|
data/lib/fontist/system_index.rb
CHANGED
|
@@ -229,11 +229,7 @@ module Fontist
|
|
|
229
229
|
end
|
|
230
230
|
|
|
231
231
|
def index
|
|
232
|
-
|
|
233
|
-
# But we still need to build on first access — treat an empty fonts list
|
|
234
|
-
# the same as nil, since Lutaml initializes `instances :fonts` to `[]`
|
|
235
|
-
# rather than nil when the on-disk index file is absent.
|
|
236
|
-
if @read_only_mode && !fonts.nil? && !fonts.empty?
|
|
232
|
+
if @read_only_mode && !fonts.nil?
|
|
237
233
|
return fonts
|
|
238
234
|
end
|
|
239
235
|
|
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: 3.0.
|
|
4
|
+
version: 3.0.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-05-
|
|
11
|
+
date: 2026-05-20 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: down
|