Created
January 8, 2010 19:33
-
-
Save plukevdh/272326 to your computer and use it in GitHub Desktop.
VersionInfo module for handling versioning for apps
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module VersionInfo | |
#Version number file | |
MAJOR_VERSION = 1 | |
ENHANCE_VERSION = 4 | |
FIX_VERSION = 0 | |
BETA_FLAG = true | |
RC_FLAG = false | |
def self.get_svn_revision | |
`svn info`.split("\n")[4][/\d+/].to_i | |
end | |
def is_beta? | |
BETA_FLAG | |
end | |
def is_rc? | |
RC_FLAG | |
end | |
def self.get_version_number | |
BETA_FLAG == true ? beta = " beta " : "" | |
RC_FLAG == true ? rc = " release candidate " : "" | |
version = "(r.#{get_svn_revision})" unless RAILS_ENV == "production" | |
"#{MAJOR_VERSION}.#{ENHANCE_VERSION}.#{FIX_VERSION}#{rc}#{beta}#{version}" | |
end | |
def self.version_number | |
print "#{MAJOR_VERSION}.#{ENHANCE_VERSION}.#{FIX_VERSION}" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment