aboutsummaryrefslogtreecommitdiff
path: root/web/lib
diff options
context:
space:
mode:
Diffstat (limited to 'web/lib')
-rw-r--r--web/lib/ui/taginfo.rb13
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)