Sha256: f65c5ae9508f24659dd0cd915bd6ddfb575c866355c6ee7d72de546d70a059eb
Contents?: true
Size: 581 Bytes
Versions: 9
Compression:
Stored size: 581 Bytes
Contents
require 'mega/version' class Module # If a module or class has a FILE constant set to __FILE__ and # a (optional) SERIES, this method will return a Version. # If a load error occurs this will not throw an error, # but will simply set the version to UNDEFINED. # # Class.version #=> "UNDEFINED" # def version t = "UNDEFINED" if self::FILE begin t = File.open(self::FILE) { |f| f.ctime.strftime("%y.%m.%d") } rescue LoadError t = "UNDEFINED" end end s = self::SERIES || 0 Version.new( "#{s}.#{t}" ) end end
Version data entries
9 entries across 9 versions & 1 rubygems