Skip to content

Improve bundled gem warning messages #12669

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 6, 2025

Conversation

deivid-rodriguez
Copy link
Contributor

The information about default gems no longer available at require time is currently a bit confusing once the default gem is no longer available.

This is because it suggests that the missing gem was actually loaded, and that the problem is a warning, not an actual error.

This PR improves the wording from something like

irb was loaded from the standard library, but is not part of the default gems starting from Ruby 3.5.0

to something like

irb used to be loaded from the standard library, but is not part of the default gems since Ruby 3.5.0

While looking into this improvement, I realized that the current implementation was much more complicated than it needed to, so I removed a bunch of code.

@deivid-rodriguez deivid-rodriguez force-pushed the improve-bundled-gems-messages branch from 389b232 to c59e936 Compare January 29, 2025 22:40
@deivid-rodriguez deivid-rodriguez marked this pull request as ready for review January 29, 2025 22:44
@deivid-rodriguez
Copy link
Contributor Author

@hsbt I have some more improvements that I'd like to build on top of this. Can you have a look when you get a moment?

If anything, I think this may be causing some false positives.
Most of the stuff is not actually necessary.
The name "gem" could be confused with RubyGems activation method.
Currently evenn if the require actually fails, they suggest that the
file was actually loaded, which is confusing. I reworded them to reduce
this confusion.
@deivid-rodriguez deivid-rodriguez force-pushed the improve-bundled-gems-messages branch from c59e936 to ff61489 Compare February 4, 2025 16:04
@hsbt hsbt self-assigned this Feb 5, 2025
@hsbt
Copy link
Member

hsbt commented Feb 6, 2025

@deivid-rodriguez Thanks! This change simplified the current complex logic. I'll merge this because the spec is passed now. If we have unexpected cases, I will fix that until next stable release.

@hsbt hsbt merged commit c833706 into ruby:master Feb 6, 2025
82 checks passed
@deivid-rodriguez deivid-rodriguez deleted the improve-bundled-gems-messages branch February 6, 2025 16:23
@deivid-rodriguez
Copy link
Contributor Author

Great, thank you @hsbt. Now I'm planning to propose a slightly modified version of #11550 that does not have the issue that made you revert it.

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.

2 participants