Class: Ucode::Commands::Audit::CollectionCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/ucode/commands/audit/collection_command.rb

Overview

ucode audit collection PATH — explicit collection audit. Wraps FontCommand with two collection-specific behaviors:

- Validates the source is actually a collection
(TTC/OTC/dfong). Errors out otherwise.
- Supports `font_index:` to audit only one face of the
collection, producing a single-face tree.

For unspecified collection options, delegates to FontCommand.

Instance Method Summary collapse

Instance Method Details

#call(font_path, font_index: nil, **kwargs) ⇒ FontCommand::Result

Returns when auditing all faces, or a single-face variant when font_index: is set.

Parameters:

  • font_path (String, Pathname)

    must be a collection source.

  • font_index (Integer, nil) (defaults to: nil)

    if set, audit only this face.

  • kwargs (Hash)

    forwarded to FontCommand#call.

Returns:

  • (FontCommand::Result)

    when auditing all faces, or a single-face variant when font_index: is set.

Raises:



28
29
30
31
32
33
# File 'lib/ucode/commands/audit/collection_command.rb', line 28

def call(font_path, font_index: nil, **kwargs)
  raise CollectionRequiredError, font_path unless collection?(font_path)
  return audit_single_face(font_path, font_index, kwargs) if font_index

  font_command.call(font_path, **kwargs)
end