Extending Cabriolet
Adding New Formats
To add a new format:
-
Create model classes in
lib/cabriolet/models/ -
Implement parser in
lib/cabriolet/{format}/parser.rb -
Implement decompressor in
lib/cabriolet/{format}/decompressor.rb -
Add tests in
spec/{format}/ -
Update documentation
Adding Compression Algorithms
To add a new algorithm:
-
Implement in
lib/cabriolet/decompressors/{algorithm}.rb -
Inherit from
Decompressors::Base -
Implement
decompressmethod -
Add tests
-
Register in format’s compression type mapping
Best practices
-
Follow existing patterns
-
Maintain MECE principles
-
Write comprehensive tests
-
Document thoroughly