mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Added version guard for OpenSSL::Config
This commit is contained in:
parent
e4a26cd4f8
commit
2fd779fcd9
2 changed files with 31 additions and 12 deletions
16
spec/ruby/library/openssl/shared/version.rb
Normal file
16
spec/ruby/library/openssl/shared/version.rb
Normal file
|
@ -0,0 +1,16 @@
|
|||
require 'openssl'
|
||||
|
||||
class OpenSSLVersionGuard < VersionGuard
|
||||
FULL_OPENSSL_VERSION = SpecVersion.new OpenSSL::VERSION
|
||||
def match?
|
||||
if Range === @version
|
||||
@version.include? FULL_OPENSSL_VERSION
|
||||
else
|
||||
FULL_OPENSSL_VERSION >= @version
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def openssl_version_is(*args, &block)
|
||||
OpenSSLVersionGuard.new(*args).run_if(:openssl_version_is, &block)
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue