Class: Fontisan::Commands::BaseCommand
- Inherits:
-
Object
- Object
- Fontisan::Commands::BaseCommand
- Defined in:
- lib/fontisan/commands/base_command.rb
Overview
Abstract base class for all CLI commands.
Provides common functionality for loading fonts using FontLoader for automatic format detection. Works polymorphically with TrueTypeFont and OpenTypeFont instances.
Subclasses must implement the run method to define command-specific behavior.
Direct Known Subclasses
ConvertCommand, ExportCommand, FeaturesCommand, GlyphsCommand, InfoCommand, InstanceCommand, OpticalSizeCommand, ScriptsCommand, SubsetCommand, TablesCommand, UnicodeCommand, ValidateCommand, VariableCommand
Instance Method Summary collapse
-
#initialize(font_path, options = {}) ⇒ BaseCommand
constructor
Initialize a new command with a font file path and options.
-
#run ⇒ Models::*
Execute the command.
Constructor Details
#initialize(font_path, options = {}) ⇒ BaseCommand
Initialize a new command with a font file path and options.
27 28 29 30 31 |
# File 'lib/fontisan/commands/base_command.rb', line 27 def initialize(font_path, = {}) @font_path = font_path @options = @font = load_font end |
Instance Method Details
#run ⇒ Models::*
Execute the command.
This method must be implemented by subclasses.
39 40 41 |
# File 'lib/fontisan/commands/base_command.rb', line 39 def run raise NotImplementedError, "Subclasses must implement the run method" end |