27
31
# The current version of the program.
29
if CTIOGA_VERSION =~ /SVN/
30
return "SVN, revision #{SVN_INFO['revision']}#{SVN_INFO['suffix']}, #{SVN_INFO['date']}"
37
# All files should use this function with the appropriate
38
# arguments and have the Date and Revision svn:keyword:. Use this
41
# Version::register_svn_info('$Revision: 532 $', '$Date: 2013-09-29 12:13:33 +0200 (Sun, 29 Sep 2013) $')
43
# To set the correct properties, the following command-line can be
46
# svn propset svn:keywords 'Date Revision'
47
def self.register_svn_info(rev_str, date_str)
51
date = date_str.gsub(/\$#{str}:\s*(.*)\$/) { $1 }
52
if SVN_INFO['revision'] < rev.to_i
53
SVN_INFO['revision'] = rev.to_i
54
SVN_INFO['date'] = date
56
# Hmmm, we want to see how many revisions is git ahead of SVN
57
if rev_str =~ /(\+git\d+)/
58
SVN_INFO['suffix'] = $1
63
37
# Returns the date ctioga2 was last modified.
64
38
def self.last_modified_date
65
SVN_INFO['date'] =~ /([\d-]+)/
70
# The constants are moved here, as they disturb rdoc parsing.
73
# Informations collected about subversion revisions
80
# The position of the URL, used for getting the version
81
SVN_URL = '$HeadURL: svn+ssh://rubyforge.org/var/svn/ctioga2/releases/ctioga2-0.7/lib/ctioga2/utils.rb $'
83
# The version of ctioga2
84
CTIOGA_VERSION = if SVN_URL =~ /releases\/ctioga2-([^\/]+)/
90
register_svn_info('$Revision: 532 $', '$Date: 2013-09-29 12:13:33 +0200 (Sun, 29 Sep 2013) $')
94
43
# Various utilities
481
# This is a dirty hack in order to ensure that the SVN revision
482
# information is kept up-to-date even when using git-svn. This
483
# file is not present in standard installations.
484
require 'ctioga2/git-fools-svn'
485
rescue LoadError => e