ariejan (owner)

Forks

Revisions

gist: 176845 Download_button fork
public
Description:
Easily report app version and revision numbers.
Public Clone URL: git://gist.github.com/176845.git
Embed All Files: show embed
README #
1
2
3
4
You must be using git and capistrano to deploy your app. Capistrano will place a file in your Rails.root named 'REVISION'. Tested with the following capistrano setting:
 
set :scm, :git
set :deploy_via, :remote_cache
config/initializers/app_version.rb #
1
2
3
4
5
6
7
8
9
10
11
12
# config/initializers/app_version.rb
begin
  APP_VERSION = "0.8.1"
  
  File.open(File.join(Rails.root, "REVISION")) do |f|
    APP_REVISION = f.read.strip
    APP_REVISION_SHORT = APP_REVISION[0..6]
  end
rescue
  APP_REVISION = "????"
  APP_REVISION_SHORT = "??"
end