Class: Compliance::Support
- Inherits:
-
Object
- Object
- Compliance::Support
- Defined in:
- lib/bundles/inspec-compliance/support.rb
Overview
is a helper that provides information which version of compliance supports which feature
Class Method Summary collapse
-
.supported?(feature, version) ⇒ Boolean
determines if the given version support a certain feature.
-
.version_with_support(feature) ⇒ Object
for a feature, returns either: - a version v0: v supports v0 iff v0 <= v - an array [v0, v1] of two versions: v supports [v0, v1] iff v0 <= v < v1.
Class Method Details
.supported?(feature, version) ⇒ Boolean
determines if the given version support a certain feature
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/bundles/inspec-compliance/support.rb', line 22 def self.supported?(feature, version) sup = version_with_support(feature) if sup.is_a?(Array) Gem::Version.new(version) >= sup[0] && Gem::Version.new(version) < sup[1] else Gem::Version.new(version) >= sup end end |
.version_with_support(feature) ⇒ Object
for a feature, returns either:
- a version v0: v supports v0 iff v0 <= v
- an array [v0, v1] of two versions: v supports [v0, v1] iff v0 <= v < v1
12 13 14 15 16 17 18 19 |
# File 'lib/bundles/inspec-compliance/support.rb', line 12 def self.version_with_support(feature) case feature.to_sym when :oidc # open id connect authentication Gem::Version.new('0.16.19') else Gem::Version.new('0.0.0') end end |