adjust reject filter

This commit is contained in:
kenna-bmcdevitt 2020-10-27 01:58:38 -05:00
parent a3c6da611d
commit 1045a44ddc

View file

@ -12,6 +12,8 @@ class MicrosoftKbChecker
attr_accessor :options
# options hash {:cve_id => 'cve-2020-1234', :os_name => 'Windows Server 2012'}
# you can also pass in an advisory number as it uses the same API endpoint
# eg... {:cve_id => 'ADV180002', :os_name => "Windows Server 2012 R2"}
def initialize(options)
@options = options
end
@ -115,7 +117,7 @@ class MicrosoftKbChecker
kbs = articles.map do |article_info|
num = article_info[:article_num]
os_json.values_at("articleTitle#{num}")
end.flatten.reject! { |kb| kb == '' }
end.flatten.reject { |kb| kb == '' }
{
os_name: os_json['name'],
cve_id: options[:cve_id],