Skip to content
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

Avoid potentially loading the same extension from different versions of the same gem #1155

Merged
merged 1 commit into from
Aug 19, 2024
Merged

Avoid potentially loading the same extension from different versions of the same gem #1155

merged 1 commit into from
Aug 19, 2024

Conversation

deivid-rodriguez
Copy link
Contributor

Avoids warnings like

/path/to/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/rbs-3.4.0/lib/rdoc/discover.rb:10: warning: method redefined; discarding old scan
/path/to/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/rbs-3.5.1/lib/rdoc/discover.rb:10: warning: previous definition of scan was here

…of the same gem

Avoids warnings like

```
/path/to/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/rbs-3.4.0/lib/rdoc/discover.rb:10: warning: method redefined; discarding old scan
/path/to/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/rbs-3.5.1/lib/rdoc/discover.rb:10: warning: previous definition of scan was here
```
@olleolleolle
Copy link
Contributor

@deivid-rodriguez
Copy link
Contributor Author

I don't really like this "auto-discovery" mechanism for loading plugins. Minitest does something similar but allows to toggle off auto-discovery with an ENV variable, and also has recently added Minitest.register_plugin for a more explicit approach. I'd be happy if rdoc follows the same path, but I think this little change is an improvement regardless!

Copy link
Contributor

@olleolleolle olleolleolle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use this!

@deivid-rodriguez
Copy link
Contributor Author

By the way, funny that Gem.find_latest_files docs using exactly this example, yet the real code was not actually using it 😅.

Thanks for having a look @olleolleolle!

@olleolleolle olleolleolle merged commit e47920d into ruby:master Aug 19, 2024
26 checks passed
@deivid-rodriguez deivid-rodriguez deleted the improve-extension-loading branch August 19, 2024 11:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants