mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 16:44:01 +02:00
Simplify handling of a LoadError
The `LoadError` has a `path` reader in all supported rubies.
This commit is contained in:
parent
e0337ce597
commit
967dba157c
Notes:
git
2020-06-17 21:17:28 +09:00
1 changed files with 1 additions and 2 deletions
|
@ -5,8 +5,7 @@ require 'webrick'
|
|||
begin
|
||||
require 'webrick/https'
|
||||
rescue LoadError => e
|
||||
raise unless (e.respond_to?(:path) && e.path == 'openssl') ||
|
||||
e.message =~ / -- openssl$/
|
||||
raise unless e.path == 'openssl'
|
||||
end
|
||||
|
||||
unless defined?(OpenSSL::SSL)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue