Sha256: ad010f5b16294e3773fe1e141ba1a8a8924474cbdba784df5b4649e7e28d1e56

Contents?: true

Size: 583 Bytes

Versions: 56

Compression:

Stored size: 583 Bytes

Contents

module Arql::Commands
  module Reconnect
    class << self
      def reconnect
        Arql::SSHProxy.reconnect if Arql::App.config[:ssh].present?
        ActiveRecord::Base.connection.reconnect! unless ActiveRecord::Base.connection.active?
      end

      def reconnect!
        Arql::SSHProxy.reconnect! if Arql::App.config[:ssh].present?
        ActiveRecord::Base.connection.reconnect!
      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

56 entries across 56 versions & 1 rubygems

Version Path
arql-0.2.5 lib/arql/commands/reconnect.rb
arql-0.2.4 lib/arql/commands/reconnect.rb
arql-0.2.3 lib/arql/commands/reconnect.rb
arql-0.2.2 lib/arql/commands/reconnect.rb
arql-0.2.1 lib/arql/commands/reconnect.rb
arql-0.2.0 lib/arql/commands/reconnect.rb
arql-0.1.33 lib/arql/commands/reconnect.rb
arql-0.1.32 lib/arql/commands/reconnect.rb
arql-0.1.31 lib/arql/commands/reconnect.rb
arql-0.1.30 lib/arql/commands/reconnect.rb
arql-0.1.29 lib/arql/commands/reconnect.rb
arql-0.1.28 lib/arql/commands/reconnect.rb
arql-0.1.27 lib/arql/commands/reconnect.rb
arql-0.1.26 lib/arql/commands/reconnect.rb
arql-0.1.25 lib/arql/commands/reconnect.rb
arql-0.1.24 lib/arql/commands/reconnect.rb