debian-mirror-gitlab/config/initializers/console_message.rb

37 lines
1,022 B
Ruby
Raw Normal View History

2021-03-11 19:13:27 +05:30
# frozen_string_literal: true
2018-10-15 14:42:47 +05:30
# rubocop:disable Rails/Output
2020-03-13 15:44:24 +05:30
if Gitlab::Runtime.console?
2018-10-15 14:42:47 +05:30
# note that this will not print out when using `spring`
justify = 15
2019-09-30 21:07:59 +05:30
puts '-' * 80
2021-01-29 00:20:46 +05:30
puts " Ruby:".ljust(justify) + RUBY_DESCRIPTION
2020-03-13 15:44:24 +05:30
puts " GitLab:".ljust(justify) + "#{Gitlab::VERSION} (#{Gitlab.revision}) #{Gitlab.ee? ? 'EE' : 'FOSS'}"
2020-04-08 14:13:33 +05:30
puts " GitLab Shell:".ljust(justify) + "#{Gitlab::VersionInfo.parse(Gitlab::Shell.version)}"
2019-09-30 21:07:59 +05:30
2020-03-13 15:44:24 +05:30
if Gitlab::Database.exists?
puts " #{Gitlab::Database.human_adapter_name}:".ljust(justify) + Gitlab::Database.version
Gitlab.ee do
if Gitlab::Geo.connected? && Gitlab::Geo.enabled?
puts " Geo enabled:".ljust(justify) + 'yes'
puts " Geo server:".ljust(justify) + EE::GeoHelper.current_node_human_status
end
2019-09-30 21:07:59 +05:30
end
end
puts '-' * 80
2021-01-29 00:20:46 +05:30
# Stop irb from writing a history file by default.
module IrbNoHistory
def init_config(*)
super
IRB.conf[:SAVE_HISTORY] = false
end
end
IRB.singleton_class.prepend(IrbNoHistory)
2018-10-15 14:42:47 +05:30
end