diff options
author | Jochen Topf <jochen@topf.org> | 2014-09-19 10:33:13 +0200 |
---|---|---|
committer | Jochen Topf <jochen@topf.org> | 2014-09-19 10:33:13 +0200 |
commit | 47f60085e9ed997e7f8b2b9d829094c94e26eb25 (patch) | |
tree | bb7710a5da7f7b24511907d12b123602a7f1dbb2 /web/lib | |
parent | 5077b329d6e1c90ca7735c17f8ab49d43808f20e (diff) | |
download | taginfo-47f60085e9ed997e7f8b2b9d829094c94e26eb25.tar taginfo-47f60085e9ed997e7f8b2b9d829094c94e26eb25.tar.gz |
Make it easier to get at version of taginfo running on a site.
Diffstat (limited to 'web/lib')
-rw-r--r-- | web/lib/ui/taginfo.rb | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/web/lib/ui/taginfo.rb b/web/lib/ui/taginfo.rb index f0fb8f7..0f09122 100644 --- a/web/lib/ui/taginfo.rb +++ b/web/lib/ui/taginfo.rb @@ -34,15 +34,26 @@ class Taginfo < Sinatra::Base out end - get '/taginfo' do + def get_commit begin @commit = `git rev-parse HEAD`.chop + @commit_date = Time.parse(`git show -s --format=%ci HEAD`.chop).utc.iso8601 rescue @commit = 'unknown' + @commit_date = 'unknown' end + end + + get '/taginfo' do + get_commit erb :'taginfo/index' end + get '/taginfo/version' do + get_commit + "#{@commit} #{@commit_date}" + end + get '/taginfo/status' do content_type 'text/plain' age_in_days = DateTime.now() - DateTime.parse(@data_until) |