class Grifork::Config::SSH

Attributes

options[R]

Public Class Methods

new(opts = {}) click to toggle source
# File lib/grifork/config.rb, line 55
def initialize(opts = {})
  @options = opts
end

Public Instance Methods

command_for_rsync() click to toggle source

Build ssh command with options @return [String] ssh command with options

# File lib/grifork/config.rb, line 61
def command_for_rsync
  args = []
  args << "-l #{@options[:user]}" if @options[:user]
  args << "-p #{@options[:port]}" if @options[:port]
  if @options[:keys]
    @options[:keys].each { |key| args << "-i #{key}" }
  end
  "ssh #{args.join(' ')}"
end