1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
(config) {|ftp| ftp(from_remote, to_local)} end (config) {|ftp| ftp(from_local, to_remote)} end private # This will open up an FTP connection, yield to the block, and then close the connection Net(config[:url],config[:username], config[:password]) do |ftp| ftp(config[:folder]) unless config[:folder] yield(ftp) end end end |
Pastie
