module Arql::Commands::Info

Public Class Methods

db_info() click to toggle source
# File lib/arql/commands/info.rb, line 6
      def db_info
        <<~EOF

        Database Connection Information:

            Active:    #{color_boolean(ActiveRecord::Base.connection.active?)}
            Host:      #{Arql::App.config[:host]}
            Port:      #{Arql::App.config[:port]}
            Username:  #{Arql::App.config[:username]}
            Password:  #{(Arql::App.config[:password] || '').gsub(/./, '*')}
            Database:  #{Arql::App.config[:database]}
            Adapter:   #{Arql::App.config[:adapter]}
            Encoding:  #{Arql::App.config[:encoding]}
            Pool Size: #{Arql::App.config[:pool]}
        EOF
      end
ssh_info() click to toggle source
# File lib/arql/commands/info.rb, line 23
      def ssh_info
        <<~EOF

        SSH Connection Information:

            Active:     #{color_boolean(Arql::SSHProxy.active?)}
            Host:       #{Arql::App.config[:ssh][:host]}
            Port:       #{Arql::App.config[:ssh][:port]}
            Username:   #{Arql::App.config[:ssh][:user]}
            Password:   #{(Arql::App.config[:ssh][:password] || '').gsub(/./, '*')}
            Local Port: #{Arql::SSHProxy.local_ssh_proxy_port}
        EOF
      end

Private Class Methods

color_boolean(bool) click to toggle source
# File lib/arql/commands/info.rb, line 38
def color_boolean(bool)
  if bool
    Rainbow('TRUE').green
  else
    Rainbow('FALSE').red
  end
end