fix: document digest_file_ctx and add DESTROY guard#11
Closed
toddr-bot wants to merge 21 commits into
Closed
Conversation
Drop use vars
- meta-spec 2 resources format - dependencies are static, set dynamic_config 0 - EUMM will set configure_requires on itself - Test::More only used in tests - boilerplate to clean out unsupported keys if installed with old EUMM
Makefile.PL - use meta-spec 2, fix prereqs, compatibility with old EUMM
base.t, file.t: unlink temporary files created during testing
Ignore common temp files in repo.
digest_file_ctx was exported via @EXPORT_OK but never documented in the POD, making it invisible to users. Add documentation and tests. Add explicit DESTROY sub to prevent AUTOLOAD from catching implicit destruction calls — standard Perl best practice when using AUTOLOAD. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Author
|
Superseded by #13, which combines all three improvements (DESTROY guard, Digest::file modernization, digest_file_ctx documentation). |
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.
What
Document the
digest_file_ctxfunction inDigest::filePOD and add an explicitDESTROYmethod toDigest.pmto prevent AUTOLOAD interference.Why
digest_file_ctxis exported via@EXPORT_OKbut was never documented in the POD — users reading the docs couldn't discover it. The POD also incorrectly stated "3 convenience functions" when 4 are exported.AUTOLOADwithout an explicitDESTROYis a classic Perl pitfall: implicit destruction calls route through AUTOLOAD, triggering unnecessaryrequireattempts. Addingsub DESTROY {}is standard practice.How
digest_file_ctxdocumentation toDigest::filePOD, matching the existing style for other functions.sub DESTROY {}after the AUTOLOAD definition inDigest.pm.digest_file_ctxreturn type and content, error handling, andcan("DESTROY")check.Testing
All tests pass (4 files, 28 subtests).
🤖 Generated with Claude Code