Skip to content

Instantly share code, notes, and snippets.

@mrcljx
Created March 3, 2011 01:06
Show Gist options
  • Save mrcljx/852115 to your computer and use it in GitHub Desktop.
Save mrcljx/852115 to your computer and use it in GitHub Desktop.
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