some more work for #179

This commit is contained in:
Christian Mehlmauer
2013-05-06 23:36:18 +02:00
parent 4ce6396e3f
commit 3e9c51f18e
3 changed files with 11 additions and 4 deletions

View File

@@ -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

View File

@@ -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