fontist 1.3.0 → 1.7.0

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 (116) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/check_google.yml +28 -0
  3. data/.github/workflows/macosx.yml +3 -0
  4. data/.github/workflows/ubuntu.yml +1 -1
  5. data/.github/workflows/windows.yml +1 -1
  6. data/.gitignore +6 -0
  7. data/.hound.yml +2 -0
  8. data/.rubocop.yml +22 -0
  9. data/README.md +224 -0
  10. data/bin/check_google +8 -0
  11. data/bin/convert_formulas +8 -0
  12. data/bin/fontist +7 -0
  13. data/bin/generate_otfinfo +8 -0
  14. data/bin/import_google +8 -0
  15. data/fontist.gemspec +15 -1
  16. data/lib/fontist.rb +19 -13
  17. data/lib/fontist/cli.rb +168 -0
  18. data/lib/fontist/errors.rb +6 -0
  19. data/lib/fontist/font.rb +145 -7
  20. data/lib/fontist/font_formula.rb +42 -7
  21. data/lib/fontist/fontist_font.rb +70 -0
  22. data/lib/fontist/formula.rb +31 -9
  23. data/lib/fontist/formula_template.rb +122 -0
  24. data/lib/fontist/formulas.rb +41 -0
  25. data/lib/fontist/import.rb +9 -0
  26. data/lib/fontist/import/convert_formulas.rb +65 -0
  27. data/lib/fontist/import/create_formula.rb +59 -0
  28. data/lib/fontist/import/extractors.rb +5 -0
  29. data/lib/fontist/import/extractors/cab_extractor.rb +37 -0
  30. data/lib/fontist/import/extractors/extractor.rb +19 -0
  31. data/lib/fontist/import/extractors/ole_extractor.rb +41 -0
  32. data/lib/fontist/import/extractors/seven_zip_extractor.rb +44 -0
  33. data/lib/fontist/import/extractors/zip_extractor.rb +31 -0
  34. data/lib/fontist/import/files/collection_file.rb +52 -0
  35. data/lib/fontist/import/files/file_requirement.rb +17 -0
  36. data/lib/fontist/import/files/font_detector.rb +48 -0
  37. data/lib/fontist/import/formula_builder.rb +166 -0
  38. data/lib/fontist/import/formula_serializer.rb +133 -0
  39. data/lib/fontist/import/google.rb +16 -0
  40. data/lib/fontist/import/google/fonts_public.md +10 -0
  41. data/lib/fontist/import/google/fonts_public.pb.rb +71 -0
  42. data/lib/fontist/import/google/fonts_public.proto +46 -0
  43. data/lib/fontist/import/google/new_fonts_fetcher.rb +121 -0
  44. data/lib/fontist/import/google/skiplist.yml +8 -0
  45. data/lib/fontist/import/google_check.rb +34 -0
  46. data/lib/fontist/import/google_import.rb +180 -0
  47. data/lib/fontist/import/helpers/hash_helper.rb +13 -0
  48. data/lib/fontist/import/helpers/system_helper.rb +23 -0
  49. data/lib/fontist/import/otf/font_file.rb +105 -0
  50. data/lib/fontist/import/otf_parser.rb +25 -0
  51. data/lib/fontist/import/otf_style.rb +29 -0
  52. data/lib/fontist/import/otfinfo/otfinfo_requirement.rb +22 -0
  53. data/lib/fontist/import/otfinfo/template.erb +20 -0
  54. data/lib/fontist/import/otfinfo_generate.rb +45 -0
  55. data/lib/fontist/import/recursive_extraction.rb +185 -0
  56. data/lib/fontist/import/template_helper.rb +19 -0
  57. data/lib/fontist/import/text_helper.rb +30 -0
  58. data/lib/fontist/manifest.rb +2 -0
  59. data/lib/fontist/manifest/install.rb +32 -0
  60. data/lib/fontist/manifest/locations.rb +60 -0
  61. data/lib/fontist/system_font.rb +66 -22
  62. data/lib/fontist/utils.rb +5 -0
  63. data/lib/fontist/utils/cache.rb +88 -0
  64. data/lib/fontist/utils/downloader.rb +66 -9
  65. data/lib/fontist/utils/dsl.rb +8 -0
  66. data/lib/fontist/utils/dsl/collection_font.rb +36 -0
  67. data/lib/fontist/utils/dsl/font.rb +38 -0
  68. data/lib/fontist/utils/exe_extractor.rb +25 -22
  69. data/lib/fontist/utils/msi_extractor.rb +31 -0
  70. data/lib/fontist/utils/seven_zip_extractor.rb +41 -0
  71. data/lib/fontist/utils/system.rb +23 -0
  72. data/lib/fontist/utils/ui.rb +12 -0
  73. data/lib/fontist/utils/zip_extractor.rb +22 -8
  74. data/lib/fontist/version.rb +1 -1
  75. metadata +173 -49
  76. data/lib/fontist/formulas/andale_font.rb +0 -80
  77. data/lib/fontist/formulas/arial_black_font.rb +0 -79
  78. data/lib/fontist/formulas/cleartype_fonts.rb +0 -227
  79. data/lib/fontist/formulas/comic_font.rb +0 -78
  80. data/lib/fontist/formulas/courier_font.rb +0 -81
  81. data/lib/fontist/formulas/euphemia_font.rb +0 -85
  82. data/lib/fontist/formulas/georgia_font.rb +0 -80
  83. data/lib/fontist/formulas/impact_font.rb +0 -78
  84. data/lib/fontist/formulas/montserrat_font.rb +0 -132
  85. data/lib/fontist/formulas/ms_truetype_fonts.rb +0 -125
  86. data/lib/fontist/formulas/open_sans_fonts.rb +0 -263
  87. data/lib/fontist/formulas/overpass_font.rb +0 -73
  88. data/lib/fontist/formulas/source_fonts.rb +0 -109
  89. data/lib/fontist/formulas/stix_fonts.rb +0 -108
  90. data/lib/fontist/formulas/tahoma_font.rb +0 -147
  91. data/lib/fontist/formulas/webding_font.rb +0 -78
  92. data/spec/fontist/font_formula_spec.rb +0 -67
  93. data/spec/fontist/font_spec.rb +0 -113
  94. data/spec/fontist/formula_spec.rb +0 -67
  95. data/spec/fontist/formulas/andale_font_spec.rb +0 -29
  96. data/spec/fontist/formulas/arial_black_font_spec.rb +0 -29
  97. data/spec/fontist/formulas/cleartype_fonts_spec.rb +0 -38
  98. data/spec/fontist/formulas/comic_font_spec.rb +0 -29
  99. data/spec/fontist/formulas/courier_font_spec.rb +0 -29
  100. data/spec/fontist/formulas/euphemia_font_spec.rb +0 -29
  101. data/spec/fontist/formulas/georgia_font_spec.rb +0 -29
  102. data/spec/fontist/formulas/impact_font_spec.rb +0 -29
  103. data/spec/fontist/formulas/montserrat_font_spec.rb +0 -29
  104. data/spec/fontist/formulas/ms_truetype_fonts_spec.rb +0 -29
  105. data/spec/fontist/formulas/open_sans_fonts_spec.rb +0 -29
  106. data/spec/fontist/formulas/overpass_font_spec.rb +0 -29
  107. data/spec/fontist/formulas/source_fonts_spec.rb +0 -31
  108. data/spec/fontist/formulas/stix_fonts_spec.rb +0 -29
  109. data/spec/fontist/formulas/tahoma_font_spec.rb +0 -29
  110. data/spec/fontist/formulas/webding_font_spec.rb +0 -29
  111. data/spec/fontist/registry_spec.rb +0 -47
  112. data/spec/fontist/system_font_spec.rb +0 -44
  113. data/spec/fontist/utils/downloader_spec.rb +0 -35
  114. data/spec/fontist_spec.rb +0 -5
  115. data/spec/spec_helper.rb +0 -22
  116. data/spec/support/fontist_helper.rb +0 -10
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1f45a43c4f700cd793576c4783b7098beea7d366c8aeb2654fcc5b6a38c986b0
4
- data.tar.gz: 01ce25c4eae85e3fb20b7cdf0d106a04a2273e770a4261e937c344520a723651
3
+ metadata.gz: 4832b87f5d5535536b6f2f2e2761bf8ff8dbd82770703f93e201e2c7e81f496d
4
+ data.tar.gz: 32e720d4a33cb78a88bcdd8bf3b80bc24abec544d3dd755a459ae2a1a4a78d6b
5
5
  SHA512:
