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
@ -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…
x
Reference in New Issue
Block a user