Class: Fontisan::Commands::AuditLibraryCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/fontisan/commands/audit_library_command.rb

Overview

Audits every font in a directory (tree) and rolls the per-face reports up into a Models::Audit::LibrarySummary.

Thin wrapper over Audit::LibraryAuditor: validates the root path exists, delegates to the auditor, returns the summary. The auditor itself owns file discovery and per-face auditing; this command is the CLI-facing boundary that maps user-facing options onto auditor inputs.

Instance Method Summary collapse

Constructor Details

#initialize(root_path, recursive:, options:) ⇒ AuditLibraryCommand

Returns a new instance of AuditLibraryCommand.

Parameters:

  • root_path (String)

    directory containing fonts

  • recursive (Boolean)

    walk into subdirectories

  • options (Hash)

    forwarded to AuditCommand for each face



17
18
19
20
21
# File 'lib/fontisan/commands/audit_library_command.rb', line 17

def initialize(root_path, recursive:, options:)
  @root_path = root_path
  @recursive = recursive
  @options = options
end

Instance Method Details

#runModels::Audit::LibrarySummary

Returns:

Raises:



24
25
26
27
28
# File 'lib/fontisan/commands/audit_library_command.rb', line 24

def run
  raise Error, "library audit requires an existing directory: #{@root_path}" unless Dir.exist?(@root_path)

  auditor.audit
end

#skippedArray<String>

Returns files skipped during the audit pass.

Returns:

  • (Array<String>)

    files skipped during the audit pass



31
32
33
# File 'lib/fontisan/commands/audit_library_command.rb', line 31

def skipped
  auditor.skipped
end