fontist 3.0.0 → 3.0.1

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.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop_todo.yml +179 -139
  3. data/fontist.gemspec +2 -2
  4. data/lib/fontist/cache/store.rb +1 -1
  5. data/lib/fontist/cli.rb +2 -1
  6. data/lib/fontist/errors.rb +3 -3
  7. data/lib/fontist/extract.rb +1 -0
  8. data/lib/fontist/font.rb +2 -2
  9. data/lib/fontist/font_finder.rb +1 -2
  10. data/lib/fontist/font_installer.rb +14 -14
  11. data/lib/fontist/format_matcher.rb +4 -2
  12. data/lib/fontist/format_spec.rb +1 -1
  13. data/lib/fontist/formula.rb +4 -3
  14. data/lib/fontist/formula_picker.rb +5 -3
  15. data/lib/fontist/import/formula_builder.rb +1 -1
  16. data/lib/fontist/import/google/data_sources/github.rb +4 -4
  17. data/lib/fontist/import/google/font_database.rb +8 -8
  18. data/lib/fontist/import/google/formula_builders/formula_builder_v4.rb +1 -1
  19. data/lib/fontist/import/google/formula_builders/formula_builder_v5.rb +9 -3
  20. data/lib/fontist/import/google/metadata_adapter.rb +6 -6
  21. data/lib/fontist/import/google/models/font_family.rb +1 -1
  22. data/lib/fontist/import/import_display.rb +5 -5
  23. data/lib/fontist/import/macos_importer.rb +1 -1
  24. data/lib/fontist/import/upgrade_formulas.rb +1 -3
  25. data/lib/fontist/import/v4_to_v5_migrator.rb +2 -1
  26. data/lib/fontist/import.rb +2 -1
  27. data/lib/fontist/indexes/directory_snapshot.rb +2 -2
  28. data/lib/fontist/indexes/incremental_scanner.rb +2 -2
  29. data/lib/fontist/indexes.rb +8 -4
  30. data/lib/fontist/macos/catalog/asset.rb +2 -2
  31. data/lib/fontist/macos_import_source.rb +0 -1
  32. data/lib/fontist/repo.rb +1 -1
  33. data/lib/fontist/system_index.rb +5 -5
  34. data/lib/fontist/utils/downloader.rb +2 -2
  35. data/lib/fontist/utils/system.rb +2 -2
  36. data/lib/fontist/validation.rb +1 -1
  37. data/lib/fontist/validator.rb +2 -2
  38. data/lib/fontist/version.rb +1 -1
  39. data/lib/fontist.rb +2 -1
  40. metadata +6 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ab7d070a986f52cb3b93a83eeef69a76b72ef07881276a5090e373bc4758f682
4
- data.tar.gz: eb5eeceeb19c10b0d3537549067e2e8332253dc864c722873c1e39ca50a800bd
3
+ metadata.gz: afb1c6bc21c216e16a0a2bb42de770866575bbf424bd8d3d49bf99d5eec80cb5
4
+ data.tar.gz: 5d72a4edb96a6f39e2d058cbe312d392f62e50d73bdfbf8a168b82492155e9b4
5
5
  SHA512:
6
- metadata.gz: abf247ac6988a9f812c04c265a07d8f397e5f80eb874471b0c354d523de94f66ccc66ab6e6708560698e50008e413c8e07054632a6c3aff6d5f6e1b80dacef58
7
- data.tar.gz: 138d53e9d110fe58520360adbdc37a5c7c6f0aacee634cb269ed706fd6eeb319c7add2873646adec2009431e469189c051d92c2d80de3e59f6d7060ee1ca8894
6
+ metadata.gz: 77746091e20120805c19eb0a912c3f0a9eb101d88522afc4dd3cc45902922ce301bcf8aa909b23bb6ef664c615fb648dc5990e314a36227c774cfa63d0714e09
7
+ data.tar.gz: 7b900979917db2a7b973c9541bb2be9ff6b1dac5016128f9e082763136f648f0647a3519868efb6fa665b9d094d8377981cb6d7f3101f33262d8ea898c5e3718
data/.rubocop_todo.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2026-03-18 07:11:54 UTC using RuboCop version 1.85.1.
3
+ # on 2026-05-02 05:04:17 UTC using RuboCop version 1.86.1.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
@@ -8,16 +8,77 @@
8
8
 
9
9
  # Offense count: 1
10
10
  # This cop supports safe autocorrection (--autocorrect).
