Class: RedmineAudit::Advisory
- Inherits:
-
Struct
- Object
- Struct
- RedmineAudit::Advisory
- Defined in:
- lib/redmine_audit/advisory.rb
Overview
Redmine advisory
ex) Advisory.new(‘High’, ‘someurl.example.com’,
[Gem::Requirement], [Gem::Requirement])
Instance Attribute Summary collapse
-
#details ⇒ Object
Returns the value of attribute details.
-
#external_references ⇒ Object
Returns the value of attribute external_references.
-
#fixed_versions ⇒ Object
Returns the value of attribute fixed_versions.
-
#severity ⇒ Object
Returns the value of attribute severity.
-
#unaffected_versions ⇒ Object
Returns the value of attribute unaffected_versions.
Instance Method Summary collapse
-
#fixed?(version) ⇒ Boolean
Checks whether the version is fixed against the advisory.
-
#unaffected?(version) ⇒ Boolean
Checks whether the version is not affected by the advisory.
-
#vulnerable?(version) ⇒ Boolean
Checks whether the version is vulnerable to the advisory.
Instance Attribute Details
#details ⇒ Object
Returns the value of attribute details
6 7 8 |
# File 'lib/redmine_audit/advisory.rb', line 6 def details @details end |
#external_references ⇒ Object
Returns the value of attribute external_references
6 7 8 |
# File 'lib/redmine_audit/advisory.rb', line 6 def external_references @external_references end |
#fixed_versions ⇒ Object
Returns the value of attribute fixed_versions
6 7 8 |
# File 'lib/redmine_audit/advisory.rb', line 6 def fixed_versions @fixed_versions end |
#severity ⇒ Object
Returns the value of attribute severity
6 7 8 |
# File 'lib/redmine_audit/advisory.rb', line 6 def severity @severity end |
#unaffected_versions ⇒ Object
Returns the value of attribute unaffected_versions
6 7 8 |
# File 'lib/redmine_audit/advisory.rb', line 6 def unaffected_versions @unaffected_versions end |
Instance Method Details
#fixed?(version) ⇒ Boolean
Checks whether the version is fixed against the advisory.
31 32 33 34 35 |
# File 'lib/redmine_audit/advisory.rb', line 31 def fixed?(version) fixed_versions.any? do |fixed_version| fixed_version === version end end |
#unaffected?(version) ⇒ Boolean
Checks whether the version is not affected by the advisory.
18 19 20 21 22 |
# File 'lib/redmine_audit/advisory.rb', line 18 def unaffected?(version) unaffected_versions.any? do |unaffected_version| unaffected_version === version end end |
#vulnerable?(version) ⇒ Boolean
Checks whether the version is vulnerable to the advisory.
44 45 46 |
# File 'lib/redmine_audit/advisory.rb', line 44 def vulnerable?(version) !fixed?(version) && !unaffected?(version) end |