Skip to content

Instantly share code, notes, and snippets.

@chmurph2
Created October 17, 2012 17:25
Show Gist options
  • Save chmurph2/3906869 to your computer and use it in GitHub Desktop.
Save chmurph2/3906869 to your computer and use it in GitHub Desktop.
require 'niftp'
class SomeObject
include NiFTP
def ftp_stuff
# get a file from an FTP Secure (FTPS) server
ftp("ftp.appareldownload.com", { username: "changeme", password: "changeme", ftps: true }) do |client|
p "Connected to Alpha! Buyakasha!"
files = client.list('s*')
p "the files in the root dir: #{files}"
# ...
file = client.gettextfile('shipments-alp-1087534.txt', 'shipments-alp-1087534.txt', 1024)
# ...
end
end
end
SomeObject.new.ftp_stuff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment