Sha256: 9c38c1e985f2ba1602ceeabab31bcafd697ddae2f49d630923d81a68add781de

Contents?: true

Size: 1.13 KB

Versions: 19

Compression:

Stored size: 1.13 KB

Contents

module Arql::Commands
  module Info
    class << self
      def db_info
        <<~EOF

        Database Connection Information:
            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

      def ssh_info
        <<~EOF

        SSH Connection Information:
            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::App.local_ssh_proxy_port}
        EOF
      end
    end

    Pry.commands.block_command 'info' do
      puts Info::db_info
      puts Info::ssh_info if Arql::App.config[:ssh].present?
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
arql-0.1.22 lib/arql/commands/info.rb
arql-0.1.21 lib/arql/commands/info.rb
arql-0.1.20 lib/arql/commands/info.rb
arql-0.1.19 lib/arql/commands/info.rb
arql-0.1.18 lib/arql/commands/info.rb
arql-0.1.17 lib/arql/commands/info.rb
arql-0.1.16 lib/arql/commands/info.rb
arql-0.1.15 lib/arql/commands/info.rb
arql-0.1.14 lib/arql/commands/info.rb
arql-0.1.13 lib/arql/commands/info.rb
arql-0.1.12 lib/arql/commands/info.rb
arql-0.1.11 lib/arql/commands/info.rb
arql-0.1.10 lib/arql/commands/info.rb
arql-0.1.9 lib/arql/commands/info.rb
arql-0.1.8 lib/arql/commands/info.rb
arql-0.1.7 lib/arql/commands/info.rb
arql-0.1.6 lib/arql/commands/info.rb
arql-0.1.5 lib/arql/commands/info.rb
arql-0.1.4 lib/arql/commands/info.rb