Created
September 8, 2012 21:10
-
-
Save kennym/3679774 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
module ApplicationHelper | |
def git_version | |
require 'grit' | |
repo = Grit::Repo.new(Rails.root + '.git') | |
# For the sake of brevity just display the first 6 chars of the commit id | |
last_commit = repo.commits.first.id[0..5] | |
#{last_commit} | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment