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

Change const_missing require for SHA2 #22

Closed
wants to merge 1 commit into from

Conversation

jeremyevans
Copy link

Require sha2.rb instead of sha2.so. With a change proposed for
Ruby feature 15856, once sha2.so is loaded, require 'sha2' will
not load sha2.rb, resulting in Digest::SHA2 not being defined
in the following case:

require "digest"
p Digest::SHA256 #=> Digest::SHA256
p Digest::SHA2

As digest/sha2.rb requires digest/sha2.so, this should not cause
any backwards compatibility issues.

Patch from Dan0042 (Daniel DeLorme)

Require sha2.rb instead of sha2.so.  With a change proposed for
Ruby feature 15856, once sha2.so is loaded, require 'sha2' will
not load sha2.rb, resulting in Digest::SHA2 not being defined
in the following case:

```ruby
require "digest"
p Digest::SHA256 #=> Digest::SHA256
p Digest::SHA2
```

As digest/sha2.rb requires digest/sha2.so, this should not cause
any backwards compatibility issues.

Patch from Dan0042 (Daniel DeLorme)
@jeremyevans
Copy link
Author

@nobu came up with a better approach for fixing Ruby issue 15856 (ruby/ruby#4674) that does not require this change, so this can be closed.

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.

None yet

1 participant