Class: SSHCmd

Inherits:
Object
  • Object
show all
Defined in:
lib/git/make_mirror.rb

Instance Method Summary collapse

Constructor Details

#initialize(server) ⇒ SSHCmd

Returns a new instance of SSHCmd.



105
106
107
# File 'lib/git/make_mirror.rb', line 105

def initialize(server)
	@server = server
end

Instance Method Details

#exec(cmd) ⇒ Object



109
110
111
112
# File 'lib/git/make_mirror.rb', line 109

def exec(cmd)
	cmd = cmd.join ' && ' if cmd.is_a? Array
	`ssh #{@server} '#{cmd}'`
end

#scp(from, to) ⇒ Object



114
115
116
# File 'lib/git/make_mirror.rb', line 114

def scp(from, to)
	`scp #{from} #{@server}:#{to}`
end