Sha256: 20965187564b80997b938deba20d22e2e630d102930d8dade8e5f90908650bf4

Contents?: true

Size: 732 Bytes

Versions: 9

Compression:

Stored size: 732 Bytes

Contents

module Arql::Commands
  module Reconnect
    class << self
      def reconnect
        Arql::App.instance.definitions.each do |_, definition|
          definition.ssh_proxy.reconnect if definition.options[:ssh].present?
          definition.connection.reconnect! unless definition.connection.active?
        end
      end

      def reconnect!
        Arql::App.instance.definitions.each do |_, definition|
          definition.ssh_proxy.reconnect if definition.options[:ssh].present?
          definition.connection.reconnect!
        end
      end
    end

    Pry.commands.block_command 'reconnect' do
      Reconnect.reconnect
    end

    Pry.commands.block_command 'reconnect!' do
      Reconnect.reconnect!
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
arql-0.4.11 lib/arql/commands/reconnect.rb
arql-0.4.10 lib/arql/commands/reconnect.rb
arql-0.4.8 lib/arql/commands/reconnect.rb
arql-0.4.7 lib/arql/commands/reconnect.rb
arql-0.4.6 lib/arql/commands/reconnect.rb
arql-0.4.3 lib/arql/commands/reconnect.rb
arql-0.4.2 lib/arql/commands/reconnect.rb
arql-0.4.1 lib/arql/commands/reconnect.rb
arql-0.4.0 lib/arql/commands/reconnect.rb