due e.message =~ / -- openssl$/
begin
require 'openssl'
rescue LoadError => e
raise unless (e.respond_to?(:path) && e.path == 'openssl') ||
e.message =~ / -- openssl$/
end
https://github.com/rubygems/rubygems/blob/master/lib/rubygems/security.rb#L14
I'm curious could this be done in a more (JRuby) compatible way or does it needs to stay and JRuby-OpenSSL should put in "hacks" such as jruby/jruby-openssl#41 ... all JRuby currently does under openssl.rb is a simple: require 'jopenssl/load'