require 'net/ftp'ftp = Net::FTP.new('ftp.ruby-lang.org')ftp.passive = trueftp.login(username, password)ftp.list('*') { |file| puts file }ftp.close