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