Class: Host::Forwarded

Inherits:
Host
  • Object
show all
Defined in:
lib/hostmanager.rb

Instance Attribute Summary

Attributes inherited from Host

#host, #port, #user_name

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Host

#control_path_string, #setup

Constructor Details

#initialize(user_name, port) ⇒ Forwarded

Returns a new instance of Forwarded.



78
79
80
81
82
# File 'lib/hostmanager.rb', line 78

def initialize(user_name, port)
	@port = port
	@user_name = user_name.gsub(/ /, '\ ')
	@host = "localhost"
end

Class Method Details

.from_string(string, port) ⇒ Object



74
75
76
77
# File 'lib/hostmanager.rb', line 74

def self.from_string(string, port)
	user_name, host = string.split('@')
	new(user_name, port)
end

Instance Method Details

#remote?Boolean

Returns:

  • (Boolean)


95
96
97
# File 'lib/hostmanager.rb', line 95

def remote?
	true
end

#rsync_scp_localObject



86
87
88
# File 'lib/hostmanager.rb', line 86

def rsync_scp_local
	""
end

#rsync_scp_remoteObject



83
84
85
# File 'lib/hostmanager.rb', line 83

def rsync_scp_remote
	"--rsh='ssh -p  #{@port}' #{@user_name}@localhost:"
end

#sshObject



89
90
91
# File 'lib/hostmanager.rb', line 89

def ssh
	"ssh -p #{@port} #@@ssh_option_string  #{@user_name}@localhost"
end

#sshfsObject



92
93
94
# File 'lib/hostmanager.rb', line 92

def sshfs
	"sshfs -p #{@port} #@@ssh_option_string  #{@user_name}@localhost:"
end