Skip to content

Commit

Permalink
バージョンを番号とコミットIDを結合したものに変更
Browse files Browse the repository at this point in the history
  • Loading branch information
koi-chan committed Jan 18, 2018
1 parent e9c0a1b commit 80712a6
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions lib/rgrb/version.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
# vim: fileencoding=utf-8

module RGRB
# RGRB のバージョン
VERSION = '0.12.1'
# RGRB のバージョン番号
VERSION_NUMBER = '0.12.1'

# コミットID取得
# エラーが発生した場合は、返り値にコミットIDが含まれない。
COMMIT_ID =
begin
Dir.chdir(File.dirname(File.expand_path(__FILE__))) do
`git show -s --format=%H`.strip
end
rescue
''
end

# バージョンとコミットIDを表す文字列を返す
VERSION = COMMIT_ID.empty? ? VERSION_NUMBER : "#{VERSION_NUMBER} (#{COMMIT_ID})"
end

0 comments on commit 80712a6

Please sign in to comment.