class Fontist::GoogleImportSource
Import source for Google Fonts
Tracks the specific commit, API version, and family information for fonts imported from Google Fonts.
Note: Google Fonts filenames are NOT versioned because Google Fonts is a live service that always provides the latest version. The commit_id is tracked in import_source for metadata and update detection only.
Public Instance Methods
Source
# File lib/fontist/google_import_source.rb, line 62 def ==(other) return false unless other.is_a?(GoogleImportSource) commit_id == other.commit_id end
Equality check based on commit ID
@param other [Object] The object to compare @return [Boolean] true if objects are equal
Source
# File lib/fontist/google_import_source.rb, line 31 def differentiation_key nil end
Returns nil - Google Fonts formulas use simple filenames
Google Fonts is a live service, so formulas always point to the latest version. The commit_id is stored for metadata only.
@return [nil] No differentiation needed for Google Fonts
Source
# File lib/fontist/google_import_source.rb, line 39 def outdated?(new_source) return false unless new_source.is_a?(GoogleImportSource) return false unless commit_id && new_source.commit_id # Compare commit IDs - different commits mean potential update commit_id != new_source.commit_id rescue StandardError => e Fontist.ui.error("Error comparing Google import sources: #{e.message}") false end
Checks if this import source is older than the provided new source
@param new_source [GoogleImportSource] The new source to compare against @return [Boolean] true if this source is outdated
Source
# File lib/fontist/google_import_source.rb, line 53 def to_s "Google Fonts (commit: #{commit_id&.slice(0, 7)}, family: #{family_id}, API: #{api_version})" end
Returns a human-readable string representation
@return [String] String representation for debugging/logging