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
Phillip Toland (author)
Thu Aug 14 15:06:07 -0700 2008
commit  c0f9da8f1281d005be7201a15c0f835addb360ed
tree    fc34c76ec626150345ba6a1766dc70a6525ae7b0
parent  48055e21bb77ed5ea66d716f284a0f815912e431
name age message
file .gitignore Fri Oct 31 22:08:23 -0700 2008 Fixed gitignore, and promoted recipes up a leve... [jschank]
file README Tue Oct 28 23:45:18 -0700 2008 added comments to erb, and enhanced the readme [jschank]
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/ Fri Oct 31 23:55:18 -0700 2008 Fixing some path problems [jschank]
directory tasks/ Tue Oct 28 23:45:18 -0700 2008 added comments to erb, and enhanced the readme [jschank]
directory test/ Mon Oct 27 21:24:44 -0700 2008 got regex working [jschank]
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.