Class: Ftp
- Inherits:
-
Object
- Object
- Ftp
- Defined in:
- lib/wormholio/ftp.rb
Class Method Summary collapse
- .download(creds, local_path, filename, options = {}) ⇒ Object
- .upload(creds, file, options = {}) ⇒ Object
Class Method Details
.download(creds, local_path, filename, options = {}) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/wormholio/ftp.rb', line 13 def self.download(creds,local_path,filename,={}) p 'FTP DOWNLOAD' connect(creds,) @wormholio_ftp.chdir("#{creds['dir_path']}") @wormholio_ftp.getbinaryfile(filename,"#{local_path}#{filename}") close_connection() end |
.upload(creds, file, options = {}) ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/wormholio/ftp.rb', line 5 def self.upload(creds,file,={}) p 'FTP UPLOAD' connect(creds,) @wormholio_ftp.chdir("#{creds['dir_path']}") @wormholio_ftp.putbinaryfile(file) close_connection() end |