Skip to content

Instantly share code, notes, and snippets.

@plukevdh
Created January 8, 2010 19:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save plukevdh/272326 to your computer and use it in GitHub Desktop.
Save plukevdh/272326 to your computer and use it in GitHub Desktop.
VersionInfo module for handling versioning for apps
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