11
- Layout/ElseAlignment:
11
+ Gemspec/RequireMFA:
12
+ Exclude:
13
+ - 'docs/node_modules/speakingurl/speakingurl-rails.gemspec'
14
+
15
+ # Offense count: 1
16
+ Gemspec/RequiredRubyVersion:
12
17
  Exclude:
13
- - 'script/validate_v5_urls.rb'
18
+ - 'docs/node_modules/speakingurl/speakingurl-rails.gemspec'
19
+
20
+ # Offense count: 7
21
+ # This cop supports safe autocorrection (--autocorrect).
22
+ # Configuration parameters: EnforcedStyle, IndentationWidth.
23
+ # SupportedStyles: with_first_argument, with_fixed_indentation
24
+ Layout/ArgumentAlignment:
25
+ Exclude:
26
+ - 'lib/fontist.rb'
27
+ - 'lib/fontist/import.rb'
28
+ - 'lib/fontist/indexes.rb'
29
+ - 'spec/fontist/import/v4_to_v5_migrator_spec.rb'
14
30
 
15
31
  # Offense count: 3
16
32
  # This cop supports safe autocorrection (--autocorrect).
33
+ # Configuration parameters: EnforcedStyle, IndentationWidth.
34
+ # SupportedStyles: with_first_element, with_fixed_indentation
35
+ Layout/ArrayAlignment:
36
+ Exclude:
37
+ - 'lib/fontist/import/google/formula_builders/formula_builder_v5.rb'
38
+ - 'spec/fontist/import/create_formula_spec.rb'
39
+ - 'spec/fontist/v5_integration_spec.rb'
40
+
41
+ # Offense count: 1
42
+ # This cop supports safe autocorrection (--autocorrect).
43
+ # Configuration parameters: IndentationWidth.
44
+ Layout/AssignmentIndentation:
45
+ Exclude:
46
+ - 'lib/fontist/import/google/formula_builders/formula_builder_v5.rb'
47
+
48
+ # Offense count: 6
49
+ # This cop supports safe autocorrection (--autocorrect).
50
+ # Configuration parameters: EnforcedStyleAlignWith.
51
+ # SupportedStylesAlignWith: either, start_of_block, start_of_line
52
+ Layout/BlockAlignment:
53
+ Exclude:
54
+ - 'lib/fontist/font_installer.rb'
55
+ - 'lib/fontist/format_matcher.rb'
56
+ - 'lib/fontist/formula_picker.rb'
57
+ - 'lib/fontist/import/google/formula_builders/formula_builder_v5.rb'
58
+ - 'lib/fontist/indexes/directory_snapshot.rb'
59
+ - 'spec/fontist/v5_integration_spec.rb'
60
+
61
+ # Offense count: 5
62
+ # This cop supports safe autocorrection (--autocorrect).
63
+ Layout/BlockEndNewline:
64
+ Exclude:
65
+ - 'lib/fontist/font_installer.rb'
66
+ - 'lib/fontist/format_matcher.rb'
67
+ - 'lib/fontist/formula_picker.rb'
68
+ - 'lib/fontist/import/google/formula_builders/formula_builder_v5.rb'
69
+ - 'spec/fontist/v5_integration_spec.rb'
70
+
71
+ # Offense count: 2
72
+ # This cop supports safe autocorrection (--autocorrect).
73
+ Layout/ElseAlignment:
74
+ Exclude:
75
+ - 'lib/fontist/font_installer.rb'
76
+
77
+ # Offense count: 1
78
+ # This cop supports safe autocorrection (--autocorrect).
17
79
  Layout/EmptyLineAfterGuardClause:
18
80
  Exclude:
19
81
  - 'lib/fontist/extract.rb'
20
- - 'script/validate_v5_urls.rb'
21
82
 
22
83
  # Offense count: 2
23
84
  # This cop supports safe autocorrection (--autocorrect).
@@ -36,22 +97,30 @@ Layout/EmptyLinesAroundClassBody:
36
97
  Exclude:
37
98
  - 'lib/fontist/font_finder.rb'
38
99
 
100
+ # Offense count: 1
101
+ # This cop supports safe autocorrection (--autocorrect).
102
+ Layout/EmptyLinesAroundMethodBody:
103
+ Exclude:
104
+ - 'lib/fontist/font_installer.rb'
105
+
39
106
  # Offense count: 1
40
107
  # This cop supports safe autocorrection (--autocorrect).
