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
|
begin
|
||||||
require 'webrick/https'
|
require 'webrick/https'
|
||||||
rescue LoadError => e
|
rescue LoadError => e
|
||||||
raise unless (e.respond_to?(:path) && e.path == 'openssl') ||
|
raise unless e.path == 'openssl'
|
||||||
e.message =~ / -- openssl$/
|
|
||||||
end
|
end
|
||||||
|
|
||||||
unless defined?(OpenSSL::SSL)
|
unless defined?(OpenSSL::SSL)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user