Created
March 3, 2011 01:06
-
-
Save mrcljx/852115 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
def git_info | |
@@info ||= begin | |
{ | |
:application => app_name = (Rails.application.class.to_s.split('::').first rescue ""), | |
:environment => Rails.env, | |
:remote_url => `git remote -v`, | |
:remote_branch => `git branch -r`, | |
:last_commit => `git log --max-count=1` | |
} | |
rescue | |
{} | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment