SFTP Error with Deprec on Windows

Anyone who’s using Deprec from Windows is likely to run into a problem where they get a strange SFTP StatusException error. The stack looks something like this:

1:/ruby/lib/ruby/gems/1.8/gems/net-sftp-1.1.0/lib/net/sftp/operations/abstract.rb:78:in`do_status':Net::SFTP::Operations::StatusException (4, "Failure") Net::SFTP::Operations::StatusException (4, "Failure"))
2        from c:/ruby/lib/ruby/gems/1.8/gems/net-sftp-1.1.0/lib/net/sftp/session.rb:221:in `do_status'
3

The Bug

The bug is in a method called su_put that puts configuration files on the server using sudo. The temporary file name for this process is incorrectly generated if a /tmp directory does not exist on the client. This code should check for the /tmp directory on the server, not the client.

The Workaround

To workaround this, just create a directory called tmp in the root of the drive your project is on.