Sha256: d76830a55bd7366224dce35590b8e965c7e62e15231dab50d942c5bea1e67aca
Contents?: true
Size: 930 Bytes
Versions: 16
Compression:
Stored size: 930 Bytes
Contents
module ::ProxyAPI class AvailableProxy HTTP_ERRORS = [ EOFError, Errno::ECONNRESET, Errno::EINVAL, Net::HTTPBadResponse, Net::HTTPHeaderSyntaxError, Net::ProtocolError, Timeout::Error ].freeze def initialize(args) @args = args end def available? begin return true if has_scap_feature? && minimum_version rescue *HTTP_ERRORS return false end false end private def has_scap_feature? @features ||= ::ProxyAPI::Features.new(@args).features @features.include?('openscap') end def openscap_proxy_version @versions ||= ::ProxyAPI::Version.new(@args).proxy_versions['modules'] @versions['openscap'] if @versions && @versions['openscap'] end def minimum_version return false unless openscap_proxy_version openscap_proxy_version.to_f >= 0.5 end end end
Version data entries
16 entries across 16 versions & 1 rubygems