FEATURE: Redesign Writer API with entry type methods and placeholders#9
Open
gschlager wants to merge 2 commits into
Open
FEATURE: Redesign Writer API with entry type methods and placeholders#9gschlager wants to merge 2 commits into
gschlager wants to merge 2 commits into
Conversation
ce2ab27 to
0911faa
Compare
7e255ea to
ebdf291
Compare
Replaces the low-level add_file_from_source/add_file_from_stream API with intuitive methods for each entry type: file(), directory(), symlink(), hardlink(), and placeholder(). New features: - file() supports from:, content:, or streaming block - directory() for directory entries - symlink() and hardlink() for links with path traversal protection - placeholder() reserves space to fill later (useful for manifests) - Path validation rejects traversal attacks by default - Automatic username/groupname lookup from uid/gid Architecture improvements: - Extract ContentWriter for file content handling - Extract PlaceholderManager for placeholder lifecycle - Extract EntryAttributes value object for tar metadata - Extract PathValidator and SourceValidator for input validation - Simplify Header to receive EntryAttributes directly - Reorganize specs into unit/ and integration/ directories - Add integration tests with real tar extractors (GNU tar, bsdtar)
57d1cb2 to
8ad8ef8
Compare
gschlager
commented
Feb 3, 2026
gschlager
left a comment
Member
Author
There was a problem hiding this comment.
@gschlager partially reviewed 94 files and all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @gschlager).
Organize files into logical subdirectories:
lib/mini_tarball/
- headers/: header.rb, header_fields.rb, header_formatter.rb,
header_writer.rb, user_group_lookup.rb
- validators/: path_validator.rb, source_validator.rb
- writers/: writer.rb, content_writer.rb, null_writer.rb,
placeholder.rb, placeholder_manager.rb, entry_attributes.rb
- streams/: (unchanged)
- errors.rb, version.rb (top-level)
Specs mirror the lib structure. Integration tests moved to writers/.
5153c3c to
89c737f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Replaces the low-level add_file_from_source/add_file_from_stream API with
intuitive methods for each entry type: file(), directory(), symlink(),
hardlink(), and placeholder().
New features:
Architecture improvements:
This change is