27 lines
560 B
Ruby
Executable File
27 lines
560 B
Ruby
Executable File
# encoding: UTF-8
|
|
|
|
class WpItem
|
|
|
|
# moved this into the module ?
|
|
def vulns_file=(file)
|
|
if File.exists?(file)
|
|
@vulns_file = file
|
|
else
|
|
raise "The file #{file} does not exist"
|
|
end
|
|
end
|
|
|
|
module Vulnerable
|
|
# @return [ Vulnerabilities ]
|
|
def vulnerabilities
|
|
xml = xml(vulns_file)
|
|
vulnerabilities = Vulnerabilities.new
|
|
|
|
xml.xpath(vulns_xpath).each do |node|
|
|
vulnerabilities << Vulnerability.load_from_xml_node(node)
|
|
end
|
|
vulnerabilities
|
|
end
|
|
end
|
|
end
|