6
- metadata.gz: 6aae04a73aa89e5a7919430cecf56a8da1361bbe7b4a40a5676abe1ca02cc011e95681b7520a2d0ec3f47dd793af48c462f9deb1377b2547ba5d5edbc8c864e4
7
- data.tar.gz: 541d57da927636744955a5917ad39d57fe793bb37b0c31d167252da9efea8815c3675d2e998ed7ef585921415733e2b393de19f16be433d2ca62cfdbf0d00f02
6
+ metadata.gz: 6567b976d958bc852244e5080753eb1fc2e44f8231fe08f3cded4076d510c553565160cf83c108e2e6c309cce042393acf7e19ab34e5a851f4c879a7f9c642ae
7
+ data.tar.gz: 2bab58316fdc830954b93daa716deaac90912ee4906510fad27efba2c0323af8cdb9bade71d5a5f257461063576863b44e1bfc0b72f7cdde1839689acb497f95
@@ -0,0 +1,28 @@
1
+ name: check_google
2
+
3
+ on:
4
+ schedule:
5
+ - cron: '0 0 * * *'
6
+
7
+ jobs:
8
+ check:
9
+ runs-on: ubuntu-latest
10
+
11
+ steps:
12
+ - uses: actions/checkout@v2
13
+
14
+ - uses: actions/setup-ruby@v1
15
+ with:
16
+ ruby-version: 2.6
17
+
18
+ - name: Install otfinfo
19
+ run: sudo apt-get install lcdf-typetools
20
+
21
+ - name: Install bundler
22
+ run: gem install bundler
23
+
24
+ - name: Setup
25
+ run: bin/setup
26
+
27
+ - name: Check new fonts
28
+ run: TEST_ENV=CI bin/check_google
@@ -20,6 +20,9 @@ jobs:
20
20
  with:
