fontist 3.0.4 → 3.0.6
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/font.rb +9 -2
- data/lib/fontist/manifest.rb +2 -29
- 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: 901ef91ebd6bdc2f41e97ecad10c4fe2e752f9b5dff6faa2d75a8d9065bea478
|
|
4
|
+
data.tar.gz: b793fbea7abd2f98fb8334682238b7e8f34168b69509a3641196799bf1b171b0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a3e4427e15dd34aecfb531bc1a25e980351c24d32515f58723b731ff0fa11467d450c3ef24feaf1661b23d5035147758d9cead9828c2a468e23ecc2230afa0bc
|
|
7
|
+
data.tar.gz: 8e0e6912a1bf8c3cd07d0c4f7c2699450c0e5b324c65f82392a74e5c5d60147f764996eb18caf079fea5707bac10cc66398f32e510405ee2d531127d17be14f3
|
data/lib/fontist/font.rb
CHANGED
|
@@ -4,7 +4,7 @@ module Fontist
|
|
|
4
4
|
class Font
|
|
5
5
|
def initialize(options = {})
|
|
6
6
|
@name = options[:name]
|
|
7
|
-
@confirmation = options[:confirmation]
|
|
7
|
+
@confirmation = options[:confirmation]
|
|
8
8
|
@hide_licenses = options[:hide_licenses]
|
|
9
9
|
@no_progress = options[:no_progress] || false
|
|
10
10
|
@force = options[:force] || false
|
|
@@ -270,7 +270,14 @@ module Fontist
|
|
|
270
270
|
return @confirmation if formula.licensed_for_current_platform?
|
|
271
271
|
|
|
272
272
|
show_license(formula) unless @hide_licenses
|
|
273
|
-
return @confirmation if @confirmation
|
|
273
|
+
return @confirmation if @confirmation&.casecmp?("yes")
|
|
274
|
+
|
|
275
|
+
# Explicit rejection: raise immediately without interactive prompt
|
|
276
|
+
if @confirmation&.casecmp?("no")
|
|
277
|
+
raise Fontist::Errors::LicensingError.new(
|
|
278
|
+
"Fontist will not download these fonts unless you accept the terms.",
|
|
279
|
+
)
|
|
280
|
+
end
|
|
274
281
|
|
|
275
282
|
confirmation = ask_for_agreement
|
|
276
283
|
if confirmation&.casecmp?("yes")
|
data/lib/fontist/manifest.rb
CHANGED
|
@@ -33,15 +33,9 @@ module Fontist
|
|
|
33
33
|
def style_paths(locations: false)
|
|
34
34
|
ary = Array(styles)
|
|
35
35
|
(ary.empty? ? [nil] : ary).flat_map do |style|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
if paths.nil? && locations
|
|
39
|
-
try_install_missing_font
|
|
40
|
-
paths = find_font_with_name(name, style)
|
|
41
|
-
raise Errors::MissingFontError.new(name, style) if paths.nil?
|
|
36
|
+
find_font_with_name(name, style).tap do |x|
|
|
37
|
+
raise Errors::MissingFontError.new(name, style) if x.nil? && locations
|
|
42
38
|
end
|
|
43
|
-
|
|
44
|
-
paths
|
|
45
39
|
end.compact
|
|
46
40
|
end
|
|
47
41
|
|
|
@@ -102,27 +96,6 @@ module Fontist
|
|
|
102
96
|
|
|
103
97
|
private
|
|
104
98
|
|
|
105
|
-
def try_install_missing_font
|
|
106
|
-
Fontist.ui.debug("self-healing install attempt for #{name.inspect}")
|
|
107
|
-
Fontist::Font.install(
|
|
108
|
-
name,
|
|
109
|
-
force: true,
|
|
110
|
-
confirmation: "no",
|
|
111
|
-
no_progress: true,
|
|
112
|
-
hide_licenses: true,
|
|
113
|
-
format_spec: format_spec,
|
|
114
|
-
)
|
|
115
|
-
rescue Fontist::Errors::FontError,
|
|
116
|
-
Fontist::Errors::LicensingError,
|
|
117
|
-
Fontist::Errors::PlatformMismatchError,
|
|
118
|
-
Fontist::Errors::FormulaIndexNotFoundError => e
|
|
119
|
-
Fontist.ui.debug(
|
|
120
|
-
"self-healing install for #{name.inspect} " \
|
|
121
|
-
"failed: #{e.class}: #{e.message}",
|
|
122
|
-
)
|
|
123
|
-
nil
|
|
124
|
-
end
|
|
125
|
-
|
|
126
99
|
def validate_location_parameter!(location)
|
|
127
100
|
return unless location
|
|
128
101
|
return if location.is_a?(Symbol)
|
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.6
|
|
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-18 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: down
|