From 21b42c350d55f60ee1ac8b3dc7575e753c61facb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ondruch?= Date: Thu, 30 Apr 2015 12:16:11 +0200 Subject: [PATCH] Mimic MRI's openssl when jopenssl require fails. Some libraries (such as RubyGems) rescues openssl load errors and adjust their behavior depending if the openssl is properly required. However, prior this commit, require 'openssl' succeeded just fine, but the subsequent requires failed, which makes RubyGems (and similar) to fail unexpectedly. --- lib/openssl.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/openssl.rb b/lib/openssl.rb index f3ce235d..d6de6aa4 100644 --- a/lib/openssl.rb +++ b/lib/openssl.rb @@ -1 +1,5 @@ -require 'jopenssl/load' \ No newline at end of file +begin + require 'jopenssl/load' +rescue LoadError => e + e.message.sub! 'jopenssl/load', 'openssl' +end