Class: Cabriolet::Commands::BaseCommandHandler
- Inherits:
-
Object
- Object
- Cabriolet::Commands::BaseCommandHandler
- Defined in:
- lib/cabriolet/cli/base_command_handler.rb
Overview
Abstract base class for format-specific command handlers
This class defines the interface that all format command handlers must implement. Each format (CAB, CHM, SZDD, KWAJ, HLP, LIT, OAB) should have its own CommandHandler subclass that inherits from this base class.
The base class provides common functionality and enforces a consistent interface across all format handlers, following the Template Method pattern.
Direct Known Subclasses
Cabriolet::CAB::CommandHandler, Cabriolet::CHM::CommandHandler, HLP::CommandHandler, KWAJ::CommandHandler, LIT::CommandHandler, OAB::CommandHandler, SZDD::CommandHandler
Instance Method Summary collapse
-
#create(output, files, options = {}) ⇒ Object
Create a new archive.
-
#extract(file, output_dir, options = {}) ⇒ Object
Extract files from archive.
-
#info(file, options = {}) ⇒ Object
Display archive information.
-
#initialize(verbose: false) ⇒ BaseCommandHandler
constructor
Initialize the command handler.
-
#list(file, options = {}) ⇒ Object
List archive contents.
-
#test(file, options = {}) ⇒ Object
Test archive integrity.
Constructor Details
#initialize(verbose: false) ⇒ BaseCommandHandler
Initialize the command handler
29 30 31 |
# File 'lib/cabriolet/cli/base_command_handler.rb', line 29 def initialize(verbose: false) @verbose = verbose end |
Instance Method Details
#create(output, files, options = {}) ⇒ Object
Create a new archive
60 61 62 63 |
# File 'lib/cabriolet/cli/base_command_handler.rb', line 60 def create(output, files, = {}) raise NotImplementedError, "#{self.class} must implement #create" end |
#extract(file, output_dir, options = {}) ⇒ Object
Extract files from archive
49 50 51 52 |
# File 'lib/cabriolet/cli/base_command_handler.rb', line 49 def extract(file, output_dir, = {}) raise NotImplementedError, "#{self.class} must implement #extract" end |
#info(file, options = {}) ⇒ Object
Display archive information
70 71 72 73 |
# File 'lib/cabriolet/cli/base_command_handler.rb', line 70 def info(file, = {}) raise NotImplementedError, "#{self.class} must implement #info" end |
#list(file, options = {}) ⇒ Object
List archive contents
38 39 40 41 |
# File 'lib/cabriolet/cli/base_command_handler.rb', line 38 def list(file, = {}) raise NotImplementedError, "#{self.class} must implement #list" end |
#test(file, options = {}) ⇒ Object
Test archive integrity
80 81 82 83 |
# File 'lib/cabriolet/cli/base_command_handler.rb', line 80 def test(file, = {}) raise NotImplementedError, "#{self.class} must implement #test" end |