strip end of line CR from show_source
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
Research direction
Start at the show_source implementation and reproduce the issue with a Ruby source file using CRLF newlines on Windows or WSL. Trace how source lines are read and displayed, then verify that show_source no longer prints a trailing ^M while preserving normal source output.
Written by the indexing model from the issue text.
Description
Description
The ruby parser considers CR to be a whitespace character, but IRB does not seem to do that.
This may result in an extra ^M at the end of a line when viewing the source from IRB.
How to reproduce
Save the following source code in CRLF newline on Windows and execute it on WSL.
def desc
"this file has CRLF newline"
end
binding.irb
$ ruby /mnt/r/crlf.rb
From: /mnt/r/crlf.rb @ line 4 :
1: def desc^M
2: "this file has CRLF newline"^M
3: end^M
=> 4: binding.irb^M
irb(main):001> show_source "desc"
From: /mnt/r/crlf.rb:1
def desc^M
"this file has CRLF newline"^M
end^M
=> nil
irb(main):002>
- Dominant language
- Ruby
- Stars
- 477
- Forks
- 165
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 5
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ruby/irb
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
Maintainers usually reply within 2 days
-
Proposal: public hook for external documentation providers in show_doc and the completion doc dialogPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 5/5 Over a week Newbie friendliness 38/100
Maintainers usually reply within 2 days
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
Maintainers usually reply within 2 days
Similar issues
-
needs verification
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
Maintainers usually reply within 13 days
-
🐛 bug 👩💻 équipe CE 🧑🏭 entreprises
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
betagouv/conseillers-entreprises#4808 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
yosiat/panko_serializer#250 ·