condense logic for matching rank names to numeric value
This commit is contained in:
parent
c76f141a49
commit
df159e957d
|
@ -131,22 +131,7 @@ module Msf::Modules::Metadata::Search
|
||||||
matches_rank = module_metadata.rank.to_i == query_rank
|
matches_rank = module_metadata.rank.to_i == query_rank
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
case query_rank
|
matches_rank = module_metadata.rank.to_i == Msf::RankingName.key(query_rank)
|
||||||
when 'manual'
|
|
||||||
matches_rank = module_metadata.rank.to_i == Msf::ManualRanking
|
|
||||||
when 'low'
|
|
||||||
matches_rank = module_metadata.rank.to_i == Msf::LowRanking
|
|
||||||
when 'average'
|
|
||||||
matches_rank = module_metadata.rank.to_i == Msf::AverageRanking
|
|
||||||
when 'normal'
|
|
||||||
matches_rank = module_metadata.rank.to_i == Msf::NormalRanking
|
|
||||||
when 'good'
|
|
||||||
matches_rank = module_metadata.rank.to_i == Msf::GoodRanking
|
|
||||||
when 'great'
|
|
||||||
matches_rank = module_metadata.rank.to_i == Msf::GreatRanking
|
|
||||||
when 'excellent'
|
|
||||||
matches_rank = module_metadata.rank.to_i == Msf::ExcellentRanking
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
match = [keyword, search_term] if matches_rank
|
match = [keyword, search_term] if matches_rank
|
||||||
when 'ref', 'ref_name'
|
when 'ref', 'ref_name'
|
||||||
|
|
Loading…
Reference in New Issue