Fixed Version compare for issue #179
This commit is contained in:
@@ -5,20 +5,22 @@ require 'vulnerability/output'
|
||||
class Vulnerability
|
||||
include Vulnerability::Output
|
||||
|
||||
attr_accessor :title, :references, :type, :metasploit_modules
|
||||
attr_accessor :title, :references, :type, :fixed_in, :metasploit_modules
|
||||
|
||||
#
|
||||
# @param [ String ] title The title of the vulnerability
|
||||
# @param [ String ] type The type of the vulnerability
|
||||
# @param [ Array ] references References urls
|
||||
# @param [ Array ] metasploit_modules Metasploit modules for the vulnerability
|
||||
# @param [ String ] fixed_in Vuln fixed in Version X
|
||||
#
|
||||
# @return [ Vulnerability ]
|
||||
def initialize(title, type, references, metasploit_modules = [])
|
||||
def initialize(title, type, references, metasploit_modules = [], fixed_in)
|
||||
@title = title
|
||||
@type = type
|
||||
@references = references
|
||||
@metasploit_modules = metasploit_modules
|
||||
@fixed_in = fixed_in
|
||||
end
|
||||
|
||||
# @param [ Vulnerability ] other
|
||||
@@ -26,7 +28,11 @@ class Vulnerability
|
||||
# @return [ Boolean ]
|
||||
# :nocov:
|
||||
def ==(other)
|
||||
title == other.title && type == other.type && references == other.references
|
||||
title == other.title &&
|
||||
type == other.type &&
|
||||
references == other.references &&
|
||||
fixed_in == other.fixed_in &&
|
||||
metasploit_modules == other.metasploit_modules
|
||||
end
|
||||
# :nocov:
|
||||
|
||||
@@ -40,7 +46,8 @@ class Vulnerability
|
||||
xml_node.search('title').text,
|
||||
xml_node.search('type').text,
|
||||
xml_node.search('reference').map(&:text),
|
||||
xml_node.search('metasploit').map(&:text)
|
||||
xml_node.search('metasploit').map(&:text),
|
||||
xml_node.search('fixed_in').text
|
||||
)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user