# File lib/packaging/util/version.rb, line 69 def git_describe_version return nil unless is_git_repo and raw = run_git_describe_internal # reprocess that into a nice set of output data # The elements we select potentially change if this is an rc # For an rc with added commits our string will be something like '0.7.0-rc1-63-g51ccc51' # and our return will be [0.7.0, rc1, 63, <dirty>] # For a final with added commits, it will look like '0.7.0-63-g51ccc51' # and our return will be [0.7.0, 64, <dirty>] info = raw.chomp.sub(/^v/, '').split('-') if info[1].to_s.match('^[\d]+') version_string = info.values_at(0,1,3).compact else version_string = info.values_at(0,1,2,4).compact end version_string end