From 47f60085e9ed997e7f8b2b9d829094c94e26eb25 Mon Sep 17 00:00:00 2001 From: Jochen Topf Date: Fri, 19 Sep 2014 10:33:13 +0200 Subject: Make it easier to get at version of taginfo running on a site. --- web/lib/ui/taginfo.rb | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'web/lib') 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) -- cgit v1.2.3