21
21
  ruby-version: 2.6
22
22
 
23
+ - name: Install otfinfo
24
+ run: brew install lcdf-typetools
25
+
23
26
  - name: Install bundler
24
27
  run: gem install bundler
25
28
 
@@ -27,4 +27,4 @@ jobs:
27
27
  run: bin/setup
28
28
 
29
29
  - name: Run tests
30
- run: TEST_ENV=CI bin/rspec
30
+ run: TEST_ENV=CI bin/rspec --tag ~dev
@@ -29,4 +29,4 @@ jobs:
29
29
  bundle install --jobs 4 --retry 3
30
30
 
31
31
  - name: Run tests
32
- run: bundle exec rspec --tag ~skip_in_windows
32
+ run: bundle exec rspec --tag ~skip_in_windows --tag ~dev
data/.gitignore CHANGED
@@ -11,6 +11,12 @@ Gemfile.lock
11
11
  # fonts
12
12
  /spec/fixtures/fonts/*
13
13
  /spec/fixtures/fonts/DejaVuSerif.ttf
14
+ /spec/fixtures/formulas/
15
+ /spec/fixtures/*
16
+ !/spec/fixtures/system.yml
14
17
 
15
18
  # rspec failure tracking
16
19
  .rspec_status
20
+
21
+ # remote file cache
22
+ .rubocop-*
@@ -0,0 +1,2 @@
1
+ ruby:
2
+ config_file: .rubocop.yml
@@ -0,0 +1,22 @@
1
+ inherit_from:
2
+ - 'https://raw.githubusercontent.com/fontist/oss-guides/master/ci/rubocop.yml'
3
+
4
+ AllCops:
5
+ Exclude:
6
+ - 'lib/fontist/import/google/fonts_public.pb.rb'
7
+ - 'lib/fontist/formula_template.rb'
8
+
9
+ Rails:
10
+ Enabled: false
11
+
12
+ Metrics/LineLength:
13
+ Exclude:
14
+ - 'lib/fontist/formulas/**/*.rb'
15
+
16
+ Layout/IndentFirstHashElement:
17
+ Exclude:
18
+ - 'lib/fontist/formulas/**/*.rb'
19
+
20
+ Layout/IndentHeredoc:
21
+ Exclude:
22
+ - 'lib/fontist/formulas/**/*.rb'
data/README.md CHANGED
@@ -26,6 +26,14 @@ Or install it yourself as:
26
26
  gem install fontist
