Sha256: 571d3b8b0f04c5ee567ab663226b293f9039a97c0297ad209e00f07d8de436b4

Contents?: true

Size: 749 Bytes

Versions: 8

Compression:

Stored size: 749 Bytes

Contents

module Chake

  class Backend

    class Ssh < Backend

      def scp
        ['scp', ssh_config].flatten.compact
      end

      def scp_dest
        ssh_target + ':'
      end

      def rsync
        ['rsync', rsync_ssh].flatten.compact
      end

      def rsync_dest
        [ssh_target, node.path + '/'].join(':')
      end

      def command_runner
        ['ssh', ssh_config, ssh_target].flatten.compact
      end

      private

      def rsync_ssh
        File.exist?('.ssh_config') && ['-e', 'ssh -F .ssh_config'] || []
      end

      def ssh_config
        File.exist?('.ssh_config') && ['-F' '.ssh_config'] || []
      end

      def ssh_target
        [node.username, node.hostname].compact.join('@')
      end

    end

  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
chake-0.3.3 lib/chake/backend/ssh.rb
chake-0.3.2 lib/chake/backend/ssh.rb
chake-0.3.1 lib/chake/backend/ssh.rb
chake-0.3 lib/chake/backend/ssh.rb
chake-0.2.3 lib/chake/backend/ssh.rb
chake-0.2.2 lib/chake/backend/ssh.rb
chake-0.2.1 lib/chake/backend/ssh.rb
chake-0.2 lib/chake/backend/ssh.rb