fontist 1.1.0 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
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 +8 -0
  13. data/bin/generate_otfinfo +8 -0
  14. data/bin/import_google +8 -0
  15. data/fontist.gemspec +16 -1
  16. data/lib/fontist.rb +23 -13
  17. data/lib/fontist/cli.rb +156 -0
  18. data/lib/fontist/errors.rb +7 -1
  19. data/lib/fontist/font.rb +165 -6
  20. data/lib/fontist/font_formula.rb +8 -4
  21. data/lib/fontist/fontist_font.rb +70 -0
  22. data/lib/fontist/formula.rb +27 -9
  23. data/lib/fontist/formula_template.rb +108 -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 +74 -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 +47 -0
  35. data/lib/fontist/import/formula_builder.rb +156 -0
  36. data/lib/fontist/import/formula_serializer.rb +133 -0
  37. data/lib/fontist/import/google.rb +16 -0
  38. data/lib/fontist/import/google/fonts_public.md +10 -0
  39. data/lib/fontist/import/google/fonts_public.pb.rb +71 -0
  40. data/lib/fontist/import/google/fonts_public.proto +46 -0
  41. data/lib/fontist/import/google/new_fonts_fetcher.rb +121 -0
  42. data/lib/fontist/import/google/skiplist.yml +6 -0
  43. data/lib/fontist/import/google_check.rb +34 -0
  44. data/lib/fontist/import/google_import.rb +180 -0
  45. data/lib/fontist/import/helpers/hash_helper.rb +13 -0
  46. data/lib/fontist/import/helpers/system_helper.rb +23 -0
  47. data/lib/fontist/import/otf/font_file.rb +89 -0
  48. data/lib/fontist/import/otf_parser.rb +25 -0
  49. data/lib/fontist/import/otf_style.rb +29 -0
  50. data/lib/fontist/import/otfinfo/otfinfo_requirement.rb +22 -0
  51. data/lib/fontist/import/otfinfo/template.erb +20 -0
  52. data/lib/fontist/import/otfinfo_generate.rb +45 -0
  53. data/lib/fontist/import/recursive_extraction.rb +101 -0
  54. data/lib/fontist/import/template_helper.rb +19 -0
  55. data/lib/fontist/import/text_helper.rb +30 -0
  56. data/lib/fontist/manifest.rb +2 -0
  57. data/lib/fontist/manifest/common.rb +60 -0
  58. data/lib/fontist/manifest/install.rb +36 -0
  59. data/lib/fontist/manifest/locations.rb +13 -0
  60. data/lib/fontist/registry.rb +1 -0
  61. data/lib/fontist/system.yml +4 -1
  62. data/lib/fontist/system_font.rb +62 -22
  63. data/lib/fontist/utils.rb +5 -0
  64. data/lib/fontist/utils/cache.rb +69 -0
  65. data/lib/fontist/utils/downloader.rb +24 -4
  66. data/lib/fontist/utils/dsl.rb +4 -0
  67. data/lib/fontist/utils/dsl/font.rb +37 -0
  68. data/lib/fontist/utils/exe_extractor.rb +12 -19
  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 +23 -0
  73. data/lib/fontist/utils/zip_extractor.rb +9 -4
  74. data/lib/fontist/version.rb +1 -1
  75. metadata +186 -49
  76. data/lib/fontist/formulas/andale_font.rb +0 -79
  77. data/lib/fontist/formulas/arial_black_font.rb +0 -78
  78. data/lib/fontist/formulas/cleartype_fonts.rb +0 -226
  79. data/lib/fontist/formulas/comic_font.rb +0 -77
  80. data/lib/fontist/formulas/courier_font.rb +0 -80
  81. data/lib/fontist/formulas/euphemia_font.rb +0 -85
  82. data/lib/fontist/formulas/georgia_font.rb +0 -79
  83. data/lib/fontist/formulas/impact_font.rb +0 -77
  84. data/lib/fontist/formulas/montserrat_font.rb +0 -132
  85. data/lib/fontist/formulas/ms_truetype_fonts.rb +0 -124
  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 -77
  92. data/spec/fontist/font_formula_spec.rb +0 -67
  93. data/spec/fontist/font_spec.rb +0 -87
  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: ec6fb2284e060c8f43ac62c16a9777d25d20886ef2ff687eecdfb963980bb350
