Possible Duplicate:
How do I download a binary file over HTTP using Ruby?
I have an array called pdf_links
containing links to PDF files collected by the Mechanize gem.
http://site/file1.pdf http://site/file2.pdf http://site/file3.pdf http://site/file4.pdf http://site/file5.pdf http://site/file6.pdf http://site/file7.pdf
I need to save all the PDF files to my directory.
What is the best way to do it with Ruby?
I tried to do it using *nix string but I'm receiving an error:
pdf_links.each do |d| system %x{ wget #{d} } end