Skip to content

Add the private Time#_dump / Time._load Marshal hooks - #501

Merged
tannevaled merged 1 commit into
mainfrom
feat/time-dump
Aug 30, 2026
Merged

tannevaled merged 1 commit into
mainfrom
feat/time-dump

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

Time#_dump packs a Time into MRI's 8-byte marshal form (extracted from the
Marshal codec's writeTime into a shared timeDumpBytes) and Time._load
rebuilds a Time from those bytes. Both are private (as MRI has them): _dump
an instance method absent from respond_to?, _load a private class method.
Marshal round-trips are unchanged.

Verified against ruby 4.0.6. Whole-package coverage stays at 100%; the ruby/spec
ratchet floor rises to 16290 (core/time/_dump 0 → 5, _load 0 → 2,
marshal/dump +1, zero regressions in a per-file sweep).

🤖 Generated with Claude Code

@tannevaled
tannevaled force-pushed the feat/time-dump branch 2 times, most recently from cb599ee to 14326f0 Compare August 30, 2026 09:30
Time#_dump packs a Time into MRI's 8-byte marshal form (extracted from the
Marshal codec's writeTime into a shared timeDumpBytes) and Time._load rebuilds a
Time from those bytes. Both are private (as MRI has them): _dump an instance
method absent from respond_to?, _load a private class method. Marshal round-trips
are unchanged.

Verified against ruby 4.0.6. Whole-package coverage stays at 100%; the ruby/spec
floor rises to 16290 (core/time/_dump 0 -> 5, _load 0 -> 2, marshal/dump +1).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit db43d87 into main Aug 30, 2026
7 checks passed
@tannevaled
tannevaled deleted the feat/time-dump branch August 30, 2026 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant