puremvc-gen/lib/pure_m_v_c_gen/version.rb

22 lines
668 B
Ruby
Raw Normal View History

2008-12-02 20:50:24 +00:00
module PureMVCGen
module Version #:nodoc:
# A method for comparing versions of required modules. It expects two
# arrays of integers as parameters, the first being the minimum version
# required, and the second being the actual version available. It returns
# true if the actual version is at least equal to the required version.
def self.check(required, actual) #:nodoc:
required = required.map { |v| "%06d" % v }.join(".")
actual = actual.map { |v| "%06d" % v }.join(".")
return actual >= required
end
MAJOR = 0
MINOR = 1
TINY = 2
2008-12-02 20:50:24 +00:00
ARRAY = [MAJOR, MINOR, TINY]
STRING = ARRAY.join(".")
2008-12-02 20:50:24 +00:00
end
end