version.rb 529 B

123456789101112131415161718192021222324
  1. # encoding: utf-8
  2. module Mail
  3. module VERSION
  4. version = {}
  5. File.read(File.join(File.dirname(__FILE__), '../', 'VERSION')).each_line do |line|
  6. type, value = line.chomp.split(":")
  7. next if type =~ /^\s+$/ || value =~ /^\s+$/
  8. version[type] = value
  9. end
  10. MAJOR = version['major']
  11. MINOR = version['minor']
  12. PATCH = version['patch']
  13. BUILD = version['build']
  14. STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.')
  15. def self.version
  16. STRING
  17. end
  18. end
  19. end