Class: Ftp

Inherits:
Object
  • Object
show all
Defined in:
lib/wormholio/ftp.rb

Class Method Summary collapse

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,options={})
    p 'FTP DOWNLOAD'
    connect(creds,options)
    @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,options={})
    p 'FTP UPLOAD'
    connect(creds,options)
    @wormholio_ftp.chdir("#{creds['dir_path']}")
    @wormholio_ftp.putbinaryfile(file)
    close_connection()
end