Class: Fontist::Import::SilImporter

Inherits:
Object
  • Object
show all
Defined in:
lib/fontist/import/sil_importer.rb

Constant Summary collapse

ROOT =
"https://software.sil.org/fonts/".freeze

Instance Method Summary collapse

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(options = {})
  @output_path = options[:output_path]
  @font_name = options[:font_name]
  @verbose = options[:verbose]
  @import_cache = options[:import_cache]
  @force = options[:force]
  @schema_version = options[: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

#callObject



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