27
27
  ```
28
28
 
29
+ ### Fetch formulas
30
+
31
+ After installation please fetch formulas to your system:
32
+
33
+ ```sh
34
+ fontist update
35
+ ```
36
+
29
37
  ## Usage
30
38
 
31
39
  ### Font
@@ -124,6 +132,182 @@ The return values are ` OpenStruct` object, so you can easily do any other
124
132
  operation you would do in any ruby object.
125
133
 
126
134
 
135
+ ### Manifest
136
+
137
+ #### Locations
138
+
139
+ Fontist lets find font locations from a YAML manifest of the following format:
140
+
141
+ ```yml
142
+ Segoe UI:
143
+ - Regular
144
+ - Bold
145
+ Roboto Mono:
146
+ - Regular
147
+ ```
148
+
149
+ Calling the following code returns a nested hash with font paths.
150
+
151
+ ```ruby
152
+ Fontist::Manifest::Locations.call(manifest_path)
153
+ ```
154
+
155
+ ```ruby
156
+ {"Segoe UI"=>
157
+ {"Regular"=>["/Users/user/.fontist/fonts/SEGOEUI.TTF"],
158
+ "Bold"=>["/Users/user/.fontist/fonts/SEGOEUIB.TTF"]},
159
+ "Roboto Mono"=>
160
+ {"Regular"=>[]}}
161
+ ```
162
+
163
+ #### Install
164
+
165
+ Fontist lets not only to get font locations but also to install fonts from the
166
+ manifest:
167
+
168
+ ```ruby
169
+ Fontist::Manifest::Install.call(manifest, confirmation: "yes")
170
+ ```
171
+
172
+ It will install fonts and return their locations:
173
+
174
+ ```ruby
175
+ {"Segoe UI"=>
176
+ {"Regular"=>["/Users/user/.fontist/fonts/SEGOEUI.TTF"],
177
+ "Bold"=>["/Users/user/.fontist/fonts/SEGOEUIB.TTF"]},
178
+ "Roboto Mono"=>
179
+ {"Regular"=>["/Users/user/.fontist/fonts/RobotoMono-VariableFont_wght.ttf"]}}
180
+ ```
181
+
182
+ ### CLI
183
+
184
+ These commands makes possible to operate with fonts via command line. The CLI
185
+ properly supports exit status, so in a case of error it returns a status code
186
+ higher or equal than 1.
187
+
188
+ All searches are case-insensitive for ease of use.
189
+
190
+ #### Install
191
+
192
+ The `install` command is similar to the `Font.install` call. It first checks
193
+ whether this font is already installed, and if not, then installs the font and
194
+ returns its paths. Font or formula could be specified as a name.
195
+
196
+ ```
197
+ $ fontist install "segoe ui"
198
+ These fonts are found or installed:
199
+ /Users/user/.fontist/fonts/SEGOEUI.TTF
200
+ /Users/user/.fontist/fonts/SEGOEUIB.TTF
201
+ /Users/user/.fontist/fonts/SEGOEUII.TTF
202
+ /Users/user/.fontist/fonts/SEGOEUIZ.TTF
203
+ ```
204
+
205
+ #### Uninstall
206
+
207
+ Uninstalls any font supported by Fontist. Returns paths of an uninstalled font,
208
+ or prints an error telling that the font isn't installed or could not be found
209
+ in Fontist formulas. Aliased as `remove`.
210
+
211
+ ```
212
+ $ fontist uninstall "segoe ui"
213
+ These fonts are removed:
214
+ /Users/user/.fontist/fonts/SEGOEUII.TTF
215
+ /Users/user/.fontist/fonts/SEGOEUIZ.TTF
216
+ /Users/user/.fontist/fonts/SEGOEUIB.TTF
217
+ /Users/user/.fontist/fonts/SEGOEUI.TTF
218
+ ```
219
+
220
+ #### Status
221
+
222
+ Prints installed font paths grouped by formula and font.
223
+
224
+ ```
225
+ $ fontist status "segoe ui"
226
+ Fontist::Formulas::SegoeUIFont
227
+ Segoe UI
228
+ Regular (/Users/user/.fontist/fonts/SEGOEUI.TTF)
229
+ Bold (/Users/user/.fontist/fonts/SEGOEUIB.TTF)
230
+ Italic (/Users/user/.fontist/fonts/SEGOEUII.TTF)
231
+ Bold Italic (/Users/user/.fontist/fonts/SEGOEUIZ.TTF)
232
+ ```
233
+
234
+ #### List
235
+
236
+ Lists installation status of fonts supported by Fontist.
237
+
238
+ ```
239
+ $ fontist list "segoe ui"
240
+ Fontist::Formulas::SegoeUIFont
241
+ Segoe UI
242
+ Regular (installed)
243
+ Bold (installed)
244
+ Italic (installed)
245
+ Bold Italic (installed)
246
+ ```
247
+
248
+ ```
249
+ $ fontist list "roboto mono"
250
+ Fontist::Formulas::RobotoMonoFont
251
+ Roboto Mono
252
+ Regular (uninstalled)
253
+ Italic (uninstalled)
254
+ ```
255
+
256
+ #### Locations from manifest
257
+
258
+ Returns locations of fonts specified in a YAML file as an input.
259
+
260
+ For example, if there is a file `manifest.yml`:
261
+
262
+ ```yml
263
+ Segoe UI:
264
+ - Regular
265
+ - Bold
266
+ Roboto Mono:
267
+ - Regular
268
+ ```
269
+
270
+ Then the command will return the following YAML output:
271
+
272
+ ```yml
273
+ $ fontist manifest-locations manifest.yml
274
+ ---
275
+ Segoe UI:
276
+ Regular:
277
+ - "/Users/user/.fontist/fonts/SEGOEUI.TTF"
278
+ Bold:
279
+ - "/Users/user/.fontist/fonts/SEGOEUIB.TTF"
280
+ Roboto Mono:
281
+ Regular: []
282
+ ```
283
+
284
+ Since Segoe UI is installed, but Roboto Mono is not.
285
+
286
+ #### Install from manifest
287
+
288
+ Install fonts from a YAML manifest:
289
+
290
+ ```yml
291
+ $ fontist manifest-install --confirm-license manifest.yml
292
+ ---
293
+ Segoe UI:
294
+ Regular:
295
+ - "/Users/user/.fontist/fonts/SEGOEUI.TTF"
296
+ Bold:
297
+ - "/Users/user/.fontist/fonts/SEGOEUIB.TTF"
298
+ Roboto Mono:
299
+ Regular:
300
+ - "/Users/user/.fontist/fonts/RobotoMono-VariableFont_wght.ttf"
301
+ ```
302
+
303
+ #### Help
304
+
305
+ List of all commands could be seen by:
306
+
307
+ ```
308
+ fontist help
309
+ ```
310
+
127
311
  ## Development
128
312
 
129
313
  We are following Sandi Metz's Rules for this gem, you can read the
@@ -151,6 +335,44 @@ Run the test suite
151
335
  bin/rspec
152
336
  ```
