some more work for #179
This commit is contained in:
@@ -5,6 +5,7 @@ class WpItem
|
||||
attr_accessor :vulns_file, :vulns_xpath
|
||||
|
||||
# Get the vulnerabilities associated to the WpItem
|
||||
# Filters out already fixed vulnerabilities
|
||||
#
|
||||
# @return [ Vulnerabilities ]
|
||||
def vulnerabilities
|
||||
|
||||
@@ -1,7 +1,15 @@
|
||||
# encoding: UTF-8
|
||||
|
||||
class VersionCompare
|
||||
|
||||
# Compares two version strings. Returns true if version1 is equal to version2
|
||||
# or when version1 is older than version2
|
||||
#
|
||||
# @param [ String ] version1
|
||||
# @param [ String ] version2
|
||||
#
|
||||
# @return [ Boolean ]
|
||||
def self.is_newer_or_same?(version1, version2)
|
||||
(version1 == version2) || (Gem::Version.new(version1) < Gem::Version.new(version2))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user