41
108
  # Configuration parameters: EnforcedStyleAlignWith.
42
109
  # SupportedStylesAlignWith: keyword, variable, start_of_line
43
110
  Layout/EndAlignment:
44
111
  Exclude:
45
- - 'script/validate_v5_urls.rb'
112
+ - 'lib/fontist/font_installer.rb'
46
113
 
47
- # Offense count: 1
114
+ # Offense count: 5
48
115
  # This cop supports safe autocorrection (--autocorrect).
49
116
  # Configuration parameters: AllowForAlignment, AllowBeforeTrailingComments, ForceEqualSignAlignment.
50
117
  Layout/ExtraSpacing:
51
118
  Exclude:
119
+ - 'docs/node_modules/speakingurl/lib/speakingurl-rails.rb'
120
+ - 'docs/node_modules/speakingurl/speakingurl-rails.gemspec'
52
121
  - 'lib/fontist/import/google/formula_builders/formula_builder_v4.rb'
53
122
 
54
- # Offense count: 15
123
+ # Offense count: 4
55
124
  # This cop supports safe autocorrection (--autocorrect).
56
125
  # Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle.
57
126
  # SupportedHashRocketStyles: key, separator, table
@@ -59,15 +128,31 @@ Layout/ExtraSpacing:
59
128
  # SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit
60
129
  Layout/HashAlignment:
61
130
  Exclude:
62
- - 'script/validate_v5_urls.rb'
131
+ - 'docs/node_modules/speakingurl/speakingurl-rails.gemspec'
132
+ - 'lib/fontist/cli.rb'
133
+ - 'lib/fontist/formula.rb'
134
+ - 'lib/fontist/import/v4_to_v5_migrator.rb'
63
135
 
64
136
  # Offense count: 1
65
137
  # This cop supports safe autocorrection (--autocorrect).
138
+ # Configuration parameters: EnforcedStyle.
139
+ # SupportedStyles: normal, indented_internal_methods
140
+ Layout/IndentationConsistency:
141
+ Exclude:
142
+ - 'lib/fontist/font_installer.rb'
143
+
144
+ # Offense count: 14
145
+ # This cop supports safe autocorrection (--autocorrect).
66
146
  # Configuration parameters: Width, EnforcedStyleAlignWith, AllowedPatterns.
67
147
  # SupportedStylesAlignWith: start_of_line, relative_to_receiver
68
148
  Layout/IndentationWidth:
69
149
  Exclude:
70
- - 'script/validate_v5_urls.rb'
150
+ - 'lib/fontist/font_installer.rb'
151
+ - 'lib/fontist/format_matcher.rb'
152
+ - 'lib/fontist/formula_picker.rb'
153
+ - 'lib/fontist/import/google/formula_builders/formula_builder_v5.rb'
154
+ - 'lib/fontist/indexes/directory_snapshot.rb'
155
+ - 'spec/fontist/v5_integration_spec.rb'
71
156
 
72
157
  # Offense count: 1
73
158
  # This cop supports safe autocorrection (--autocorrect).
@@ -90,7 +175,7 @@ Layout/LineContinuationSpacing:
90
175
  Exclude:
91
176
  - 'lib/fontist/import/google/data_sources/github.rb'
92
177
 
93
- # Offense count: 1
178
+ # Offense count: 3
94
179
  # This cop supports safe autocorrection (--autocorrect).
95
180
  # Configuration parameters: EnforcedStyle, IndentationWidth.
96
181
  # SupportedStyles: aligned, indented
@@ -98,20 +183,39 @@ Layout/LineEndStringConcatenationIndentation:
98
183
  Exclude:
99
184
  - 'lib/fontist/errors.rb'
100
185
 
101
- # Offense count: 674
186
+ # Offense count: 610
102
187
  # This cop supports safe autocorrection (--autocorrect).
103
188
  # Configuration parameters: Max, AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, AllowRBSInlineAnnotation, AllowCopDirectives, AllowedPatterns, SplitStrings.
104
189
  # URISchemes: http, https
105
190
  Layout/LineLength:
106
191
  Enabled: false
107
192
 
108
- # Offense count: 1
193
+ # Offense count: 5
109
194
  # This cop supports safe autocorrection (--autocorrect).
