summaryrefslogtreecommitdiff
path: root/ext/digest/lib
diff options
context:
space:
mode:
authorPavel Rosick√Ĺ <pavel.rosicky@easy.cz>2021-06-12 18:49:57 +0200
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2021-10-12 20:46:13 +0900
commit94882df3a215a3de16fa7ca18cf5c160f904c904 (patch)
tree1150503c5eb6a5b570ba3eb5e8fce26998fe036a /ext/digest/lib
parentff1f696d300cdf2a7073ddec91846cd3aee103d8 (diff)
[ruby/digest] jruby support
https://github.com/ruby/digest/commit/2e9dc14693
Diffstat (limited to 'ext/digest/lib')
-rw-r--r--ext/digest/lib/digest.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/ext/digest/lib/digest.rb b/ext/digest/lib/digest.rb
index ba0637af32..912198811b 100644
--- a/ext/digest/lib/digest.rb
+++ b/ext/digest/lib/digest.rb
@@ -1,5 +1,9 @@
# frozen_string_literal: false
-require 'digest.so'
+if RUBY_ENGINE == 'jruby'
+ JRuby::Util.load_ext("org.jruby.ext.digest.DigestLibrary")
+else
+ require 'digest.so'
+end
module Digest
# A mutex for Digest().
@@ -8,7 +12,7 @@ module Digest
def self.const_missing(name) # :nodoc:
case name
when :SHA256, :SHA384, :SHA512
- lib = 'digest/sha2.so'
+ lib = 'digest/sha2'
else
lib = File.join('digest', name.to_s.downcase)
end