diff --git a/lib/rubygems/openssl.rb b/lib/rubygems/openssl.rb new file mode 100644 index 0000000000..39ef91e888 --- /dev/null +++ b/lib/rubygems/openssl.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +begin + require "openssl" +rescue LoadError => e + raise unless e.path == 'openssl' +end diff --git a/lib/rubygems/security.rb b/lib/rubygems/security.rb index 5c67bf5f1b..bd6d6ff8b9 100644 --- a/lib/rubygems/security.rb +++ b/lib/rubygems/security.rb @@ -7,12 +7,7 @@ require 'rubygems/exceptions' require 'fileutils' - -begin - require 'openssl' -rescue LoadError => e - raise unless e.path == 'openssl' -end +require_relative 'openssl' ## # = Signing gems