153
337
 
338
+ ### Formulas storage
339
+
340
+ All formulas are kept in the [formulas][fontist-formulas] repository. If you'd
341
+ like to add a new one or change any existing, please refer to its documentation.
342
+
343
+ ### Auto-generate a formula
344
+
345
+ A formula could be generated from a fonts archive. Just specify a URL to the
346
+ archive:
347
+
348
+ ```sh
349
+ fontist create-formula https://www.latofonts.com/download/lato2ofl-zip/
350
+ cp lato.yml ~/.fontist/formulas/Formulas/
351
+ cd ~/.fontist/formulas
352
+ git add Formulas/lato.yml
353
+ git commit -m "Add Lato formula"
354
+ ```
355
+
356
+ ### Google Import
357
+
358
+ The library contains formulas for [Google Foonts][google-fonts]. A GHA workflow
359
+ checks for fonts update every day. In case an update is found, it could be
360
+ fetched to the library by:
361
+
362
+ ```
363
+ bin/import_google
364
+ ```
365
+
366
+ The script would update formulas which should be committed to a separate
367
+ repository [formulas][fontist-formulas]:
368
+
369
+ ```
370
+ cd ~/.fontist/formulas
371
+ git add Formulas/google
372
+ git commit -m "Google Fonts update"
373
+ git push
374
+ ```
375
+
154
376
  ## Contributing
155
377
 
156
378
  First, thank you for contributing! We love pull requests from everyone. By
@@ -177,3 +399,5 @@ This gem is developed, maintained and funded by [Ribose Inc.][riboseinc]
177
399
  [issues]: https://github.com/fontist/fontist/issues
178
400
  [squash]: https://github.com/thoughtbot/guides/tree/master/protocol/git#write-a-feature
179
401
  [sandi-metz]: http://robots.thoughtbot.com/post/50655960596/sandi-metz-rules-for-developers
