title: Ruby net/scp, upload file from variable
body: <p>It seems like net/scp in Ruby (I'm using 1.8.7) only accepts a path and not binary data as "local_file" parameter.</p>
  
  <p>In my case, I have the local file stored in a variable.
  Am I required to save->upload->delete a local file, or is it possible to send the file "directly" to the remote server via SSH without temporary creating it locally?</p>
  
  <p>I'm open to other solutions than SCP.
  What I tried so far is using normal SSH and then executing </p>
  
  <p><code>echo 'binary here' &gt; remote_file_name</code></p>
  
  <p>however I'm concerned about command length limits in Unix and I faced escaping problems and so forth...</p>