Class: Fontist::Import::RecursiveExtraction
- Inherits:
-
Object
- Object
- Fontist::Import::RecursiveExtraction
- Defined in:
- lib/fontist/import/recursive_extraction.rb
Constant Summary collapse
- LICENSE_PATTERN =
/(ofl\.txt|ufl\.txt|licenses?\.txt|license(\.md)?|copying)$/i.freeze
- SUPPORTED_FONT_EXTENSIONS =
Font extensions that are recognized during extraction This is displayed to users so they understand what files are being matched
%w[ttf otf ttc otc woff woff2 dfont].freeze
- FONT_EXTENSIONS_PATTERN =
/\.(#{SUPPORTED_FONT_EXTENSIONS.join('|')})$/i.freeze
Instance Attribute Summary collapse
-
#error_collector ⇒ Object
readonly
Returns the value of attribute error_collector.
Instance Method Summary collapse
- #font_collection_files ⇒ Object
- #font_files ⇒ Object
-
#initialize(archive, subdir: nil, file_pattern: nil, name_prefix: nil, verbose: false) ⇒ RecursiveExtraction
constructor
A new instance of RecursiveExtraction.
- #license_text ⇒ Object
- #operations ⇒ Object
Constructor Details
#initialize(archive, subdir: nil, file_pattern: nil, name_prefix: nil, verbose: false) ⇒ RecursiveExtraction
Returns a new instance of RecursiveExtraction.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/fontist/import/recursive_extraction.rb', line 16 def initialize(archive, subdir: nil, file_pattern: nil, name_prefix: nil, verbose: false) @archive = archive @subdir = subdir @file_pattern = file_pattern @name_prefix = name_prefix @verbose = verbose @operations = {} @font_files = [] @collection_files = [] @error_collector = FontParsingErrorCollector.new save_operation_subdir end |
Instance Attribute Details
#error_collector ⇒ Object (readonly)
Returns the value of attribute error_collector.
14 15 16 |
# File 'lib/fontist/import/recursive_extraction.rb', line 14 def error_collector @error_collector end |
Instance Method Details
#font_collection_files ⇒ Object
36 37 38 39 |
# File 'lib/fontist/import/recursive_extraction.rb', line 36 def font_collection_files ensure_extracted @collection_files end |
#font_files ⇒ Object
31 32 33 34 |
# File 'lib/fontist/import/recursive_extraction.rb', line 31 def font_files ensure_extracted @font_files end |
#license_text ⇒ Object
41 42 43 44 |
# File 'lib/fontist/import/recursive_extraction.rb', line 41 def license_text ensure_extracted @license_text end |
#operations ⇒ Object
46 47 48 49 |
# File 'lib/fontist/import/recursive_extraction.rb', line 46 def operations ensure_extracted @operations end |