class ODisk::Remote

Just a way to keep the data associated with a remote site together one Object.

Attributes

dir[RW]
host[RW]
pass_file[RW]
user[RW]

Public Class Methods

new() click to toggle source
# File lib/odisk/remote.rb, line 11
def initialize()
  @user = nil
  @host = nil
  @dir = nil
  @pass_file = nil
end

Public Instance Methods

complete?() click to toggle source
# File lib/odisk/remote.rb, line 28
def complete?()
  !(@user.nil? || @host.nil? || @dir.nil? || @pass_file.nil?)
end
encrypt?() click to toggle source
# File lib/odisk/remote.rb, line 36
def encrypt?()
  !@pass_file.nil?
end
okay?() click to toggle source
# File lib/odisk/remote.rb, line 32
def okay?()
  !(@user.nil? || @host.nil? || @dir.nil?)
end
to_s() click to toggle source
# File lib/odisk/remote.rb, line 40
def to_s()
  "#{user}@#{host}:#{@dir}:#{@pass_file}"
end
update(str) click to toggle source

Expects a string as input of the form user@remote.com:dir:passphrase_file

# File lib/odisk/remote.rb, line 19
def update(str)
  u, x = str.strip().split('@')
  h, t, p = x.split(':')
  @user = u if @user.nil? && u.is_a?(String) && !u.empty?
  @host = h if @host.nil? && h.is_a?(String) && !h.empty?
  @dir = t if @dir.nil? && t.is_a?(String) && !t.empty?
  @pass_file = p if @pass_file.nil? && p.is_a?(String) && !p.empty?
end