Just need to download a file

This is my first attempt at anything with Ruby- I am working with the execute script processor in NIFI and need to download a file. Normally I would use python but the processor does not support what I need to do. I know Ruby can . I simply need to download this file ftp://ftp.ut-capitole.fr/pub/reseau/cache/squidguard_contrib/blacklists.tar.gz and save it to a directory . I can do automation and timing with Nifi but need to know how to build a script to start the dload in ruby. I do not have to login or authenticate …just download. Help?
Thank you

Try something like this

require 'open-uri'
open('blacklists.tar.gz', 'wb') do |file|
  file << open('ftp://ftp.ut-capitole.fr/pub/reseau/cache/squidguard_contrib/blacklists.tar.gz').read

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs