Welcome to mirror list, hosted at ThFree Co, Russian Federation.

console_message.rb « initializers « config - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 3f98568c5002e39a9ed738486c6ecf0b3f55b5e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# frozen_string_literal: true

# rubocop:disable Rails/Output
if Gitlab::Runtime.console?
  # note that this will not print out when using `spring`
  justify = 15

  puts '-' * 80
  puts " Ruby:".ljust(justify) + RUBY_DESCRIPTION
  puts " GitLab:".ljust(justify) + "#{Gitlab::VERSION} (#{Gitlab.revision}) #{Gitlab.ee? ? 'EE' : 'FOSS'}"
  puts " GitLab Shell:".ljust(justify) + "#{Gitlab::VersionInfo.parse(Gitlab::Shell.version)}"

  if ApplicationRecord.database.exists?
    puts " #{ApplicationRecord.database.human_adapter_name}:".ljust(justify) + ApplicationRecord.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
    end
  end

  puts '-' * 80

  # 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)
end