110
- # Configuration parameters: EnforcedStyle, IndentationWidth.
111
- # SupportedStyles: aligned, indented
112
- Layout/MultilineOperationIndentation:
195
+ # Configuration parameters: AllowForAlignment, EnforcedStyleForExponentOperator, EnforcedStyleForRationalLiterals.
196
+ # SupportedStylesForExponentOperator: space, no_space
197
+ # SupportedStylesForRationalLiterals: space, no_space
198
+ Layout/SpaceAroundOperators:
113
199
  Exclude:
114
- - 'script/validate_v5_formulas.rb'
200
+ - 'docs/node_modules/speakingurl/lib/speakingurl-rails.rb'
201
+ - 'docs/node_modules/speakingurl/speakingurl-rails.gemspec'
202
+
203
+ # Offense count: 15
204
+ # This cop supports safe autocorrection (--autocorrect).
205
+ # Configuration parameters: AllowInHeredoc.
206
+ Layout/TrailingWhitespace:
207
+ Exclude:
208
+ - 'lib/fontist.rb'
209
+ - 'lib/fontist/cli.rb'
210
+ - 'lib/fontist/font_installer.rb'
211
+ - 'lib/fontist/formula.rb'
212
+ - 'lib/fontist/import.rb'
213
+ - 'lib/fontist/import/google/formula_builders/formula_builder_v5.rb'
214
+ - 'lib/fontist/import/v4_to_v5_migrator.rb'
215
+ - 'lib/fontist/indexes.rb'
216
+ - 'spec/fontist/import/create_formula_spec.rb'
217
+ - 'spec/fontist/import/v4_to_v5_migrator_spec.rb'
218
+ - 'spec/fontist/v5_integration_spec.rb'
115
219
 
116
220
  # Offense count: 5
117
221
  # This cop supports safe autocorrection (--autocorrect).
@@ -134,11 +238,10 @@ Lint/DuplicateBranch:
134
238
  - 'lib/fontist/import/import_display.rb'
135
239
  - 'lib/fontist/utils/downloader.rb'
136
240
 
137
- # Offense count: 2
241
+ # Offense count: 1
138
242
  Lint/DuplicateMethods:
139
243
  Exclude:
140
244
  - 'lib/fontist/import/recursive_extraction.rb'
141
- - 'lib/fontist/system_index.rb'
142
245
 
143
246
  # Offense count: 9
144
247
  # Configuration parameters: AllowComments, AllowEmptyLambdas.
@@ -157,7 +260,7 @@ Lint/NoReturnInBeginEndBlocks:
157
260
  Exclude:
158
261
  - 'lib/fontist/font_installer.rb'
159
262
 
160
- # Offense count: 31
263
+ # Offense count: 27
161
264
  # This cop supports unsafe autocorrection (--autocorrect-all).
162
265
  Lint/NonAtomicFileOperation:
163
266
  Exclude:
@@ -177,44 +280,31 @@ Lint/NonAtomicFileOperation:
177
280
  - 'spec/support/system_fonts.rb'
178
281
  - 'spec/support/windows_test_helper.rb'
179
282
 
180
- # Offense count: 2
181
- # This cop supports safe autocorrection (--autocorrect).
182
- Lint/ScriptPermission:
183
- Exclude:
184
- - 'script/test_platform_license_skip.rb'
185
- - 'script/validate_v5_urls.rb'
186
-
187
- # Offense count: 2
283
+ # Offense count: 1
188
284
  # This cop supports safe autocorrection (--autocorrect).
189
285
  # Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods, IgnoreNotImplementedMethods, NotImplementedExceptions.
190
286
  # NotImplementedExceptions: NotImplementedError
191
287
  Lint/UnusedMethodArgument:
192
288
  Exclude:
193
289
  - 'lib/fontist/validator.rb'
194
- - 'script/test_v5_install.rb'
195
290
 
196
- # Offense count: 120
291
+ # Offense count: 115
197
292
  # Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes, Max.
198
293
  Metrics/AbcSize:
199
294
  Enabled: false
200
295
 
201
- # Offense count: 19
296
+ # Offense count: 9
202
297
  # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
203
298
  # AllowedMethods: refine
204
299
  Metrics/BlockLength:
205
- Max: 217
206
-
207
- # Offense count: 4
208
- # Configuration parameters: CountBlocks, CountModifierForms.
209
- Metrics/BlockNesting:
210
- Max: 4
300
+ Max: 63
211
301
 
212
302
  # Offense count: 72
213
303
  # Configuration parameters: AllowedMethods, AllowedPatterns, Max.
