Thanks to mpd who pointed me on the right direction.
For those interested in doing something similar, this is a quick and dirty method that probably can be refined and refactored.
In app/controllers/application_controller.rb
put this method in the private section:
private
def app_last_updated_at
if File.exist?(RAILS_ROOT + "/REVISION")
timezone = "Mountain Time (US & Canada)"
@app_last_updated_at = File.atime(RAILS_ROOT + "/REVISION").in_time_zone( timezone )
else
@app_last_updated_at = "Not Long Ago."
end
end
Obviously, replace the timezone with your own (or you can do something fancy for individual user timezones).
In order to have this run all the time I use a :before_filter' (# TODO: refactor so it's not run everytime, only when a new deploy happens). So put this at the top of your
application_controller.rb`
before_filter :app_last_updated_at
And then to actually show this last updated at date, you just throw this or something like it in a layout or a partial or whatever:
<%=
unless @app_last_updated_at.nil?
if @app_last_updated_at.is_a? Time
@app_last_updated_at.to_s(:long)
else
@app_last_updated_at
end
end
%>
Hopefully that helps others. Like I said, I'm not keen on having it run in the applications_controller for every access, so suggestions would be appreciated.