How to enter a directory like the command - cd, thus operate remote files without a path prefix ?
Here is my current code.
Net::SFTP.start do |sftp|
sftp.rename!(REMOTE_PATH + "latest.zip", REMOTE_PATH + "latest.back.zip")
sftp.upload!("latest.zip", REMOTE_PATH + "latest.zip")
end
I would like to have:
sftp.cd REMOTE_PATH
sftp.rename!("latest.zip", "latest.back.zip")
sftp.upload!("latest.zip", "latest.zip")