214
304
  Metrics/CyclomaticComplexity:
215
305
  Enabled: false
216
306
 
217
- # Offense count: 192
307
+ # Offense count: 187
218
308
  # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
219
309
  Metrics/MethodLength:
220
310
  Max: 129
@@ -224,7 +314,7 @@ Metrics/MethodLength:
224
314
  Metrics/ParameterLists:
225
315
  Max: 7
226
316
 
227
- # Offense count: 55
317
+ # Offense count: 53
228
318
  # Configuration parameters: AllowedMethods, AllowedPatterns, Max.
229
319
  Metrics/PerceivedComplexity:
230
320
  Enabled: false
@@ -258,39 +348,40 @@ Naming/PredicatePrefix:
258
348
  - 'spec/**/*'
259
349
  - 'lib/fontist/import/google/formula_builders/formula_builder_v5.rb'
260
350
 
261
- # Offense count: 5
351
+ # Offense count: 4
262
352
  # Configuration parameters: MinSize.
263
353
  Performance/CollectionLiteralInLoop:
264
354
  Exclude:
265
355
  - 'lib/fontist/cache/manager.rb'
266
356
  - 'lib/fontist/import/otf/font_file.rb'
267
- - 'script/test_v5_install.rb'
268
357
  - 'spec/fontist/import/create_formula_spec.rb'
269
358
 
270
- # Offense count: 23
359
+ # Offense count: 21
271
360
  # This cop supports unsafe autocorrection (--autocorrect-all).
272
361
  Performance/MapCompact:
273
362
  Enabled: false
274
363
 
275
- # Offense count: 1
276
- # This cop supports unsafe autocorrection (--autocorrect-all).
277
- Performance/TimesMap:
278
- Exclude:
279
- - 'script/validate_v5_urls.rb'
280
-
281
364
  # Offense count: 2
282
365
  Security/MarshalLoad:
283
366
  Exclude:
284
367
  - 'lib/fontist/cache/store.rb'
285
368
  - 'spec/fontist/cache/store_spec.rb'
286
369
 
287
- # Offense count: 1
370
+ # Offense count: 6
288
371
  # This cop supports safe autocorrection (--autocorrect).
289
- # Configuration parameters: EnforcedStyle, SingleLineConditionsOnly, IncludeTernaryExpressions.
290
- # SupportedStyles: assign_to_condition, assign_inside_condition
291
- Style/ConditionalAssignment:
372
+ # Configuration parameters: EnforcedStyle, ProceduralMethods, FunctionalMethods, AllowedMethods, AllowedPatterns, AllowBracesOnProceduralOneLiners, BracesRequiredMethods.
373
+ # SupportedStyles: line_count_based, semantic, braces_for_chaining, always_braces
374
+ # ProceduralMethods: benchmark, bm, bmbm, create, each_with_object, measure, new, realtime, tap, with_object
375
+ # FunctionalMethods: let, let!, subject, watch
376
+ # AllowedMethods: lambda, proc, it
377
+ Style/BlockDelimiters:
292
378
  Exclude:
293
- - 'script/validate_v5_urls.rb'
379
+ - 'lib/fontist/font_installer.rb'
380
+ - 'lib/fontist/format_matcher.rb'
381
+ - 'lib/fontist/formula_picker.rb'
382
+ - 'lib/fontist/import/google/formula_builders/formula_builder_v5.rb'
383
+ - 'spec/fontist/font_installer_spec.rb'
384
+ - 'spec/fontist/v5_integration_spec.rb'
294
385
 
295
386
  # Offense count: 4
296
387
  # This cop supports safe autocorrection (--autocorrect).
@@ -301,7 +392,14 @@ Style/EmptyStringInsideInterpolation:
301
392
  - 'lib/fontist/import/import_display.rb'
302
393
  - 'lib/fontist/import/macos_importer.rb'
303
394
 
304
- # Offense count: 12
395
+ # Offense count: 2
396
+ # This cop supports safe autocorrection (--autocorrect).
397
+ Style/ExpandPathArguments:
398
+ Exclude:
399
+ - 'docs/node_modules/speakingurl/lib/speakingurl-rails.rb'
400
+ - 'docs/node_modules/speakingurl/speakingurl-rails.gemspec'
401
+
402
+ # Offense count: 13
305
403
  # This cop supports safe autocorrection (--autocorrect).
306
404
  # Configuration parameters: AllowedVars, DefaultToNil.
