diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2020-06-29 18:43:40 +0200 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2020-07-31 21:07:19 +0900 |
commit | ea8f7d4a81fa9e1696930c63b106cc91be14c29d (patch) | |
tree | 9238c167ff6b00bfdbf6dab0150a6dd793b3226a /lib | |
parent | 6608bc77b6560caab2b80271b3f48a792ac33463 (diff) |
[rubygems/rubygems] Gem::Specification#to_ruby doesn't need `openssl`
The `openssl` require when openssl not present was having the
side-effect the our custom require fallbacks would end up loading `Gem::Specification.stubs`.
Co-authored-by: Alyssa Ross <hi@alyssa.is>
https://github.com/rubygems/rubygems/commit/22c4ded4ad
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3379
Diffstat (limited to 'lib')
-rw-r--r-- | lib/rubygems/specification.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/rubygems/specification.rb b/lib/rubygems/specification.rb index 0bd62c3648..883cad35f9 100644 --- a/lib/rubygems/specification.rb +++ b/lib/rubygems/specification.rb @@ -2411,7 +2411,7 @@ class Gem::Specification < Gem::BasicSpecification # still have their default values are omitted. def to_ruby - require 'openssl' + require_relative 'openssl' mark_version result = [] result << "# -*- encoding: utf-8 -*-" @@ -2451,7 +2451,7 @@ class Gem::Specification < Gem::BasicSpecification next if handled.include? attr_name current_value = self.send(attr_name) if current_value != default_value(attr_name) || self.class.required_attribute?(attr_name) - result << " s.#{attr_name} = #{ruby_code current_value}" unless current_value.is_a?(OpenSSL::PKey::RSA) + result << " s.#{attr_name} = #{ruby_code current_value}" unless defined?(OpenSSL::PKey::RSA) && current_value.is_a?(OpenSSL::PKey::RSA) end end |