class Fontist::MacosImportSource
Import source for macOS supplementary fonts
Tracks the specific framework version, catalog posting date, and asset ID for fonts imported from Appleβs macOS font catalogs.
Public Instance Methods
Source
# File lib/fontist/macos_import_source.rb, line 89 def ==(other) return false unless other.is_a?(MacosImportSource) framework_version == other.framework_version && asset_id&.downcase == other.asset_id&.downcase end
Equality check based on differentiation key
@param other [Object] The object to compare @return [Boolean] true if objects are equal
Source
# File lib/fontist/macos_import_source.rb, line 59 def compatible_with_macos?(macos_version) MacosFrameworkMetadata.compatible_with_macos?(framework_version, macos_version) end
Checks if this import source is compatible with a specific macOS version
@param macos_version [String] The macOS version to check @return [Boolean] true if compatible
Source
# File lib/fontist/macos_import_source.rb, line 81 def description MacosFrameworkMetadata.description(framework_version) end
Gets the description for this framework
@return [String] The framework description
Source
# File lib/fontist/macos_import_source.rb, line 23 def differentiation_key asset_id&.downcase end
Returns the asset ID in lowercase for consistent differentiation
@return [String, nil] Lowercased asset ID or nil
Source
# File lib/fontist/macos_import_source.rb, line 51 def max_macos_version MacosFrameworkMetadata.max_macos_version(framework_version) end
Gets the maximum macOS version for this framework
@return [String, nil] The maximum macOS version or nil if unlimited
Source
# File lib/fontist/macos_import_source.rb, line 44 def min_macos_version MacosFrameworkMetadata.min_macos_version(framework_version) end
Gets the minimum macOS version for this framework
@return [String, nil] The minimum macOS version or nil
Source
# File lib/fontist/macos_import_source.rb, line 31 def outdated?(new_source) return false unless new_source.is_a?(MacosImportSource) return false unless posted_date && new_source.posted_date Time.parse(posted_date) < Time.parse(new_source.posted_date) rescue StandardError => e Fontist.ui.error("Error comparing import sources: #{e.message}") false end
Checks if this import source is older than the provided new source
@param new_source [MacosImportSource] The new source to compare against @return [Boolean] true if this source is outdated
Source
# File lib/fontist/macos_import_source.rb, line 74 def parser_class MacosFrameworkMetadata.parser_class(framework_version) end
Gets the parser class name for this framework
@return [String] The fully qualified parser class name
Source
# File lib/fontist/macos_import_source.rb, line 67 def to_s "macOS Font#{framework_version} (posted: #{posted_date}, asset: #{asset_id})" end
Returns a human-readable string representation
@return [String] String representation for debugging/logging