Merge branch 'bw-add-console-message' into 'master'

Output some useful information when running the rails console

See merge request gitlab-org/gitlab-ce!18697
This commit is contained in:
Robert Speicher 2018-05-03 14:58:50 +00:00
commit 7ff891e5ec
2 changed files with 15 additions and 0 deletions

View File

@ -0,0 +1,5 @@
---
title: Output some useful information when running the rails console
merge_request: 18697
author:
type: added

View File

@ -0,0 +1,10 @@
# rubocop:disable Rails/Output
if defined?(Rails::Console)
# note that this will not print out when using `spring`
justify = 15
puts "-------------------------------------------------------------------------------------"
puts " Gitlab:".ljust(justify) + "#{Gitlab::VERSION} (#{Gitlab::REVISION})"
puts " Gitlab Shell:".ljust(justify) + Gitlab::Shell.new.version
puts " #{Gitlab::Database.adapter_name}:".ljust(justify) + Gitlab::Database.version
puts "-------------------------------------------------------------------------------------"
end