307
405
  Style/FetchEnvVar:
@@ -315,6 +413,7 @@ Style/FetchEnvVar:
315
413
  - 'spec/support/fontist_helper.rb'
316
414
  - 'spec/support/fresh_home.rb'
317
415
  - 'spec/support/vcr_setup.rb'
416
+ - 'spec/support/windows_test_helper.rb'
318
417
 
319
418
  # Offense count: 1
320
419
  Style/FileOpen:
@@ -340,22 +439,23 @@ Style/HashLikeCase:
340
439
  Exclude:
341
440
  - 'spec/support/platform_fonts.rb'
342
441
 
343
- # Offense count: 6
442
+ # Offense count: 1
443
+ # This cop supports safe autocorrection (--autocorrect).
444
+ # Configuration parameters: EnforcedStyle, EnforcedShorthandSyntax, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols.
445
+ # SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys
446
+ # SupportedShorthandSyntax: always, never, either, consistent, either_consistent
447
+ Style/HashSyntax:
448
+ Exclude:
449
+ - 'docs/node_modules/speakingurl/lib/speakingurl-rails.rb'
450
+
451
+ # Offense count: 4
344
452
  # This cop supports unsafe autocorrection (--autocorrect-all).
345
453
  Style/IdenticalConditionalBranches:
346
454
  Exclude:
347
455
  - 'lib/fontist/helpers.rb'
348
456
  - 'lib/fontist/import/import_display.rb'
349
- - 'script/validate_v5_urls.rb'
350
-
351
- # Offense count: 1
352
- # This cop supports safe autocorrection (--autocorrect).
353
- # Configuration parameters: AllowIfModifier.
354
- Style/IfInsideElse:
355
- Exclude:
356
- - 'script/validate_v5_formulas.rb'
357
457
 
358
- # Offense count: 3
458
+ # Offense count: 4
359
459
  # This cop supports unsafe autocorrection (--autocorrect-all).
360
460
  Style/MapToHash:
361
461
  Exclude:
@@ -363,34 +463,21 @@ Style/MapToHash:
363
463
  - 'lib/fontist/utils/downloader.rb'
364
464
  - 'spec/fontist/indexes/incremental_scanner_spec.rb'
365
465
 
366
- # Offense count: 22
367
- # This cop supports unsafe autocorrection (--autocorrect-all).
368
- # Configuration parameters: EnforcedStyle, AllowedMethods, AllowedPatterns.
369
- # SupportedStyles: predicate, comparison
370
- Style/NumericPredicate:
371
- Exclude:
372
- - 'spec/**/*'
373
- - 'script/test_platform_license_skip.rb'
374
- - 'script/test_v5_install.rb'
375
- - 'script/validate_v5_formulas.rb'
376
- - 'script/validate_v5_urls.rb'
377
-
378
- # Offense count: 1
379
- # Configuration parameters: AllowedClasses.
380
- Style/OneClassPerFile:
466
+ # Offense count: 2
467
+ # This cop supports safe autocorrection (--autocorrect).
468
+ Style/MultilineIfModifier:
381
469
  Exclude:
382
- - 'script/validate_v5_urls.rb'
470
+ - 'lib/fontist/import/google/formula_builders/formula_builder_v5.rb'
383
471
 
384
472
  # Offense count: 1
385
473
  Style/OpenStructUse:
386
474
  Exclude:
387
475
  - 'spec/fontist/cache/store_spec.rb'
388
476
 
389
- # Offense count: 2
477
+ # Offense count: 1
390
478
  # This cop supports unsafe autocorrection (--autocorrect-all).
391
479
  Style/PartitionInsteadOfDoubleSelect:
392
480
  Exclude:
393
- - 'script/validate_v5_urls.rb'
394
481
  - 'spec/fontist/import/google/data_sources/vf_spec.rb'
395
482
 
396
483
  # Offense count: 3
@@ -400,18 +487,11 @@ Style/ReduceToHash:
400
487
  - 'lib/fontist/import/google/font_database.rb'
401
488
  - 'lib/fontist/indexes/directory_snapshot.rb'
402
489
 
403
- # Offense count: 2
490
+ # Offense count: 1
404
491
  # This cop supports safe autocorrection (--autocorrect).
405
492
  Style/RedundantBegin:
406
493
  Exclude:
407
494
  - 'lib/fontist/font_installer.rb'
