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.3.31 lib/arql/commands/reconnect.rb
arql-0.3.30 lib/arql/commands/reconnect.rb
arql-0.3.29 lib/arql/commands/reconnect.rb
arql-0.3.28 lib/arql/commands/reconnect.rb
arql-0.3.27 lib/arql/commands/reconnect.rb
arql-0.3.26 lib/arql/commands/reconnect.rb
arql-0.3.25 lib/arql/commands/reconnect.rb
arql-0.3.24 lib/arql/commands/reconnect.rb
arql-0.3.23 lib/arql/commands/reconnect.rb
arql-0.3.22 lib/arql/commands/reconnect.rb
arql-0.3.21 lib/arql/commands/reconnect.rb
arql-0.3.20 lib/arql/commands/reconnect.rb
arql-0.3.19 lib/arql/commands/reconnect.rb
arql-0.3.18 lib/arql/commands/reconnect.rb
arql-0.3.17 lib/arql/commands/reconnect.rb
arql-0.3.16 lib/arql/commands/reconnect.rb
arql-0.3.15 lib/arql/commands/reconnect.rb
arql-0.3.14 lib/arql/commands/reconnect.rb
arql-0.3.13 lib/arql/commands/reconnect.rb
arql-0.3.12 lib/arql/commands/reconnect.rb