lib/sshake/session.rb
def write_data(path, data, options = nil, &block)
      connect unless connected?
      tmp_path = "/tmp/sshake-tmp-file-#{SecureRandom.hex(32)}"
      @session.sftp.file.open(tmp_path, 'w') do |f|
        d = data.dup.force_encoding('BINARY')
        f.write(d.slice!(0, 1024)) until d.empty?
      end
      response = execute("mv #{tmp_path} #{path}", options, &block)
      response.success?
    end
# The underlying net/ssh session
#
# @return [Net::SSH::Session]
The underlying net/ssh session
The underlying net / ssh session
def write_data(path, data, options = nil, &block)
      connect unless connected?
      tmp_path = "/tmp/sshake-tmp-file-#{SecureRandom.hex(32)}"
      @session.sftp.file.open(tmp_path, 'w') do |f|
        d = data.dup.force_encoding('BINARY')
        f.write(d.slice!(0, 1024)) until d.empty?
      end
      response = execute("mv #{tmp_path} #{path}", options, &block)
      response.success?
    end
def write_data ( path , data , options = nil , & block ) connect unless connected? tmp_path = "/tmp/sshake-tmp-file-#{SecureRandom.hex(32)}" @session . sftp . file . open ( tmp_path , 'w' ) do | f | d = data . dup . force_encoding ( 'BINARY' ) f . write ( d . slice! ( 0 , 1024 ) ) until d . empty? end response = execute ( "mv #{tmp_path} #{path}" , options , & block ) response . success? end
The underlying net/ssh session
The underlying net / ssh session
None
Net::SSH::Session
path
data
options
block