Skip to content

Complete the Errors enumerable contract - #227

Open
OskarEichler wants to merge 1 commit into
wardencommunity:masterfrom
OskarEichler:codex/fix-errors-enumeration
Open

OskarEichler wants to merge 1 commit into
wardencommunity:masterfrom
OskarEichler:codex/fix-errors-enumeration

Conversation

@OskarEichler

Copy link
Copy Markdown

Summary:

  • return an Enumerator when Proxy::Errors#each is called without a block
  • iterate values directly without allocating an intermediate key/value array
  • report delegated Hash methods through respond_to_missing?

Reproduction:

On current main, errors.each raises LocalJumpError, despite including Enumerable, and errors.respond_to?(:keys) is false even though errors.keys works through method_missing.

Verification:

  • bundle exec rake spec — 224 examples, 0 failures on Ruby 4.0.6 / Rack 3
  • focused enumeration/introspection model passes on current main and the cumulative v1.2.9 consumer
  • Ruby syntax and git diff --check pass

Existing block iteration continues yielding each non-empty message array. Codex assisted with the audit and patch.

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