4
- data.tar.gz: ddcba3ee0f0a7c75f23532d7809c7c40492583ba032b4ebbc204d0730f6af9a4
3
+ metadata.gz: 398c687688ac621dd160d7245b073764e5203ec1993b4d0db185e9b1ba82ec78
4
+ data.tar.gz: 20222086aaa6372fcab4c4f8726821bbeffc1808f939b498bfb369130da9218c
5
5
  SHA512:
6
- metadata.gz: 7bfc0b3cb5597ceca0474c95d47a26e993ccf91773b4a17b10f08c84ac2ec4dfed40d3a271b309c6b2f7c77cd14dca5978b88a274c7aba3ba3ee95b25afcea30
7
- data.tar.gz: af007b2fda60f2f53bf2be5c107bf27ec423b9759f62c6827bdecc50ed62bf56a4f4f0969ec9d74f91631f92cad75c0564182424ef2b5754ead6c9335ae87ac1
6
+ metadata.gz: 60cae1ca82451a485a94ef95c9472dfe78e7dc8d30df79b3bcf44eb9c4861826ab6f59f8caf030008af2278bed8b2eb0a6ac061e8556c73949fb359b0bfc85c8
7
+ data.tar.gz: b702b24e7da4f8ac71ad0fa347a50e73d09171954b986fc2c0cbf8cd206642aed6b770de7e32db4f86e2e409289d401cd9c7d09fe64f775769c38b03038b585e
@@ -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,8 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "fontist"
5
+ require "fontist/cli"
6
+
7
+ status_code = Fontist::CLI.start(ARGV)
8
+ 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,20 +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"
35
+ spec.add_runtime_dependency "thor", "~> 1.0.1"
36
+ spec.add_runtime_dependency "git", "~> 1.0"
27
37
 
38
+ spec.add_development_dependency "extract_ttc", "~> 0.1"
28
39
  spec.add_development_dependency "pry"
29
40
  spec.add_development_dependency "bundler", "~> 2.0"
30
41
  spec.add_development_dependency "rake", "~> 12.3.3"
31
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"
32
47
  end
@@ -12,8 +12,14 @@ 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
19
+ def self.ui
20
+ Fontist::Utils::UI
21
+ end
22
+
17
23
  def self.lib_path
18
24
  Fontist.root_path.join("lib")
19
25
  end
@@ -30,19 +36,23 @@ module Fontist
30
36
  Fontist.fontist_path.join("fonts")
31
37
  end
32
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
+
33
47
  def self.formulas_path
34
- Fontist.lib_path.join("fontist", "formulas")
48
+ Fontist.formulas_repo_path.join("Formulas")
49
+ end
50
+
51
+ def self.downloads_path
52
+ Fontist.fontist_path.join("downloads")
35
53
  end
36
- end
37
54
 
38
- # Loading formulas
39
- #
40
- # The formula loading behavior is dynamic, so what we are actualy
41
- # doing here is looking for formulas in the `./fontist/formulas` directory
42
- # then require thos as we go.
43
- #
44
- # There is a caviat, since the `Dir` method depends on absoulate path
45
- # so moving this loading up or somewhere else might not always ensure
46
- # the fontist related path helpers.
47
- #
48
- Dir[Fontist.formulas_path.join("**.rb").to_s].sort.each { |file| require file }
55
+ def self.system_file_path
56
+ Fontist.lib_path.join("fontist", "system.yml")
57
+ end
58
+ end