Sha256: 8d31c6438e4e0ee4e7228bdf1b23d5808331399dfd35515db3848e322792ab38

Contents?: true

Size: 825 Bytes

Versions: 18

Compression:

Stored size: 825 Bytes

Contents

module Phase
  module SSH
    class Backend < ::SSHKit::Backend::Netssh
      def initialize(host, options = {})
        # BUG: Backend::Netssh doesn't assign @pool when subclassed.
        self.class.pool = ::SSHKit::Backend::ConnectionPool.new
        @host = host
      end

      def on_remote_host(remote_host, &block)
        @remote_host = remote_host
        yield
      end

      def run(&block)
        instance_exec(host, &block)
      end

      private

        def command(*args)
          options = args.extract_options!
          SSH::Command.new(*[ *args, options.merge({
            in: @pwd.nil? ? nil : File.join(@pwd),
            env: @env,
            host: @host,
            user: @user,
            group: @group,
            remote_host: @remote_host
          }) ])
        end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
phase-1.0.2 lib/phase/kit/ssh/backend.rb
phase-1.0.1 lib/phase/kit/ssh/backend.rb
phase-1.0.0 lib/phase/kit/ssh/backend.rb
phase-1.0.0.rc2 lib/phase/kit/ssh/backend.rb
phase-1.0.0.rc1 lib/phase/kit/ssh/backend.rb
phase-0.0.17 lib/phase/kit/ssh/backend.rb
phase-0.0.16.1 lib/phase/kit/ssh/backend.rb
phase-0.0.16 lib/phase/kit/ssh/backend.rb
phase-0.0.15 lib/phase/kit/ssh/backend.rb
phase-0.0.14 lib/phase/kit/ssh/backend.rb
phase-0.0.13 lib/phase/kit/ssh/backend.rb
phase-0.0.12 lib/phase/kit/ssh/backend.rb
phase-0.0.11 lib/phase/kit/ssh/backend.rb
phase-0.0.10 lib/phase/kit/ssh/backend.rb
phase-0.0.9 lib/phase/kit/ssh/backend.rb
phase-0.0.8 lib/phase/kit/ssh/backend.rb
phase-0.0.7 lib/phase/kit/ssh/backend.rb
phase-0.0.6 lib/phase/kit/ssh/backend.rb