Implement zip-based image delivery and improve code quality #21
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements zip-based image delivery for PDF conversions and includes significant code quality improvements across the codebase.
🎯 Key Changes
Zip-Based Delivery
imagesfield now returns a single zip URL instead of an arrayCode Quality Improvements
ZipBuilderclass with A rating and 0 code smellsPdfConverterfrom C to B rating in RubyCriticRetryErrorclass📊 Metrics
Test Coverage:
Code Quality:
🔧 Technical Details
New Dependencies:
rubyzipgem (~> 2.3) for zip file creationAPI Changes:
imagesfield changed from array to string (single zip URL).zipfileNew Files:
pdf_converter/lib/zip_builder.rb- A-rated zip creation utilitypdf_converter/spec/lib/zip_builder_spec.rb- Comprehensive test suiteCode Quality Improvements:
ENV['AWS_ENDPOINT_URL']to variables (3 duplicates → 1)event['body']to variable (4 duplicates → 1)body['webhook']to variable (2 duplicates → 1)validation_result[:error]to variable (2 duplicates → 1)temp_pdf.pathto variable (2 duplicates → 1)page_index + 1topage_numbervariable (multiple duplicates → reused)📚 Documentation Updates
CLAUDE.mdAPI specification with zip file examplesREADME.mdwith zip-based usage instructions.zipfilesRetryErrorclass✅ Benefits
🧪 Test Plan
🤖 Generated with Claude Code