public
Description: Rails plugin for managing your site's version number.
Homepage: http://fiatdev.com/2007/03/31/new-rails-plugin-app-version
Clone URL: git://github.com/toland/app_version.git
name age message
file .gitignore Sun Aug 10 16:22:58 -0700 2008 Ignore TextMate project files. [Phillip Toland]
file README Thu Aug 14 15:06:07 -0700 2008 Updated README with info on the Git build numbers. [Phillip Toland]
file Rakefile Mon Mar 26 20:13:31 -0700 2007 Initial import. [ptoland]
file init.rb Mon Mar 26 20:13:31 -0700 2007 Initial import. [ptoland]
directory lib/ Sun Aug 10 16:32:50 -0700 2008 Add methods to get build number from git. [Phillip Toland]
directory tasks/ Mon Mar 26 20:13:31 -0700 2007 Initial import. [ptoland]
directory test/ Sat Mar 31 14:02:43 -0700 2007 Added ability to have both patchlevel and miles... [ptoland]
README
= App Version

This is a simple plugin that makes it easy to manage the version number of your
Rails application. The version numbers supported by this plugin look like 
'2.0.1 M4 (600)'. The components of the version number are:

  2 => major
  0 => minor
  1 => patch
  M4 => milestone
  (600) => build number (usually Subversion revision)

Only the major and minor numbers are required. The rest can be omitted and the
plugin will attempt to do the right thing. 

== Usage

To use, simply place a file in RAILS_ROOT/config called version.yml with the 
following format:

  major:     2
  minor:     0
  patch:     1
  milestone: 4
  build:     git-revcount

If the milestone or patch fields are less than 0 then they will not show up
in the version string. The build field can be a build number or one of the
following strings: svn, git-hash or git-revcount. If it is a number then that
number will be used as the build number, if it is one of the special strings
then the plugin will attempt to query the source control system for the build
number.

Using 'svn' for the build number will cause the plugin to query Subversion for
the current revision number. Since Git doesn't have a numbered revision we have
to fake it. 'git-revcount' will count the number of commits to the repository
and use that as the build number whereas 'git-hash' will use the first 6 digits
of the current HEAD's hash.

The plugin creates a constant APP_VERSION that contains the version number of
the application. Calling the +to_s+ method on APP_VERSION will result in a
properly formatted version number. APP_VERSION also has +major+, +minor+,
+patch+, +milestone+ and +build+ methods to retrieve the individual components
of the version number.

Finally, there is a rake task for displaying the version number from the command
line. 'rake app:version' will output the version number of the current rails
application.

This plugin is released under the terms of the Ruby license. See 
http://www.ruby-lang.org/en/LICENSE.txt.