fontist 1.11.7 → 1.13.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,16 +3,36 @@ require "thor"
3
3
  module Fontist
4
4
  module Utils
5
5
  class UI < Thor
6
+ ALL_LEVELS = %i[debug info warn error fatal unknown].freeze
7
+
8
+ def self.level=(level)
9
+ unless ALL_LEVELS.include?(level)
10
+ raise Errors::GeneralError,
11
+ "Unknown log level: #{level.inspect}. " \
12
+ "Supported levels are #{ALL_LEVELS.map(&:inspect).join(', ')}."
13
+ end
14
+
15
+ @level = level
16
+ end
17
+
18
+ def self.level
19
+ @level || default_level
20
+ end
21
+
22
+ def self.default_level
23
+ :fatal
24
+ end
25
+
6
26
  def self.success(message)
7
- new.say(message, :green)
27
+ new.say(message, :green) if log_levels.include?(:info)
8
28
  end
9
29
 
10
30
  def self.error(message)
11
- new.say(message, :red)
31
+ new.say(message, :red) if log_levels.include?(:warn)
12
32
  end
13
33
 
14
34
  def self.say(message)
15
- new.say(message)
35
+ new.say(message) if log_levels.include?(:info)
16
36
  end
17
37
 
18
38
  def self.ask(message, options = {})
@@ -20,7 +40,16 @@ module Fontist
20
40
  end
21
41
 
22
42
  def self.print(message)
23
- super
43
+ super if log_levels.include?(:info)
44
+ end
45
+
46
+ def self.debug(message)
47
+ new.say(message) if log_levels.include?(:debug)
48
+ end
49
+
50
+ def self.log_levels
51
+ @log_levels ||= {}
52
+ @log_levels[@level] ||= ALL_LEVELS.drop_while { |l| l != level }
24
53
  end
25
54
  end
26
55
  end
@@ -1,3 +1,3 @@
1
1
  module Fontist
2
- VERSION = "1.11.7".freeze
2
+ VERSION = "1.13.2".freeze
3
3
  end
data/lib/fontist.rb CHANGED
@@ -44,7 +44,11 @@ module Fontist
44
44
  end
45
45
 
46
46
  def self.fontist_version_path
47
- Fontist.fontist_path.join("versions", Update::VERSION)
47
+ Fontist.fontist_path.join("versions", formulas_version)
48
+ end
49
+
50
+ def self.formulas_version
51
+ "v3"
48
52
  end
49
53
 
50
54
  def self.formulas_repo_url
@@ -103,6 +107,10 @@ module Fontist
103
107
  Fontist.fontist_version_path
104
108
  end
105
109
 
110
+ def self.formula_size_limit_in_megabytes
111
+ 300
112
+ end
113
+
106
114
  def self.preferred_family?
107
115
  !!@preferred_family
108
116
  end
@@ -111,11 +119,7 @@ module Fontist
111
119
  @preferred_family = bool
112
120
  end
113
121
 
114
- def self.debug?
115
- @debug || false
116
- end
117
-
118
- def self.debug=(bool)
119
- @debug = bool
122
+ def self.log_level=(level)
123
+ Fontist.ui.level = level
120
124
  end
121
125
  end
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.11.7
4
+ version: 1.13.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-11-18 00:00:00.000000000 Z
11
+ date: 2022-01-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: down
@@ -38,6 +38,34 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0.1'
41
+ - !ruby/object:Gem::Dependency
42
+ name: nokogiri
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: sys-uname
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '1.2'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '1.2'
41
69
  - !ruby/object:Gem::Dependency
42
70
  name: thor
43
71
  requirement: !ruby/object:Gem::Requirement
@@ -80,6 +108,20 @@ dependencies:
80
108
  - - "~>"
81
109
  - !ruby/object:Gem::Version
82
110
  version: '1.6'
111
+ - !ruby/object:Gem::Dependency
112
+ name: plist
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '3.0'
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '3.0'
83
125
  - !ruby/object:Gem::Dependency
84
126
  name: excavate
85
127
  requirement: !ruby/object:Gem::Requirement
@@ -136,20 +178,6 @@ dependencies:
136
178
  - - ">="
137
179
  - !ruby/object:Gem::Version
138
180
  version: '0'
139
- - !ruby/object:Gem::Dependency
140
- name: nokogiri
141
- requirement: !ruby/object:Gem::Requirement
142
- requirements:
143
- - - "~>"
144
- - !ruby/object:Gem::Version
145
- version: '1.0'
146
- type: :development
147
- prerelease: false
148
- version_requirements: !ruby/object:Gem::Requirement
149
- requirements:
150
- - - "~>"
151
- - !ruby/object:Gem::Version
152
- version: '1.0'
153
181
  - !ruby/object:Gem::Dependency
154
182
  name: rake
155
183
  requirement: !ruby/object:Gem::Requirement
@@ -271,11 +299,13 @@ files:
271
299
  - fontist.gemspec
272
300
  - lib/fontist.rb
273
301
  - lib/fontist/cli.rb
302
+ - lib/fontist/cli/class_options.rb
274
303
  - lib/fontist/errors.rb
275
304
  - lib/fontist/font.rb
276
305
  - lib/fontist/font_installer.rb
277
306
  - lib/fontist/font_path.rb
278
307
  - lib/fontist/formula.rb
308
+ - lib/fontist/formula_picker.rb
279
309
  - lib/fontist/google_cli.rb
280
310
  - lib/fontist/helpers.rb
281
311
  - lib/fontist/import.rb
@@ -293,6 +323,8 @@ files:
293
323
  - lib/fontist/import/google_import.rb
294
324
  - lib/fontist/import/helpers/hash_helper.rb
295
325
  - lib/fontist/import/helpers/system_helper.rb
326
+ - lib/fontist/import/macos.rb
327
+ - lib/fontist/import/manual_formula_builder.rb
296
328
  - lib/fontist/import/otf/font_file.rb
297
329
  - lib/fontist/import/otf_parser.rb
298
330
  - lib/fontist/import/otf_style.rb
@@ -303,6 +335,7 @@ files:
303
335
  - lib/fontist/import/sil_import.rb
304
336
  - lib/fontist/import/template_helper.rb
305
337
  - lib/fontist/import/text_helper.rb
338
+ - lib/fontist/import_cli.rb
306
339
  - lib/fontist/index.rb
307
340
  - lib/fontist/indexes/base_index.rb
308
341
  - lib/fontist/indexes/default_family_font_index.rb
@@ -315,6 +348,7 @@ files:
315
348
  - lib/fontist/manifest/locations.rb
316
349
  - lib/fontist/repo.rb
317
350
  - lib/fontist/repo_cli.rb
351
+ - lib/fontist/style_version.rb
318
352
  - lib/fontist/system.yml
319
353
  - lib/fontist/system_font.rb
320
354
  - lib/fontist/system_index.rb