Class: Fontist::Import::SilImporter
- Inherits:
-
Object
- Object
- Fontist::Import::SilImporter
- Defined in:
- lib/fontist/import/sil_importer.rb
Constant Summary collapse
- ROOT =
"https://software.sil.org/fonts/".freeze
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(options = {}) ⇒ SilImporter
constructor
A new instance of SilImporter.
Constructor Details
#initialize(options = {}) ⇒ SilImporter
Returns a new instance of SilImporter.
9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/fontist/import/sil_importer.rb', line 9 def initialize( = {}) @output_path = [:output_path] @font_name = [:font_name] @verbose = [:verbose] @import_cache = [:import_cache] @force = [:force] @schema_version = [:schema_version] || 4 @success_count = 0 @failure_count = 0 @skipped_count = 0 @overwritten_count = 0 @failures = [] # Track {name, reason} for each failure end |
Instance Method Details
#call ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/fontist/import/sil_importer.rb', line 23 def call start_time = Time.now # Display header with import cache display_header # Fetch links links = fetch_and_filter_fonts return empty_result if links.empty? # Process fonts process_fonts(links) # Display summary display_summary(links.size, Time.now - start_time) # Display failures if any display_failures if @failures.any? build_results(Time.now - start_time) end |