Skip to content

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
@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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants