diff options
author | Ron <rgnv@users.noreply.github.com> | 2018-04-27 06:24:56 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-27 06:24:56 -0700 |
commit | 2bb40ad4d9e31cf2cd63a373f7c607eb86547e46 (patch) | |
tree | c12b52f0acd5192c457fa07189c4946674cd11fb /lib/oxidized/version.rb | |
parent | ec90b081f0fed05497ce6ae21e4b4ba4d44ecc01 (diff) | |
parent | 83a00943d7333fafdfe352173713a22a5ac89f6f (diff) |
Merge pull request #1 from wk/pr-1280
massage into rubocop compliance
Diffstat (limited to 'lib/oxidized/version.rb')
-rw-r--r-- | lib/oxidized/version.rb | 16 |
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 |