Tabs replaced by spaces !

The presence of tabs can be checked with 'rubocop --only Tab --format
files'
This commit is contained in:
erwanlr
2013-12-30 11:50:43 +00:00
parent 23de013c86
commit dc1c65b418
12 changed files with 106 additions and 106 deletions

View File

@@ -5,7 +5,7 @@ require 'vulnerability/urls'
class Vulnerability
include Vulnerability::Output
include Vulnerability::Urls
include Vulnerability::Urls
attr_accessor :title, :references, :type, :fixed_in
@@ -41,16 +41,16 @@ class Vulnerability
#
# @return [ Vulnerability ]
def self.load_from_xml_node(xml_node)
references = {}
refs = xml_node.search('references')
if refs
references[:url] = refs.search('url').map(&:text)
references[:cve] = refs.search('cve').map(&:text)
references[:secunia] = refs.search('secunia').map(&:text)
references[:osvdb] = refs.search('osvdb').map(&:text)
references[:metasploit] = refs.search('metasploit').map(&:text)
references[:exploitdb] = refs.search('exploitdb').map(&:text)
end
references = {}
refs = xml_node.search('references')
if refs
references[:url] = refs.search('url').map(&:text)
references[:cve] = refs.search('cve').map(&:text)
references[:secunia] = refs.search('secunia').map(&:text)
references[:osvdb] = refs.search('osvdb').map(&:text)
references[:metasploit] = refs.search('metasploit').map(&:text)
references[:exploitdb] = refs.search('exploitdb').map(&:text)
end
new(
xml_node.search('title').text,
xml_node.search('type').text,

View File

@@ -8,12 +8,12 @@ class Vulnerability
puts ' |'
puts ' | ' + red("* Title: #{title}")
references.each do |key, urls|
methodname = "url_#{key}"
urls.each do |u|
url = send(methodname, u)
puts ' | ' + red("* Reference: #{url}") if url
end
end
methodname = "url_#{key}"
urls.each do |u|
url = send(methodname, u)
puts ' | ' + red("* Reference: #{url}") if url
end
end
if !fixed_in.empty?
puts " | * Fixed in: #{fixed_in}"
end

View File

@@ -1,33 +1,33 @@
# encoding: UTF-8
class Vulnerability
module Urls
# @return [ String ] The url to the metasploit module page
def url_metasploit(module_path)
# remove leading slash
module_path = module_path.sub(/^\//, '')
"http://www.metasploit.com/modules/#{module_path}"
end
module Urls
# @return [ String ] The url to the metasploit module page
def url_metasploit(module_path)
# remove leading slash
module_path = module_path.sub(/^\//, '')
"http://www.metasploit.com/modules/#{module_path}"
end
def url_url(url)
url
end
def url_url(url)
url
end
def url_cve(cve)
"http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-#{cve}"
end
def url_cve(cve)
"http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-#{cve}"
end
def url_osvdb(id)
"http://osvdb.org/#{id}"
end
def url_osvdb(id)
"http://osvdb.org/#{id}"
end
def url_secunia(id)
"http://secunia.com/advisories/#{id}"
end
def url_secunia(id)
"http://secunia.com/advisories/#{id}"
end
def url_exploitdb(id)
"http://www.exploit-db.com/exploits/#{id}/"
end
def url_exploitdb(id)
"http://www.exploit-db.com/exploits/#{id}/"
end
end
end
end

View File

@@ -13,9 +13,9 @@ class WpItem
puts " | Readme: #{readme_url}" if has_readme?
puts " | Changelog: #{changelog_url}" if has_changelog?
if respond_to?(:additional_output)
additional_output(verbose)
end
if respond_to?(:additional_output)
additional_output(verbose)
end
vulnerabilities.output