Created
July 13, 2011 19:24
-
-
Save alunny/1081117 to your computer and use it in GitHub Desktop.
pulling times out of git
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
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