Skip to content

Fix wrong receiver in eoutvar example for #src#123

Merged
k0kubun merged 1 commit into
masterfrom
fix-src-doc-example
Jul 15, 2026
Merged

Fix wrong receiver in eoutvar example for #src#123
k0kubun merged 1 commit into
masterfrom
fix-src-doc-example

Conversation

@hsbt

@hsbt hsbt commented Jul 15, 2026

Copy link
Copy Markdown
Member

The second example in the documentation for #src raises NoMethodError as written. When the example was changed to assign the ERB instance to erb instead of template, the next line was left calling template.src, but template is a String at that point. This fixes the receiver to erb.

I ran the corrected example and confirmed it produces exactly the output shown in the documentation.

The example was updated to assign the ERB instance to `erb` instead
of `template`, but the following line still called `template.src`.
Since `template` is a String there, the example raises NoMethodError.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 15, 2026 04:40

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@k0kubun k0kubun merged commit fbe832a into master Jul 15, 2026
9 checks passed
@k0kubun k0kubun deleted the fix-src-doc-example branch July 15, 2026 16:15
matzbot pushed a commit to ruby/ruby that referenced this pull request Jul 15, 2026
(ruby/erb#123)

The example was updated to assign the ERB instance to `erb` instead
of `template`, but the following line still called `template.src`.
Since `template` is a String there, the example raises NoMethodError.

ruby/erb@fbe832ac5c

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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.

3 participants