Skip to content

Instantly share code, notes, and snippets.

@alunny
Created July 13, 2011 19:24
Show Gist options
  • Save alunny/1081117 to your computer and use it in GitHub Desktop.
Save alunny/1081117 to your computer and use it in GitHub Desktop.
pulling times out of git
require 'time'
def all_dates filename
`git log --pretty=format:%ai #{ filename }`.split("\n")
end
def created_at filename
Time.parse all_dates(filename).last
end
def updated_at filename
Time.parse all_dates(filename).first
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment