class Grifork::Config

Public Class Methods

new(args) click to toggle source
# File lib/grifork/config.rb, line 9
def initialize(args)
  args.each do |key, val|
    instance_variable_set("@#{key}", val)
  end
end

Public Instance Methods

dry_run?() click to toggle source
# File lib/grifork/config.rb, line 23
def dry_run?
  @dry_run ? true : false
end
mode() click to toggle source
# File lib/grifork/config.rb, line 15
def mode
  @mode || :standalone
end
parallel() click to toggle source
# File lib/grifork/config.rb, line 19
def parallel
  @parallel || :in_threads
end
rsync_opts() click to toggle source

Build rsync command-line options from +@rsync+ and +@ssh+ objects @return [Array<String>] rsync command options @see Rsync @see SSH

# File lib/grifork/config.rb, line 35
def rsync_opts
  @rsync ||= Rsync.new
  opts = @rsync.options
  if opts.grep(/^(-e|--rsh)$/).size.zero?
    opts.concat(['--rsh', ssh.command_for_rsync])
  end
  opts
end
ssh() click to toggle source
# File lib/grifork/config.rb, line 27
def ssh
  @ssh || SSH.new
end