From 69fa0d6d30adc876858a9bbc5baddbc9f643b9c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Sat, 11 Jul 2020 10:10:16 +0200 Subject: [PATCH] [rubygems/rubygems] Move openssl require to a separate file So it can be reused. https://github.com/rubygems/rubygems/commit/b9fc6e40db --- lib/rubygems/openssl.rb | 7 +++++++ lib/rubygems/security.rb | 7 +------ 2 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 lib/rubygems/openssl.rb 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