Created
March 19, 2009 19:30
-
-
Save paulgroves/82008 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## 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