Output some useful information when running the rails console

This commit is contained in:
Brett Walker 2018-05-03 14:58:43 +00:00 committed by Robert Speicher
parent 17f598e9c3
commit ec5489838a
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