ruby / ruby/irb

Merge extensions under `EXTEND_COMMANDS` into `Context` class

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

Nobody has claimed this yet.

Dominant language
Ruby
Stars
478
Forks
158
Avg merge
1d 12h
Merged PRs (30d)
12

Description

There are a few features defined as extensions:

https://github.com/ruby/irb/blob/0e862c5751968c589904ed93c3d707d919390597/lib/irb/extend-command.rb#L314-L319

The intention was that those files will be lazily-loaded until the related methods are called. But if we look at context.rb, we can see that all of the methods are called in Context#initialize. So none of them are lazily loaded anymore.

Consider this lazy-loading mechanism + individual extensions' hacks to extend Context introduces unnecessary complexity to IRB (example), I think we should start merging them one by one.

Contributor guide

Open the contributing guide

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 EXTEND_COMMANDS in lib/irb/extend-command.rb and the calls made from Context#initialize in context.rb. Use the extension pattern in lib/irb/ext/history.rb as an example of the complexity to remove. Done means selected extensions are merged into Context while preserving their behavior and eliminating the unnecessary extension hacks.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
cli
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.