def write_file(path)
      exec "mkdir -p #{File.dirname(path).gsub(/ /, "\\ ")}"
      Tempfile.open(File.basename(path)) do |f|
        yield f
        f.flush
        remote_path = %Q{"#{@user}@#{host}:#{path.gsub(/ /, "\\ ")}"}
        puts "Writing to #{remote_path}"
        `scp '#{f.path}' #{remote_path}`
      end
    end
def write_file(path)
      exec "mkdir -p #{File.dirname(path).gsub(/ /, "\\ ")}"
      Tempfile.open(File.basename(path)) do |f|
        yield f
        f.flush
        remote_path = %Q{"#{@user}@#{host}:#{path.gsub(/ /, "\\ ")}"}
        puts "Writing to #{remote_path}"
        `scp '#{f.path}' #{remote_path}`
      end
    end
Write to a remote file at _path_.