Skip to content

Instantly share code, notes, and snippets.

@paulgroves
Created March 19, 2009 19:30
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 paulgroves/82008 to your computer and use it in GitHub Desktop.
Save paulgroves/82008 to your computer and use it in GitHub Desktop.
## about (plain_text)
For more features you might like to try ck_fu plugin - http://r38y.github.com/ck_fu/
## config/deploy.rb
task :build_info do
unix_user = `whoami`.strip
run "echo 'Version #{current_revision} deployed by #{unix_user} at #{Time.now}' > #{current_path}/lib/BUILD_INFO"
end
after "deploy", "build_info"
## helpers/your_helper.rb - kudos to http://r38y.github.com/ck_fu/
def build_info
file = RAILS_ROOT + "/lib/BUILD_INFO"
File.exists?(file) ? File.open(file).read.strip : nil
end
## views/your_view.html.erb
<%= build_info %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment