This isn’t a middleman question per say so please and I know this is a bit of strange question, of course you would use File.mtime() for find the last modified time.
However, I’m doing my build and deploy remotely, on Heroku, so mtime will not necessarily be the last time the file is modified but Heroku build time.
So right now my working solution is something like this… but this fails to work on Heroku… so it is a solution… but not one me.
source_obj = `git rev-list -n 1 HEAD #{article.source_file}`.chomp
correct_mod = DateTime.parse(`git show --pretty=format:%ai --abbrev-commit #{source_obj} | head -n 1`.chomp).iso8601
Can anyone think of a better (cleaner, more efficient) way of doing this?