Move #match_values to Msf::DBManager::ModuleCache

MSP-11124

`#match_values` is only used in `#search_modules`, so `#match_values`
should be grouped with `#search_modules` in
`Msf::DBManager::ModuleCache`.
bug/bundler_fix
Luke Imhoff 2014-10-09 09:18:03 -05:00
parent 37c38ad27b
commit 3a96ae9be9
No known key found for this signature in database
GPG Key ID: 5B1FB01FB33356F8
2 changed files with 13 additions and 12 deletions

View File

@ -367,18 +367,6 @@ class DBManager
end
end
# Wraps values in +'%'+ for Arel::Prediciation#matches_any and other match* methods that map to SQL +'LIKE'+ or
# +'ILIKE'+
#
# @param values [Set<String>, #each] a list of strings.
# @return [Arrray<String>] strings wrapped like %<string>%
def match_values(values)
wrapped_values = values.collect { |value|
"%#{value}%"
}
wrapped_values
end
def rfc3330_reserved(ip)
case ip.class.to_s

View File

@ -13,6 +13,19 @@ module Msf::DBManager::ModuleCache
# Instance Methods
#
# Wraps values in +'%'+ for Arel::Prediciation#matches_any and other match* methods that map to SQL +'LIKE'+ or
# +'ILIKE'+
#
# @param values [Set<String>, #each] a list of strings.
# @return [Arrray<String>] strings wrapped like %<string>%
def match_values(values)
wrapped_values = values.collect { |value|
"%#{value}%"
}
wrapped_values
end
def module_to_details_hash(m)
res = {}
bits = []