ruby / ruby/pp

Warning of NoMethodError while $DEBUG

Open
#73 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
36
Forks
21
Avg merge
8h 22m
Merged PRs (30d)
1

Description

If $DEBUG is turned on, I always see this line:

Exception 'NoMethodError' at /home/user/.rubies/ruby-4.0.1/lib/ruby/4.0.0/pp.rb:82 - undefined method 'winsize' for an instance of String

It would be nice if pp could avoid that exception entirely, because it's confusing when searching the output for errors while debugging other code.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Inspect pp.rb:82 and reproduce the warning with $DEBUG enabled, focusing on the winsize call reported on the String instance. Done means pp no longer emits this NoMethodError while $DEBUG is enabled; check the repository's existing tests for a suitable regression case.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.