408
- - 'script/validate_v5_urls.rb'
409
-
410
- # Offense count: 2
411
- # This cop supports safe autocorrection (--autocorrect).
412
- Style/RedundantParentheses:
413
- Exclude:
414
- - 'script/validate_v5_urls.rb'
415
495
 
416
496
  # Offense count: 1
417
497
  # This cop supports safe autocorrection (--autocorrect).
@@ -419,68 +499,35 @@ Style/RedundantRegexpArgument:
419
499
  Exclude:
420
500
  - 'lib/fontist/repo.rb'
421
501
 
422
- # Offense count: 9
423
- # This cop supports safe autocorrection (--autocorrect).
424
- Style/RescueModifier:
425
- Exclude:
426
- - 'script/validate_v5_urls.rb'
427
-
428
- # Offense count: 11
429
- # This cop supports safe autocorrection (--autocorrect).
430
- # Configuration parameters: EnforcedStyle.
431
- # SupportedStyles: implicit, explicit
432
- Style/RescueStandardError:
433
- Exclude:
434
- - 'script/test_platform_license_skip.rb'
435
- - 'script/test_v5_install.rb'
436
- - 'script/validate_v5_formulas.rb'
437
- - 'script/validate_v5_urls.rb'
438
-
439
- # Offense count: 3
440
- # This cop supports unsafe autocorrection (--autocorrect-all).
441
- # Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods, MaxChainLength.
442
- # AllowedMethods: present?, blank?, presence, try, try!
443
- Style/SafeNavigation:
444
- Exclude:
445
- - 'script/test_v5_install.rb'
446
- - 'script/validate_v5_formulas.rb'
447
- - 'script/validate_v5_urls.rb'
448
-
449
502
  # Offense count: 1
450
503
  # Configuration parameters: Max.
451
504
  Style/SafeNavigationChainLength:
452
505
  Exclude:
453
506
  - 'lib/fontist/system_index.rb'
454
507
 
455
- # Offense count: 2
456
- # This cop supports safe autocorrection (--autocorrect).
457
- # Configuration parameters: AllowModifier.
458
- Style/SoleNestedConditional:
459
- Exclude:
460
- - 'script/validate_v5_formulas.rb'
461
- - 'script/validate_v5_urls.rb'
462
-
463
508
  # Offense count: 1
464
- # This cop supports safe autocorrection (--autocorrect).
465
- Style/StderrPuts:
466
- Exclude:
467
- - 'script/validate_v5_urls.rb'
468
-
469
- # Offense count: 3
470
509
  # This cop supports unsafe autocorrection (--autocorrect-all).
471
510
  # Configuration parameters: Mode.
472
511
  Style/StringConcatenation:
473
512
  Exclude:
474
- - 'script/validate_v5_formulas.rb'
475
513
  - 'spec/fontist/system_index_spec.rb'
476
514
 
515
+ # Offense count: 7
516
+ # This cop supports safe autocorrection (--autocorrect).
517
+ # Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
518
+ # SupportedStyles: single_quotes, double_quotes
519
+ Style/StringLiterals:
520
+ Exclude:
521
+ - 'docs/node_modules/speakingurl/lib/speakingurl-rails.rb'
522
+ - 'docs/node_modules/speakingurl/speakingurl-rails.gemspec'
523
+
477
524
  # Offense count: 1
478
525
  # This cop supports safe autocorrection (--autocorrect).
479
526
  Style/SuperArguments:
480
527
  Exclude:
481
528
  - 'lib/fontist/import/google/models/font_family.rb'
482
529
 
483
- # Offense count: 3
530
+ # Offense count: 2
484
531
  # This cop supports unsafe autocorrection (--autocorrect-all).
485
532
  # Configuration parameters: AllowMethodsWithArguments, AllowedMethods, AllowedPatterns, AllowComments.
486
533
  # AllowedMethods: define_method
@@ -488,7 +535,6 @@ Style/SymbolProc:
488
535
  Exclude:
489
536
  - 'lib/fontist/font_installer.rb'
490
537
  - 'lib/fontist/format_matcher.rb'
491
- - 'script/validate_v5_formulas.rb'
492
538
 
493
539
  # Offense count: 1
494
540
  # This cop supports safe autocorrection (--autocorrect).
@@ -497,9 +543,3 @@ Style/SymbolProc:
497
543
  Style/TrailingCommaInArguments:
498
544
  Exclude:
499
545
  - 'spec/fontist/v5_integration_spec.rb'