402
+ [fontist-formulas]: https://github.com/fontist/formulas
403
+ [google-fonts]: https://fonts.google.com
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "bundler/setup"
5
+ require "fontist"
6
+ require "fontist/import/google_check"
7
+
8
+ Fontist::Import::GoogleCheck.new.call
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "bundler/setup"
5
+ require "fontist"
6
+ require "fontist/import/convert_formulas"
7
+
8
+ Fontist::Import::ConvertFormulas.new.call
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "fontist"
4
+ require "fontist/cli"
5
+
6
+ status_code = Fontist::CLI.start(ARGV)
7
+ exit status_code.is_a?(Integer) ? status_code : 1
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "bundler/setup"
5
+ require "fontist"
6
+ require "fontist/import/otfinfo_generate"
7
+
8
+ Fontist::Import::OtfinfoGenerate.new(ARGV[0]).call
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "bundler/setup"
5
+ require "fontist"
6
+ require "fontist/import/google_import"
7
+
8
+ Fontist::Import::GoogleImport.new.call
@@ -13,21 +13,35 @@ Gem::Specification.new do |spec|
13
13
  spec.homepage = "https://github.com/fontist/fontist"
14
14
  spec.license = "BSD-2-Clause"
15
15
 
16
+ spec.post_install_message = "Please run `fontist update` to fetch formulas"
17
+
16
18
  spec.metadata["homepage_uri"] = spec.homepage
17
19
  spec.metadata["source_code_uri"] = "https://github.com/fontist/fontist"
18
20
  spec.metadata["changelog_uri"] = "https://github.com/fontist/fontist"
19
21
 
20
22
  spec.require_paths = ["lib"]
21
- spec.files = `git ls-files`.split("\n")
23
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
24
+ f.match(%r{^(test|spec|features)/})
25
+ end
26
+ spec.bindir = "bin"
27
+ spec.executables = ["fontist"]
22
28
  spec.test_files = `git ls-files -- {spec}/*`.split("\n")
23
29
 
24
30
  spec.add_runtime_dependency "down", "~> 5.0"
25
31
  spec.add_runtime_dependency "libmspack", "~> 0.1.0"
26
32
  spec.add_runtime_dependency "rubyzip", "~> 2.3.0"
33
+ spec.add_runtime_dependency "seven_zip_ruby", "~> 1.0"
34
+ spec.add_runtime_dependency "ruby-ole", "~> 1.0"
27
35
  spec.add_runtime_dependency "thor", "~> 1.0.1"
36
+ spec.add_runtime_dependency "git", "~> 1.0"
28
37
 
38
+ spec.add_development_dependency "extract_ttc", "~> 0.1"
29
39
  spec.add_development_dependency "pry"
30
40
  spec.add_development_dependency "bundler", "~> 2.0"
31
41
  spec.add_development_dependency "rake", "~> 12.3.3"
32
42
  spec.add_development_dependency "rspec", "~> 3.0"
43
+ spec.add_development_dependency "rubocop", "0.75.0"
44
+ spec.add_development_dependency "rubocop-rails"
45
+ spec.add_development_dependency "rubocop-performance"
46
+ spec.add_development_dependency "ruby-protocol-buffers", "~> 1.0"
33
47
  end
@@ -12,6 +12,8 @@ require "fontist/registry"
12
12
  require "fontist/formulas"
13
13
  require "fontist/formula"
14
14
  require "fontist/system_font"
15
+ require "fontist/fontist_font"
16
+ require "fontist/manifest"
15
17
 
16
18
  module Fontist
17
19
  def self.ui
@@ -34,19 +36,23 @@ module Fontist
34
36
  Fontist.fontist_path.join("fonts")
35
37
  end
36
38
 
39
+ def self.formulas_repo_path
40
+ Fontist.fontist_path.join("formulas")
41
+ end
42
+
43
+ def self.formulas_repo_url
44
+ "https://github.com/fontist/formulas.git"
45
+ end
46
+
37
47
  def self.formulas_path
38
- Fontist.lib_path.join("fontist", "formulas")
48
+ Fontist.formulas_repo_path.join("Formulas")
39
49
  end
40
- end
41
50
 
42
- # Loading formulas
43
- #
44
- # The formula loading behavior is dynamic, so what we are actualy
45
- # doing here is looking for formulas in the `./fontist/formulas` directory
46
- # then require thos as we go.
47
- #
48
- # There is a caviat, since the `Dir` method depends on absoulate path
49
- # so moving this loading up or somewhere else might not always ensure
50
- # the fontist related path helpers.
51
- #
52
- Dir[Fontist.formulas_path.join("**.rb").to_s].sort.each { |file| require file }
51
+ def self.downloads_path
52
+ Fontist.fontist_path.join("downloads")
53
+ end
54
+
55
+ def self.system_file_path
56
+ Fontist.lib_path.join("fontist", "system.yml")
57
+ end
58
+ end