Skip to content

Preserve custom inspect on Delegator wrappers - #100

Open
OskarEichler wants to merge 2 commits into
ruby:masterfrom
OskarEichler:codex/delegator-inspect-precedence
Open

Preserve custom inspect on Delegator wrappers#100
OskarEichler wants to merge 2 commits into
ruby:masterfrom
OskarEichler:codex/delegator-inspect-precedence

Conversation

@OskarEichler

Copy link
Copy Markdown

Dependency: This is a focused follow-up to open PR #60. The branch contains a release-compatible adaptation of #60 followed by one reviewable fix commit; #60 should land first or this branch should be rebased after it lands.

Problem: PR #60 restores a Delegator wrapper's custom pretty_print, but issue #39 remains for wrappers that customize only inspect: PP replaces the wrapper presentation with the delegated target's output.

Fix: Apply the documented priority wrapper pretty_print > wrapper inspect > target/generic, while preserving target fallback, cycle handling, BasicObject support, and exception propagation. The implementation avoids materializing singleton classes for ordinary wrappers.

Regression coverage: Adds upstream cases for class-level and singleton inspect, custom pretty_print priority, BasicObject targets, inspect failures, and both delegate/pp load orders. The combined completion branch passes 42 tests / 64 assertions on Ruby 4.0.6 and 39 / 56 on Ruby 3.2, plus 510 focused model checks on each Ruby. No separate issue was opened; this addresses existing #39.

nobu and others added 2 commits August 31, 2026 00: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.

2 participants