500
-
501
- # Offense count: 4
502
- # This cop supports unsafe autocorrection (--autocorrect-all).
503
- Style/ZeroLengthPredicate:
504
- Exclude:
505
- - 'script/validate_v5_urls.rb'
data/fontist.gemspec CHANGED
@@ -31,11 +31,11 @@ Gem::Specification.new do |spec|
31
31
 
32
32
  spec.add_dependency "down", "~> 5.0"
33
33
  spec.add_dependency "excavate", "~> 1.0", ">= 1.0.3"
34
- spec.add_dependency "fontisan", "~> 0.2", ">= 0.2.11"
34
+ spec.add_dependency "fontisan", "~> 0.2", ">= 0.2.16"
35
35
  spec.add_dependency "fuzzy_match", "~> 2.1"
36
36
  spec.add_dependency "git", "> 1.0"
37
37
  spec.add_dependency "json", "~> 2.0"
38
- spec.add_dependency "lutaml-model", "~> 0.7"
38
+ spec.add_dependency "lutaml-model", "~> 0.8.0"
39
39
  spec.add_dependency "marcel", "~> 1.0"
40
40
  spec.add_dependency "nokogiri", "~> 1.0"
41
41
  spec.add_dependency "octokit", "~> 4.0"
@@ -57,7 +57,7 @@ module Fontist
57
57
  attr_reader :cache_dir
58
58
 
59
59
  def ensure_cache_dir
60
- FileUtils.mkdir_p(@cache_dir) unless Dir.exist?(@cache_dir)
60
+ FileUtils.mkdir_p(@cache_dir)
61
61
  end
62
62
 
63
63
  def cache_path(key)
data/lib/fontist/cli.rb CHANGED
@@ -338,7 +338,8 @@ module Fontist
338
338
  "Uses `fnmatch` patterns."
339
339
  option :name_prefix, desc: "Prefix to add to all font family names, " \
340
340
  "e.g. 'Wine ' for compatibility fonts"
341
- option :schema_version, type: :numeric, default: 5, desc: "Formula schema version (default: 5)"
341
+ option :schema_version, type: :numeric, default: 5,
342
+ desc: "Formula schema version (default: 5)"
342
343
  def create_formula(url)
343
344
  handle_class_options(options)
344
345
  name = Fontist::Import::CreateFormula.new(url, options).call
@@ -159,9 +159,9 @@ module Fontist
159
159
 
160
160
  def build_message(font_name)
161
161
  "Font '#{font_name}' is only available for: #{@required_platforms.join(', ')}. " \
162
- "Your current platform is: #{@current_platform}. " \
163
- "This font is licensed exclusively for the specified platform(s) and " \
164
- "cannot be installed on your system."
162
+ "Your current platform is: #{@current_platform}. " \
163
+ "This font is licensed exclusively for the specified platform(s) and " \
164
+ "cannot be installed on your system."
165
165
  end
166
166
  end
167
167
 
@@ -32,6 +32,7 @@ module Fontist
32
32
  return true if options.nil?
33
33
  return options.empty? if options.respond_to?(:empty?)
34
34
  return options.file.nil? && options.fonts_sub_dir.nil? if options.is_a?(ExtractOptions)
35
+
35
36
  false
36
37
  end
37
38
  end
data/lib/fontist/font.rb CHANGED
@@ -338,9 +338,9 @@ module Fontist
338
338
  all_fonts = [fontist_fonts, user_fonts, system_fonts].compact.flatten
339
339
  return unless all_fonts && !all_fonts.empty?
340
340
 
341
- uninstalled_paths = all_fonts.map do |font|
341
+ uninstalled_paths = all_fonts.filter_map do |font|
342
342
  uninstall_font_at_location(font.path)
343
- end.compact
343
+ end
344
344
 
345
345
  return if uninstalled_paths.empty?
346
346
 
@@ -75,7 +75,7 @@ module Fontist
75
75
  def extract_resource_names(formula)
76
76
  return [] unless formula.resources
77
77
 
78
- Array(formula.resources).map(&:name).compact
78
+ Array(formula.resources).filter_map(&:name)
79
79
  end
80
80
 
81
81
  def build_font_match(formula, name, resource)
@@ -123,7 +123,6 @@ module Fontist
123
123
  matcher = FormatMatcher.new(@format_spec)
124
124
  matcher.filter_resources(resources)
125
125
  end
126
-
127
126
  end
128
127
 
129
128
  # Result object for font matches