Class: WinRM::FS::Core::FileUploader
- Inherits:
-
Object
- Object
- WinRM::FS::Core::FileUploader
- Defined in:
- lib/winrm-fs/core/file_uploader.rb
Overview
Uploads the given source file to a temp file in 8k chunks
Instance Method Summary collapse
-
#initialize(command_executor) ⇒ FileUploader
constructor
A new instance of FileUploader.
-
#upload(local_file, remote_file) ⇒ Integer
Uploads the given file to the specified temp file as base64 encoded.
Constructor Details
#initialize(command_executor) ⇒ FileUploader
Returns a new instance of FileUploader.
24 25 26 |
# File 'lib/winrm-fs/core/file_uploader.rb', line 24 def initialize(command_executor) @command_executor = command_executor end |
Instance Method Details
#upload(local_file, remote_file) ⇒ Integer
Uploads the given file to the specified temp file as base64 encoded.
33 34 35 36 |
# File 'lib/winrm-fs/core/file_uploader.rb', line 33 def upload(local_file, remote_file) @command_executor.run_powershell(prepare_script(remote_file)) do_upload(local_file, dos_path(remote_file)) end |