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

digest: load digest library using Kernel#require #463

Merged
merged 1 commit into from
Oct 14, 2021

Conversation

rhenium
Copy link
Member

@rhenium rhenium commented Oct 12, 2021

The digest library is a default gem now, too. Therefore we can't simply
use rb_require() to load it, but we should use Kernel#require instead.

This change is based on the suggestion by David Rodríguez in
ruby/digest@1617261#commitcomment-57778397

The digest library is a default gem now, too. Therefore we can't simply
use rb_require() to load it, but we should use Kernel#require instead.

This change is based on the suggestion by David Rodríguez in
ruby/digest@1617261#commitcomment-57778397
@deivid-rodriguez
Copy link

Awesome! I was trying something else here: master...deivid-rodriguez:require_digest_from_ruby_land, but I like your approach better.


/*
* Digest::Class is defined by the digest library. rb_require() cannot be
* used here because it bypasses RubyGems.
Copy link
Contributor

Choose a reason for hiding this comment

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

Helpful contextual comment!

@rhenium rhenium merged commit b013908 into ruby:maint-2.1 Oct 14, 2021
rhenium referenced this pull request in ruby/digest Oct 16, 2021
The gem and bundle commands first load digest via openssl, so loading
the digest gem would cause this warning every time one of these
commands is run:

```
.../lib/ruby/gems/3.0.0/gems/digest-3.1.0/lib/digest.rb:11: warning: already initialized constant Digest::REQUIRE_MUTEX
.../lib/ruby/3.0.0/digest.rb:7: warning: previous definition of REQUIRE_MUTEX was here
```
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.

3 participants