From 58ef469a76fcce4b915f6f8fce7e425c5f795d09 Mon Sep 17 00:00:00 2001 From: evazion Date: Mon, 24 Oct 2016 19:02:06 -0500 Subject: [PATCH 1/2] Link current commit if running inside a git repo. Useful when running `rails server` straight from a dev repo. --- config/application.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/application.rb b/config/application.rb index 87d99be74..9b37c4b8d 100644 --- a/config/application.rb +++ b/config/application.rb @@ -24,6 +24,8 @@ module Danbooru if File.exists?("#{config.root}/REVISION") config.x.git_hash = File.read("#{config.root}/REVISION").strip + elsif system("type git && git rev-parse --show-toplevel") + config.x.git_hash = %x(git rev-parse --short HEAD).strip else config.x.git_hash = nil end From fd4eb8fa08eaac9cc60d0c6adb249d5b5fb4980a Mon Sep 17 00:00:00 2001 From: evazion Date: Mon, 24 Oct 2016 18:06:39 -0500 Subject: [PATCH 2/2] Replace references to Danbooru with Danbooru.config.app_name. * Also replace references to github with a configurable repo. * Plus link commit ref in footer to the commit in the repo. --- app/views/static/_footer.html.erb | 4 ++-- app/views/static/bookmarklet.html.erb | 4 ++-- app/views/static/site_map.html.erb | 4 ++-- config/danbooru_default_config.rb | 16 ++++++++++++++++ 4 files changed, 22 insertions(+), 6 deletions(-) diff --git a/app/views/static/_footer.html.erb b/app/views/static/_footer.html.erb index 0a0c13129..4174f0368 100644 --- a/app/views/static/_footer.html.erb +++ b/app/views/static/_footer.html.erb @@ -1,7 +1,7 @@