I am trying to search for all files of a given type in a given folder and copy them to a new folder.
I need to specify a root folder and search through that folder a
As a small improvement to Jergason and Matt's answer above, here's how you can condense to a single line:
pdf_file_paths = Find.find('path/to/search').select { |p| /.*\.pdf$/ =~ p }
This uses the Find method as above, but leverages the fact that the result is an enumerable (and as such we can use select) to get an array back with the set of matches