Class: Synqa::BaseSshScp

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

Overview

Base SSH/SCP implementation

Direct Known Subclasses

ExternalSshScp, InternalSshScp

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#hostObject (readonly)

Returns the value of attribute host.



199
200
201
# File 'lib/synqa.rb', line 199

def host
  @host
end

#userObject (readonly)

Returns the value of attribute user.



199
200
201
# File 'lib/synqa.rb', line 199

def user
  @user
end

#userAtHostObject (readonly)

Returns the value of attribute userAtHost.



199
200
201
# File 'lib/synqa.rb', line 199

def userAtHost
  @userAtHost
end

Instance Method Details

#closeObject



206
207
208
# File 'lib/synqa.rb', line 206

def close
  # by default do nothing - close any cached connections
end

#deleteDirectory(dirPath, dryRun) ⇒ Object

delete remote directory (if dryRun is false) using “rm -r”



211
212
213
# File 'lib/synqa.rb', line 211

def deleteDirectory(dirPath, dryRun)
  ssh("rm -r #{dirPath}", dryRun)
end

#deleteFile(filePath, dryRun) ⇒ Object

delete remote file (if dryRun is false) using “rm”



216
217
218
# File 'lib/synqa.rb', line 216

def deleteFile(filePath, dryRun)
  ssh("rm #{filePath}", dryRun)
end

#setUserAtHost(userAtHost) ⇒ Object



201
202
203
204
# File 'lib/synqa.rb', line 201

def setUserAtHost(userAtHost)
  @userAtHost = userAtHost
  @user, @host = @userAtHost.split("@")
end