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.
19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/fontist/import/recursive_extraction.rb', line 19 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.
17 18 19 |
# File 'lib/fontist/import/recursive_extraction.rb', line 17 def error_collector @error_collector end |
Instance Method Details
#font_collection_files ⇒ Object
39 40 41 42 |
# File 'lib/fontist/import/recursive_extraction.rb', line 39 def font_collection_files ensure_extracted @collection_files end |
#font_files ⇒ Object
34 35 36 37 |
# File 'lib/fontist/import/recursive_extraction.rb', line 34 def font_files ensure_extracted @font_files end |
#license_text ⇒ Object
44 45 46 47 |
# File 'lib/fontist/import/recursive_extraction.rb', line 44 def license_text ensure_extracted @license_text end |
#operations ⇒ Object
49 50 51 52 |
# File 'lib/fontist/import/recursive_extraction.rb', line 49 def operations ensure_extracted @operations end |