You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed 2 "surprising" .irbrc loading behaviour recently:
Lack of hierarchy on rc file loading
Unlike many other tools that have "project level" and "user level" configurations, IRB only accepts a single .irbrc file through a fixed loading order.
For example, it doesn't load project/.irbrc if ~/.irbrc is present.
This is unintuitive to most users as popular tools like Pry or VS Code both have "user level" and "project level" configurations. And they usually load "user level" configs first, and allow "project level" configs to override them.
.irb_history is always placed at the same place as .irbrc is defined
This is also not an intuitive design. Most of the time, .irb_history should not be inside the project folder. So the current reality is, if a project wants to define .irbrc for all its developers, .irb_history needs to be added to .gitignore or the project needs to configure IRB.conf[:HISTORY_FILE] (example).
First time irb contributor here - just wanted to say thank you for maintaining Ruby's core tool! 🙏
I'd love to contribute to give back to the community so I picked first part of the issue and made a PR. I feel like I'm walking in the dark a bit, but managed to test it on the "local"(github codespace) environment and it passes automatic tests as well. I wasn't able to verify the yamatanooroti due to codespace limitations - might get back to it on local environment next week.
I'm extremely open to feedback - would love to contribute more to irb in the future!
Sorry so much for disappearing so suddenly! I really hoped to finish this one and then life took an unexpected turn - deeply sorry about that. Also thank you to @hahmed & @tompng for working on this one 🙏
I hope I'll be able to make up for this one as I'll have more time for OSS soon🤞
Activity
ktopolski commentedon Dec 9, 2023
Hello 👋
First time
irbcontributor here - just wanted to say thank you for maintaining Ruby's core tool! 🙏I'd love to contribute to give back to the community so I picked first part of the issue and made a PR. I feel like I'm walking in the dark a bit, but managed to test it on the "local"(github codespace) environment and it passes automatic tests as well. I wasn't able to verify the yamatanooroti due to codespace limitations - might get back to it on local environment next week.
I'm extremely open to feedback - would love to contribute more to irb in the future!
elfham commentedon Mar 13, 2024
Since #859,
~/.config/irb/irbrcis loaded twice when$XDG_CONFIG_HOMEis set.IMHO, only one irbrc file should be loaded at each "user level" and "project level".
For example, if there are 4 files as below,
~/.config/irb/irbrc~/.irbrc./.irbrc./_irbrconly
~/.config/irb/irbrcand./.irbrcshould be loaded and others should be ignored.How do you think about this?
elfham commentedon Mar 13, 2024
By the way, since #859,
~/.irbrcis loaded twice at ~/ if HOME directory is symlinked.ktopolski commentedon Apr 18, 2024
Hey @elfham 👋
Sorry so much for disappearing so suddenly! I really hoped to finish this one and then life took an unexpected turn - deeply sorry about that. Also thank you to @hahmed & @tompng for working on this one 🙏
I hope I'll be able to make up for this one as I'll have more time for OSS soon🤞