summaryrefslogtreecommitdiff
path: root/lib/oxidized/version.rb
diff options
context:
space:
mode:
authorWild Kat <wk@futureinquestion.net>2018-04-27 12:37:26 +0200
committerWild Kat <wk@futureinquestion.net>2018-04-27 12:37:26 +0200
commit8f1ac4ad5503ac4a59d41ebc3f142c1d5d097bfb (patch)
tree8860b268793dd783b9b5cd5d1a255fe1edebfb0e /lib/oxidized/version.rb
parentcd92bac4a582eb8e19d9d036455591c9684eae72 (diff)
parent34fd5369feee94ab45c5a81d7769b1df717e4c8c (diff)
Merge remote-tracking branch 'upstream/master' into pr-1280
Diffstat (limited to 'lib/oxidized/version.rb')
-rw-r--r--lib/oxidized/version.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/oxidized/version.rb b/lib/oxidized/version.rb
index 9a92133..b607e12 100644
--- a/lib/oxidized/version.rb
+++ b/lib/oxidized/version.rb
@@ -1,3 +1,19 @@
module Oxidized
VERSION = '0.21.0'
+ VERSION_FULL = '0.21.0-180-g9691008'
+ def self.version_set
+ version_full = %x(git describe --tags).chop rescue ""
+ version = %x(git describe --tags --abbrev=0).chop rescue ""
+
+ return false unless [version, version_full].none?(&:empty?)
+
+ Oxidized.send(:remove_const, :VERSION)
+ Oxidized.send(:remove_const, :VERSION_FULL)
+ const_set(:VERSION, version)
+ const_set(:VERSION_FULL, version_full)
+ 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