Skip to content

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

Merged
olleolleolle merged 1 commit into
ruby:masterfrom
deivid-rodriguez:improve-extension-loading
Aug 19, 2024
Merged

olleolleolle merged 1 commit into
ruby:masterfrom
deivid-rodriguez:improve-extension-loading

Conversation

@deivid-rodriguez

Copy link
Copy Markdown
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
Copy Markdown
Contributor

@deivid-rodriguez

Copy link
Copy Markdown
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!

@olleolleolle olleolleolle left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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