summaryrefslogtreecommitdiff
path: root/lib/oxidized/version.rb
blob: 0d90e34a687096bc0922cc27efd8561788917d9c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
module Oxidized
  VERSION = '0.21.0'
  VERSION_FULL = '0.21.0-175-gcc22060'
  def self.version_set
    Oxidized.send(:remove_const, :VERSION_FULL)
    const_set(:VERSION_FULL, %x(git describe --tags).chop)
    Oxidized.send(:remove_const, :VERSION)
    const_set(:VERSION, %x(git describe --tags --abbrev=0).chop)
    file = File.readlines(__FILE__)
    file[1] = "  VERSION = '%s'\n" % VERSION
    file[2] = "  VERSION_FULL = '%s'\n" % VERSION_FULL
    File.write(__FILE__, file.join)
  end
end